summary refs log tree commit diff
path: root/gnu/packages/wine.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/wine.scm')
-rw-r--r--gnu/packages/wine.scm320
1 files changed, 142 insertions, 178 deletions
diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 6e86add4e3..88f146b46b 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
+;;; Copyright © 2023 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -73,10 +74,12 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1))
 
-(define-public wine
+;; This minimal build of Wine is needed to prevent a circular dependency with
+;; vkd3d.
+(define-public wine-minimal
   (package
-    (name "wine")
-    (version "7.19")
+    (name "wine-minimal")
+    (version "8.0")
     (source
      (origin
        (method url-fetch)
@@ -88,10 +91,79 @@
               (string-append "https://dl.winehq.org/wine/source/" dir
                              "wine-" version ".tar.xz")))
        (sha256
-        (base32 "08cxigkd83as6gkqgiwdpvr7cyy5ajsnhan3jbadwzqxdrz4kb23"))))
+        (base32 "0bkr3klvjy8h4djddr31fvapsi9pc2rsiyhaa7j1lwpq704w4wh2"))))
     (build-system gnu-build-system)
+    (native-inputs (list bison flex))
+    (inputs `())
+    (arguments
+     (list
+      ;; Force a 32-bit build targeting a similar architecture, i.e.:
+      ;; armhf for armhf/aarch64, i686 for i686/x86_64.
+      #:system (match (%current-system)
+                 ((or "armhf-linux" "aarch64-linux") "armhf-linux")
+                 (_ "i686-linux"))
+
+       ;; XXX: There's a test suite, but it's unclear whether it's supposed to
+       ;; pass.
+       #:tests? #f
+
+       #:make-flags
+       #~(list "SHELL=bash"
+               (string-append "libdir=" #$output "/lib/wine32"))
+
+       #:phases
+       #~(modify-phases %standard-phases
+           (add-after 'unpack 'patch-SHELL
+             (lambda _
+               (substitute* "configure"
+                 ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
+                 (("/bin/sh")
+                  (which "bash")))))
+           (add-after 'configure 'patch-dlopen-paths
+             ;; Hardcode dlopened sonames to absolute paths.
+             (lambda _
+               (let* ((library-path (search-path-as-string->list
+                                     (getenv "LIBRARY_PATH")))
+                      (find-so (lambda (soname)
+                                 (search-path library-path soname))))
+                 (substitute* "include/config.h"
+                   (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
+                    (format #f "~a\"~a\"" defso (find-so soname)))))))
+           (add-after 'patch-generated-file-shebangs 'patch-makedep
+             (lambda* (#:key outputs #:allow-other-keys)
+               (substitute* "tools/makedep.c"
+                 (("output_filenames\\( unix_libs \\);" all)
+                  (string-append all
+                   "output ( \" -Wl,-rpath=%s \", arch_install_dirs[arch] );")))))
+           (add-before 'build 'set-widl-time-override
+             ;; Set WIDL_TIME_OVERRIDE to avoid embedding the current date in
+             ;; files generated by WIDL.
+             (lambda _
+               (setenv "WIDL_TIME_OVERRIDE" "315532800"))))
+       #:configure-flags
+       #~(list "--without-freetype"
+               "--without-x")))
+    (home-page "https://www.winehq.org/")
+    (synopsis "Implementation of the Windows API (32-bit only)")
+    (description
+     "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
+compatibility layer capable of running Windows applications.  Instead of
+simulating internal Windows logic like a virtual machine or emulator, Wine
+translates Windows API calls into POSIX calls on-the-fly, eliminating the
+performance and memory penalties of other methods and allowing you to cleanly
+integrate Windows applications into your desktop.")
+    ;; Any platform should be able to build wine, but based on '#:system' these
+    ;; are the ones we currently support.
+    (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
+    (license license:lgpl2.1+)))
+
+(define-public wine
+  (package
+    (inherit wine-minimal)
+    (name "wine")
     (native-inputs
-     (list bison flex gettext-minimal perl pkg-config))
+     (modify-inputs (package-native-inputs wine-minimal)
+       (prepend gettext-minimal perl pkg-config)))
     (inputs
      ;; Some libraries like libjpeg are now compiled into native PE objects.
      ;; The ELF objects provided by Guix packages are of no use.  Whilst this
@@ -99,6 +171,7 @@
      ;; to build some of these from Guix PACKAGE-SOURCE but attempts were not
      ;; fruitful so far.  See <https://www.winehq.org/announce/7.0>.
      (list alsa-lib
+           bash-minimal
            cups
            dbus
            eudev
@@ -131,26 +204,9 @@
            vkd3d
            vulkan-loader))
     (arguments
-     (list
-      ;; Force a 32-bit build targeting a similar architecture, i.e.:
-      ;; armhf for armhf/aarch64, i686 for i686/x86_64.
-      #:system (match (%current-system)
-                 ((or "armhf-linux" "aarch64-linux") "armhf-linux")
-                 (_ "i686-linux"))
-
-       ;; XXX: There's a test suite, but it's unclear whether it's supposed to
-       ;; pass.
-       #:tests? #f
-
-       #:configure-flags
-       #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib/wine32"))
-
-       #:make-flags
-       #~(list "SHELL=bash"
-               (string-append "libdir=" #$output "/lib/wine32"))
-
-       #:phases
-       #~(modify-phases %standard-phases
+     (substitute-keyword-arguments (package-arguments wine-minimal)
+       ((#:phases phases)
+        #~(modify-phases #$phases
            ;; Explicitly set the 32-bit version of vulkan-loader when installing
            ;; to i686-linux or x86_64-linux.
            ;; TODO: Add more JSON files as they become available in Mesa.
@@ -175,42 +231,8 @@
                                               "/radeon_icd.i686.json" ":"
                                               icd "/intel_icd.i686.json")))))))))
                 (_
-                 `()))
-           (add-after 'unpack 'patch-SHELL
-             (lambda _
-               (substitute* "configure"
-                 ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
-                 (("/bin/sh")
-                  (which "bash")))))
-           (add-after 'configure 'patch-dlopen-paths
-             ;; Hardcode dlopened sonames to absolute paths.
-             (lambda _
-               (let* ((library-path (search-path-as-string->list
-                                     (getenv "LIBRARY_PATH")))
-                      (find-so (lambda (soname)
-                                 (search-path library-path soname))))
-                 (substitute* "include/config.h"
-                   (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                    (format #f "~a\"~a\"" defso (find-so soname)))))))
-           (add-after 'patch-generated-file-shebangs 'patch-makedep
-             (lambda* (#:key outputs #:allow-other-keys)
-               (substitute* "tools/makedep.c"
-                 (("output_filenames\\( unix_libs \\);" all)
-                  (string-append all
-                                 "output ( \" -Wl,-rpath=%s \", so_dir );"))))))))
-    (home-page "https://www.winehq.org/")
-    (synopsis "Implementation of the Windows API (32-bit only)")
-    (description
-     "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
-compatibility layer capable of running Windows applications.  Instead of
-simulating internal Windows logic like a virtual machine or emulator, Wine
-translates Windows API calls into POSIX calls on-the-fly, eliminating the
-performance and memory penalties of other methods and allowing you to cleanly
-integrate Windows applications into your desktop.")
-    ;; Any platform should be able to build wine, but based on '#:system' these
-    ;; are thr ones we currently support.
-    (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
-    (license license:lgpl2.1+)))
+                 `()))))
+       ((#:configure-flags _ '()) #~'())))))
 
 (define-public wine64
   (package
@@ -219,127 +241,69 @@ integrate Windows applications into your desktop.")
     (inputs (modify-inputs (package-inputs wine)
               (prepend wine)))
     (arguments
-     (cons*
-      #:make-flags
-      #~(list "SHELL=bash"
-              (string-append "libdir=" #$output "/lib/wine64"))
-      #:phases
-      #~(modify-phases %standard-phases
-          ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
-          ;; when installing to x86_64-linux so both are available.
-          ;; TODO: Add more JSON files as they become available in Mesa.
-          #$@(match (%current-system)
-               ((or "x86_64-linux")
-                `((add-after 'copy-wine32-binaries 'wrap-executable
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (icd-files (map
-                                         (lambda (basename)
-                                           (search-input-file
-                                            inputs
-                                            (string-append "/share/vulkan/icd.d/"
-                                                           basename)))
-                                         '("radeon_icd.x86_64.json"
-                                           "intel_icd.x86_64.json"
-                                           "radeon_icd.i686.json"
-                                           "intel_icd.i686.json"))))
-                        (wrap-program (string-append out "/bin/wine-preloader")
-                          `("VK_ICD_FILENAMES" ":" = ,icd-files))
-                        (wrap-program (string-append out "/bin/wine64-preloader")
-                          `("VK_ICD_FILENAMES" ":" = ,icd-files)))))))
-               (_
-                `()))
-          (add-after 'unpack 'patch-SHELL
-            (lambda _
-              (substitute* "configure"
-                ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
-                (("/bin/sh")
-                 (which "bash")))))
-          (add-after 'patch-generated-file-shebangs 'patch-makedep
-            (lambda* (#:key outputs #:allow-other-keys)
-              (substitute* "tools/makedep.c"
-                (("output_filenames\\( unix_libs \\);" all)
-                 (string-append all
-                                "output ( \" -Wl,-rpath=%s \", so_dir );")))))
-          (add-after 'install 'copy-wine32-binaries
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              (let ((out (assoc-ref %outputs "out")))
-                ;; Copy the 32-bit binaries needed for WoW64.
-                (copy-file (search-input-file inputs "/bin/wine")
-                           (string-append out "/bin/wine"))
-                ;; Copy the real 32-bit wine-preloader instead of the wrapped
-                ;; version.
-                (copy-file (search-input-file inputs "/bin/.wine-preloader-real")
-                           (string-append out "/bin/wine-preloader")))))
-          (add-after 'install 'copy-wine32-libraries
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              (let* ((out (assoc-ref %outputs "out")))
-                (copy-recursively (search-input-directory inputs "/lib/wine32")
-                                  (string-append out "/lib/wine32")))))
-          (add-after 'compress-documentation 'copy-wine32-manpage
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              (let* ((out (assoc-ref %outputs "out")))
-                ;; Copy the missing man file for the wine binary from wine.
-                (copy-file (search-input-file inputs "/share/man/man1/wine.1.gz")
-                           (string-append out "/share/man/man1/wine.1.gz")))))
-          (add-after 'configure 'patch-dlopen-paths
-            ;; Hardcode dlopened sonames to absolute paths.
-            (lambda _
-              (let* ((library-path (search-path-as-string->list
-                                    (getenv "LIBRARY_PATH")))
-                     (find-so (lambda (soname)
-                                (search-path library-path soname))))
-                (substitute* "include/config.h"
-                  (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                   (format #f "~a\"~a\"" defso (find-so soname))))))))
-      #:configure-flags
-      #~(list "--enable-win64"
-              (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib/wine64"))
-      (strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
-                                 #:system)
-                               (package-arguments wine))))
+     (substitute-keyword-arguments
+         (strip-keyword-arguments '(#:system) (package-arguments wine))
+       ((#:make-flags _)
+        #~(list "SHELL=bash"
+                (string-append "libdir=" #$output "/lib/wine64"))
+        )
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
+            ;; when installing to x86_64-linux so both are available.
+            ;; TODO: Add more JSON files as they become available in Mesa.
+            #$@(match (%current-system)
+                 ((or "x86_64-linux")
+                  `((delete 'wrap-executable)
+                    (add-after 'copy-wine32-binaries 'wrap-executable
+                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (icd-files (map
+                                           (lambda (basename)
+                                             (search-input-file
+                                              inputs
+                                              (string-append "/share/vulkan/icd.d/"
+                                                             basename)))
+                                           '("radeon_icd.x86_64.json"
+                                             "intel_icd.x86_64.json"
+                                             "radeon_icd.i686.json"
+                                             "intel_icd.i686.json"))))
+                          (wrap-program (string-append out "/bin/wine-preloader")
+                            `("VK_ICD_FILENAMES" ":" = ,icd-files))
+                          (wrap-program (string-append out "/bin/wine64-preloader")
+                            `("VK_ICD_FILENAMES" ":" = ,icd-files)))))))
+                 (_
+                  `()))
+            (add-after 'install 'copy-wine32-binaries
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let ((out (assoc-ref %outputs "out")))
+                  ;; Copy the 32-bit binaries needed for WoW64.
+                  (copy-file (search-input-file inputs "/bin/wine")
+                             (string-append out "/bin/wine"))
+                  ;; Copy the real 32-bit wine-preloader instead of the wrapped
+                  ;; version.
+                  (copy-file (search-input-file inputs "/bin/.wine-preloader-real")
+                             (string-append out "/bin/wine-preloader")))))
+            (add-after 'install 'copy-wine32-libraries
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((out (assoc-ref %outputs "out")))
+                  (copy-recursively (search-input-directory inputs "/lib/wine32")
+                                    (string-append out "/lib/wine32")))))
+            (add-after 'compress-documentation 'copy-wine32-manpage
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (let* ((out (assoc-ref %outputs "out")))
+                  ;; Copy the missing man file for the wine binary from wine.
+                  (copy-file (search-input-file inputs "/share/man/man1/wine.1.gz")
+                             (string-append out "/share/man/man1/wine.1.gz")))))))
+       ((#:configure-flags configure-flags '())
+        #~(cons "--enable-win64" #$configure-flags))))
     (synopsis "Implementation of the Windows API (WoW64 version)")
     (supported-systems '("x86_64-linux" "aarch64-linux"))))
 
-;; This minimal build of Wine is needed to prevent a circular dependency with
-;; vkd3d.
-(define-public wine-minimal
-  (package
-    (inherit wine)
-    (name "wine-minimal")
-    (native-inputs (modify-inputs (package-native-inputs wine)
-                     (delete "gettext" "perl" "pkg-config")))
-    (inputs `())
-    (arguments
-     `(#:validate-runpath? #f
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-SHELL
-           (lambda _
-             (substitute* "configure"
-               ;; configure first respects CONFIG_SHELL, clobbers SHELL later.
-               (("/bin/sh")
-                (which "bash")))))
-         (add-after 'configure 'patch-dlopen-paths
-           ;; Hardcode dlopened sonames to absolute paths.
-           (lambda _
-             (let* ((library-path (search-path-as-string->list
-                                   (getenv "LIBRARY_PATH")))
-                    (find-so (lambda (soname)
-                               (search-path library-path soname))))
-               (substitute* "include/config.h"
-                 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                  (format #f "~a\"~a\"" defso (find-so soname))))))))
-       #:configure-flags
-       (list "--without-freetype"
-             "--without-x")
-       ,@(strip-keyword-arguments '(#:configure-flags #:phases)
-                                  (package-arguments wine))))))
-
 (define-public wine-staging-patchset-data
   (package
     (name "wine-staging-patchset-data")
-    (version "7.8")
+    (version "8.0")
     (source
      (origin
        (method git-fetch)
@@ -348,7 +312,7 @@ integrate Windows applications into your desktop.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "02rgpymhqrdr3aamvv6yvpgh82rj1n4adr36mi26cs3zbkx8zb55"))))
+        (base32 "11q9fa1jdrv1pd9piaicgqvidq1c08imkwpqhyzcj5r711rl7581"))))
     (build-system trivial-build-system)
     (native-inputs
      (list bash coreutils))
@@ -398,7 +362,7 @@ integrate Windows applications into your desktop.")
                              "wine-" wine-version ".tar.xz"))
          (file-name (string-append name "-" wine-version ".tar.xz"))
          (sha256
-          (base32 "1f0r00b6lk59cmpj42b7f2jrd58d7vxfvpp54j7arwjhdg4yjxlg")))))
+          (base32 "0bkr3klvjy8h4djddr31fvapsi9pc2rsiyhaa7j1lwpq704w4wh2")))))
     (inputs (modify-inputs (package-inputs wine)
               (prepend autoconf ; for autoreconf
                        ffmpeg