summaryrefslogtreecommitdiff
path: root/gnu/packages/wine.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/wine.scm')
-rw-r--r--gnu/packages/wine.scm239
1 files changed, 187 insertions, 52 deletions
diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 802b3dd38f..9881386583 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2014, 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
@@ -66,12 +66,13 @@
#:use-module (gnu packages vulkan)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
- #:use-module (ice-9 match))
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1))
(define-public wine
(package
(name "wine")
- (version "3.0.4")
+ (version "4.0")
(source (origin
(method url-fetch)
(uri (string-append "https://dl.winehq.org/wine/source/"
@@ -79,7 +80,7 @@
"/wine-" version ".tar.xz"))
(sha256
(base32
- "037vlrk80lagy362w7500i2ldwvdwsadrknajzi67cvxpvnqhnnl"))))
+ "0k8d90mgjzv8vjspmnxzr3i5mbccxnbr9hf03q1bpf5jjppcsdk7"))))
(build-system gnu-build-system)
(native-inputs `(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
@@ -122,8 +123,11 @@
("ncurses" ,ncurses)
("openal" ,openal)
("pulseaudio" ,pulseaudio)
+ ("sdl2" ,sdl2)
("unixodbc" ,unixodbc)
("v4l-utils" ,v4l-utils)
+ ("vkd3d" ,vkd3d)
+ ("vulkan-loader" ,vulkan-loader)
("zlib" ,zlib)))
(arguments
`(;; Force a 32-bit build targeting a similar architecture, i.e.:
@@ -147,6 +151,27 @@
#:phases
(modify-phases %standard-phases
+ ;; Explicitely 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.
+ ,@(match (%current-system)
+ ((or "i686-linux" "x86_64-linux")
+ `((add-after 'install 'wrap-executable
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (icd (string-append out "/share/vulkan/icd.d")))
+ (mkdir-p icd)
+ (copy-file (string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.i686.json")
+ (string-append icd "/radeon_icd.i686.json"))
+ (wrap-program (string-append out "/bin/wine-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append icd
+ "/radeon_icd.i686.json"))))
+ #t)))))
+ (_
+ `())
+ )
(add-after 'configure 'patch-dlopen-paths
;; Hardcode dlopened sonames to absolute paths.
(lambda _
@@ -184,6 +209,34 @@ integrate Windows applications into your desktop.")
(string-append "libdir=" %output "/lib/wine64"))
#:phases
(modify-phases %standard-phases
+ ;; Explicitely 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")))
+ (wrap-program (string-append out "/bin/wine-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
+ (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
+ (assoc-ref inputs "wine")
+ "/share/vulkan/icd.d/radeon_icd.i686.json"))))
+ (wrap-program (string-append out "/bin/wine64-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.x86_64.json"
+ ":" (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/intel_icd.x86_64.json"
+ ":" (assoc-ref inputs "wine")
+ "/share/vulkan/icd.d/radeon_icd.i686.json"))))
+ #t)))))
+ (_
+ `())
+ )
(add-after 'install 'copy-wine32-binaries
(lambda* (#:key outputs #:allow-other-keys)
(let* ((wine32 (assoc-ref %build-inputs "wine"))
@@ -191,7 +244,9 @@ integrate Windows applications into your desktop.")
;; Copy the 32-bit binaries needed for WoW64.
(copy-file (string-append wine32 "/bin/wine")
(string-append out "/bin/wine"))
- (copy-file (string-append wine32 "/bin/wine-preloader")
+ ;; Copy the real 32-bit wine-preloader instead of the wrapped
+ ;; version.
+ (copy-file (string-append wine32 "/bin/.wine-preloader-real")
(string-append out "/bin/wine-preloader"))
#t)))
(add-after 'compress-documentation 'copy-wine32-manpage
@@ -222,50 +277,80 @@ integrate Windows applications into your desktop.")
(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 (fold alist-delete (package-native-inputs wine)
+ '("gettext" "perl" "pkg-config")))
+ (inputs `())
+ (arguments
+ `(#:validate-runpath? #f
+ #:phases
+ (modify-phases %standard-phases
+ (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))))
+ #t))))
+ #: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 "3.21")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/wine-staging/wine-staging")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "1bxryvqw5rvhcx8vjl714jaj0rjsrh95kh3sn499rrljc3c8qsbl"))))
- (build-system trivial-build-system)
- (native-inputs
- `(("bash" ,bash)
- ("coreutils" ,coreutils)))
- (arguments
- `(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let* ((build-directory ,(string-append name "-" version))
- (source (assoc-ref %build-inputs "source"))
- (bash (assoc-ref %build-inputs "bash"))
- (coreutils (assoc-ref %build-inputs "coreutils"))
- (out (assoc-ref %outputs "out"))
- (wine-staging (string-append out "/share/wine-staging")))
- (copy-recursively source build-directory)
- (with-directory-excursion build-directory
- (substitute* "patches/patchinstall.sh"
- (("/bin/sh")
- (string-append bash "/bin/sh")))
- (substitute* "patches/gitapply.sh"
- (("/usr/bin/env")
- (string-append coreutils "/bin/env"))))
- (copy-recursively build-directory wine-staging)
- #t))))
- (home-page "https://github.com/wine-staging")
- (synopsis "Patchset for Wine")
- (description
- "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
- (license license:lgpl2.1+)))
+ (name "wine-staging-patchset-data")
+ (version "4.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/wine-staging/wine-staging")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1jp5s4k3cwiw6jy8lih25n0c7nyrddr6dm7vlyfdfrl2gkah94z0"))))
+ (build-system trivial-build-system)
+ (native-inputs
+ `(("bash" ,bash)
+ ("coreutils" ,coreutils)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((build-directory ,(string-append name "-" version))
+ (source (assoc-ref %build-inputs "source"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (coreutils (assoc-ref %build-inputs "coreutils"))
+ (out (assoc-ref %outputs "out"))
+ (wine-staging (string-append out "/share/wine-staging")))
+ (copy-recursively source build-directory)
+ (with-directory-excursion build-directory
+ (substitute* "patches/patchinstall.sh"
+ (("/bin/sh")
+ (string-append bash "/bin/sh")))
+ (substitute* "patches/gitapply.sh"
+ (("/usr/bin/env")
+ (string-append coreutils "/bin/env"))))
+ (copy-recursively build-directory wine-staging)
+ #t))))
+ (home-page "https://github.com/wine-staging")
+ (synopsis "Patchset for Wine")
+ (description
+ "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
+ (license license:lgpl2.1+)))
(define-public wine-staging
(package
@@ -281,20 +366,40 @@ integrate Windows applications into your desktop.")
(file-name (string-append name "-" version ".tar.xz"))
(sha256
(base32
- "1h70wb7kysbzv36i3fblyiihvalwhy6sj4s2a8nf21nz2mhc0k58"))))
+ "1b8vwid8wsy1ss2q27bqkd9sdl67qqh0kmazi87vspi40nz7bxyf"))))
(inputs `(("autoconf" ,autoconf) ; for autoreconf
+ ("ffmpeg" ,ffmpeg)
("gtk+" ,gtk+)
("libva" ,libva)
+ ("mesa" ,mesa)
("python" ,python)
- ("sdl2" ,sdl2)
("util-linux" ,util-linux) ; for hexdump
- ("vkd3d" ,vkd3d)
- ("vulkan-loader" ,vulkan-loader)
("wine-staging-patchset-data" ,wine-staging-patchset-data)
,@(package-inputs wine)))
(arguments
`(#:phases
(modify-phases %standard-phases
+ ;; Explicitely 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.
+ ,@(match (%current-system)
+ ((or "i686-linux" "x86_64-linux")
+ `((add-after 'install 'wrap-executable
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (icd (string-append out "/share/vulkan/icd.d")))
+ (mkdir-p icd)
+ (copy-file (string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.i686.json")
+ (string-append icd "/radeon_icd.i686.json"))
+ (wrap-program (string-append out "/bin/wine-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append icd
+ "/radeon_icd.i686.json"))))
+ #t)))))
+ (_
+ `())
+ )
(add-before 'configure 'patch-source-wine-staging
(lambda* (#:key outputs #:allow-other-keys)
(let* ((source (assoc-ref %build-inputs "source"))
@@ -343,6 +448,34 @@ integrated into the main branch.")
(string-append "libdir=" %output "/lib/wine64"))
#:phases
(modify-phases %standard-phases
+ ;; Explicitely 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")))
+ (wrap-program (string-append out "/bin/wine-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
+ (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
+ (assoc-ref inputs "wine-staging")
+ "/share/vulkan/icd.d/radeon_icd.i686.json"))))
+ (wrap-program (string-append out "/bin/wine64-preloader")
+ `("VK_ICD_FILENAMES" ":" =
+ (,(string-append (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/radeon_icd.x86_64.json"
+ ":" (assoc-ref inputs "mesa")
+ "/share/vulkan/icd.d/intel_icd.x86_64.json"
+ ":" (assoc-ref inputs "wine-staging")
+ "/share/vulkan/icd.d/radeon_icd.i686.json"))))
+ #t)))))
+ (_
+ `())
+ )
(add-before 'configure 'patch-source-wine-staging
(lambda* (#:key outputs #:allow-other-keys)
(let* ((source (assoc-ref %build-inputs "source"))
@@ -358,7 +491,9 @@ integrated into the main branch.")
;; Copy the 32-bit binaries needed for WoW64.
(copy-file (string-append wine32 "/bin/wine")
(string-append out "/bin/wine"))
- (copy-file (string-append wine32 "/bin/wine-preloader")
+ ;; Copy the real 32-bit wine-preloader instead of the wrapped
+ ;; version.
+ (copy-file (string-append wine32 "/bin/.wine-preloader-real")
(string-append out "/bin/wine-preloader"))
#t)))
(add-after 'compress-documentation 'copy-wine32-manpage