gnu: wine-staging: Update to 4.13.
[jackhill/guix/guix.git] / gnu / packages / wine.scm
CommitLineData
8f9580ca 1;;; GNU Guix --- Functional package management for GNU
d43ba6f8 2;;; Copyright © 2014, 2015 Sou Bunnbu <iyzsong@gmail.com>
eeabe5a1 3;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
7ba2a1af 4;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
a51ac7af 5;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
51f01907 6;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
ac12a013 7;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8f9580ca
SB
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24(define-module (gnu packages wine)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
f868276b 28 #:use-module (guix git-download)
eeabe5a1 29 #:use-module (guix utils)
8f9580ca 30 #:use-module (guix build-system gnu)
f6246195 31 #:use-module (guix build-system trivial)
8f9580ca 32 #:use-module (gnu packages)
1aa6582e 33 #:use-module (gnu packages admin)
025cc9a1 34 #:use-module (gnu packages audio)
b53b9c8d 35 #:use-module (gnu packages autotools)
f6246195
RH
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bash)
8f9580ca
SB
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages compression)
025cc9a1 40 #:use-module (gnu packages cups)
8f9580ca
SB
41 #:use-module (gnu packages databases)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages image)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages glib)
1aa6582e 49 #:use-module (gnu packages gstreamer)
141708ed 50 #:use-module (gnu packages gtk)
d95e4864 51 #:use-module (gnu packages kerberos)
8f9580ca
SB
52 #:use-module (gnu packages linux)
53 #:use-module (gnu packages openldap)
54 #:use-module (gnu packages perl)
05740895 55 #:use-module (gnu packages pulseaudio)
8f9580ca 56 #:use-module (gnu packages pkg-config)
b53b9c8d 57 #:use-module (gnu packages python)
8f9580ca
SB
58 #:use-module (gnu packages mp3)
59 #:use-module (gnu packages ncurses)
60 #:use-module (gnu packages photo)
61 #:use-module (gnu packages samba)
62 #:use-module (gnu packages scanner)
51158d83 63 #:use-module (gnu packages sdl)
a7fd7b68 64 #:use-module (gnu packages tls)
1aa6582e 65 #:use-module (gnu packages video)
39b4744a 66 #:use-module (gnu packages vulkan)
8f9580ca 67 #:use-module (gnu packages xml)
b4a330ac 68 #:use-module (gnu packages xorg)
a5466f38
RH
69 #:use-module (ice-9 match)
70 #:use-module (srfi srfi-1))
8f9580ca
SB
71
72(define-public wine
73 (package
74 (name "wine")
e3c5ff3e 75 (version "4.0.1")
8f9580ca
SB
76 (source (origin
77 (method url-fetch)
6f10e74f
EF
78 (uri (string-append "https://dl.winehq.org/wine/source/"
79 (version-major+minor version)
5a717a95 80 "/wine-" version ".tar.xz"))
8f9580ca
SB
81 (sha256
82 (base32
e3c5ff3e 83 "0j29df0px6dzin4j0cbxgza4msvf9spmwranv25krq1g9kq959nk"))))
8f9580ca
SB
84 (build-system gnu-build-system)
85 (native-inputs `(("pkg-config" ,pkg-config)
b94a6ca0 86 ("gettext" ,gettext-minimal)
5e54f4ad 87 ("flex" ,flex)
8f9580ca
SB
88 ("bison" ,bison)
89 ("perl" ,perl)))
90 (inputs
91 `(("alsa-lib" ,alsa-lib)
92 ("dbus" ,dbus)
025cc9a1 93 ("cups" ,cups)
1aa6582e 94 ("eudev" ,eudev)
8f9580ca
SB
95 ("fontconfig" ,fontconfig)
96 ("freetype" ,freetype)
025cc9a1 97 ("glu" ,glu)
8f9580ca 98 ("gnutls" ,gnutls)
1aa6582e 99 ("gst-plugins-base" ,gst-plugins-base)
8f9580ca
SB
100 ("lcms" ,lcms)
101 ("libxml2" ,libxml2)
102 ("libxslt" ,libxslt)
103 ("libgphoto2" ,libgphoto2)
104 ("libmpg123" ,mpg123)
105 ("libldap" ,openldap)
106 ("libnetapi" ,samba)
4c928743 107 ("libsane" ,sane-backends)
1aa6582e 108 ("libpcap" ,libpcap)
8f9580ca
SB
109 ("libpng" ,libpng)
110 ("libjpeg" ,libjpeg)
111 ("libtiff" ,libtiff)
112 ("libICE" ,libice)
113 ("libX11" ,libx11)
114 ("libXi" ,libxi)
115 ("libXext" ,libxext)
116 ("libXcursor" ,libxcursor)
117 ("libXrender" ,libxrender)
118 ("libXrandr" ,libxrandr)
119 ("libXinerama" ,libxinerama)
120 ("libXxf86vm" ,libxxf86vm)
121 ("libXcomposite" ,libxcomposite)
d95e4864 122 ("mit-krb5" ,mit-krb5)
8f9580ca 123 ("ncurses" ,ncurses)
025cc9a1 124 ("openal" ,openal)
05740895 125 ("pulseaudio" ,pulseaudio)
0e41f95e 126 ("sdl2" ,sdl2)
8f9580ca 127 ("unixodbc" ,unixodbc)
1aa6582e 128 ("v4l-utils" ,v4l-utils)
e3b1d4ea 129 ("vkd3d" ,vkd3d)
0e41f95e 130 ("vulkan-loader" ,vulkan-loader)
8f9580ca
SB
131 ("zlib" ,zlib)))
132 (arguments
b4a330ac
EF
133 `(;; Force a 32-bit build targeting a similar architecture, i.e.:
134 ;; armhf for armhf/aarch64, i686 for i686/x86_64.
135 #:system ,@(match (%current-system)
136 ((or "armhf-linux" "aarch64-linux")
137 `("armhf-linux"))
138 (_
139 `("i686-linux")))
8f9580ca
SB
140
141 ;; XXX: There's a test suite, but it's unclear whether it's supposed to
142 ;; pass.
143 #:tests? #f
144
6c0dfb19 145 #:configure-flags
5cead945 146 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
6c0dfb19 147
eeabe5a1 148 #:make-flags
5cead945
RH
149 (list "SHELL=bash"
150 (string-append "libdir=" %output "/lib/wine32"))
eeabe5a1 151
8f9580ca 152 #:phases
07cda02c 153 (modify-phases %standard-phases
d39a54ff
RH
154 ;; Explicitely set the 32-bit version of vulkan-loader when installing
155 ;; to i686-linux or x86_64-linux.
156 ;; TODO: Add more JSON files as they become available in Mesa.
157 ,@(match (%current-system)
158 ((or "i686-linux" "x86_64-linux")
159 `((add-after 'install 'wrap-executable
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out"))
162 (icd (string-append out "/share/vulkan/icd.d")))
163 (mkdir-p icd)
164 (copy-file (string-append (assoc-ref inputs "mesa")
165 "/share/vulkan/icd.d/radeon_icd.i686.json")
166 (string-append icd "/radeon_icd.i686.json"))
167 (wrap-program (string-append out "/bin/wine-preloader")
168 `("VK_ICD_FILENAMES" ":" =
169 (,(string-append icd
170 "/radeon_icd.i686.json"))))
171 #t)))))
172 (_
173 `())
174 )
07cda02c
EF
175 (add-after 'configure 'patch-dlopen-paths
176 ;; Hardcode dlopened sonames to absolute paths.
177 (lambda _
178 (let* ((library-path (search-path-as-string->list
179 (getenv "LIBRARY_PATH")))
180 (find-so (lambda (soname)
181 (search-path library-path soname))))
182 (substitute* "include/config.h"
183 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
184 (format #f "~a\"~a\"" defso (find-so soname))))
185 #t))))))
658c987f 186 (home-page "https://www.winehq.org/")
06e57331 187 (synopsis "Implementation of the Windows API (32-bit only)")
8f9580ca
SB
188 (description
189 "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
190compatibility layer capable of running Windows applications. Instead of
191simulating internal Windows logic like a virtual machine or emulator, Wine
192translates Windows API calls into POSIX calls on-the-fly, eliminating the
193performance and memory penalties of other methods and allowing you to cleanly
194integrate Windows applications into your desktop.")
7ba2a1af
EF
195 ;; Any platform should be able to build wine, but based on '#:system' these
196 ;; are thr ones we currently support.
197 (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
cac274aa 198 (license license:lgpl2.1+)))
b3ebd241
RH
199
200(define-public wine64
201 (package
202 (inherit wine)
203 (name "wine64")
58cbcb02
RH
204 (inputs `(("wine" ,wine)
205 ,@(package-inputs wine)))
b3ebd241 206 (arguments
e02693a3
RH
207 `(#:make-flags
208 (list "SHELL=bash"
58cbcb02
RH
209 (string-append "libdir=" %output "/lib/wine64"))
210 #:phases
211 (modify-phases %standard-phases
d39a54ff
RH
212 ;; Explicitely set both the 64-bit and 32-bit versions of vulkan-loader
213 ;; when installing to x86_64-linux so both are available.
214 ;; TODO: Add more JSON files as they become available in Mesa.
215 ,@(match (%current-system)
216 ((or "x86_64-linux")
217 `((add-after 'copy-wine32-binaries 'wrap-executable
218 (lambda* (#:key inputs outputs #:allow-other-keys)
219 (let* ((out (assoc-ref outputs "out")))
220 (wrap-program (string-append out "/bin/wine-preloader")
221 `("VK_ICD_FILENAMES" ":" =
222 (,(string-append (assoc-ref inputs "mesa")
223 "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
224 (assoc-ref inputs "mesa")
225 "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
226 (assoc-ref inputs "wine")
227 "/share/vulkan/icd.d/radeon_icd.i686.json"))))
228 (wrap-program (string-append out "/bin/wine64-preloader")
229 `("VK_ICD_FILENAMES" ":" =
230 (,(string-append (assoc-ref inputs "mesa")
231 "/share/vulkan/icd.d/radeon_icd.x86_64.json"
232 ":" (assoc-ref inputs "mesa")
233 "/share/vulkan/icd.d/intel_icd.x86_64.json"
234 ":" (assoc-ref inputs "wine")
235 "/share/vulkan/icd.d/radeon_icd.i686.json"))))
236 #t)))))
237 (_
238 `())
239 )
036f3577 240 (add-after 'install 'copy-wine32-binaries
58cbcb02 241 (lambda* (#:key outputs #:allow-other-keys)
036f3577
RH
242 (let* ((wine32 (assoc-ref %build-inputs "wine"))
243 (out (assoc-ref %outputs "out")))
244 ;; Copy the 32-bit binaries needed for WoW64.
245 (copy-file (string-append wine32 "/bin/wine")
246 (string-append out "/bin/wine"))
d39a54ff
RH
247 ;; Copy the real 32-bit wine-preloader instead of the wrapped
248 ;; version.
249 (copy-file (string-append wine32 "/bin/.wine-preloader-real")
036f3577
RH
250 (string-append out "/bin/wine-preloader"))
251 #t)))
252 (add-after 'compress-documentation 'copy-wine32-manpage
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let* ((wine32 (assoc-ref %build-inputs "wine"))
255 (out (assoc-ref %outputs "out")))
256 ;; Copy the missing man file for the wine binary from wine.
257 (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
258 (string-append out "/share/man/man1/wine.1.gz"))
259 #t)))
58cbcb02
RH
260 (add-after 'configure 'patch-dlopen-paths
261 ;; Hardcode dlopened sonames to absolute paths.
262 (lambda _
263 (let* ((library-path (search-path-as-string->list
264 (getenv "LIBRARY_PATH")))
265 (find-so (lambda (soname)
266 (search-path library-path soname))))
267 (substitute* "include/config.h"
268 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
269 (format #f "~a\"~a\"" defso (find-so soname))))
270 #t))))
e02693a3 271 #:configure-flags
b3ebd241 272 (list "--enable-win64"
58cbcb02
RH
273 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
274 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
275 #:system)
b3ebd241 276 (package-arguments wine))))
68e49211 277 (synopsis "Implementation of the Windows API (WoW64 version)")
5010d0e3 278 (supported-systems '("x86_64-linux" "aarch64-linux"))))
f6444059 279
a5466f38
RH
280;; This minimal build of Wine is needed to prevent a circular dependency with
281;; vkd3d.
282(define-public wine-minimal
283 (package
284 (inherit wine)
285 (name "wine-minimal")
286 (native-inputs (fold alist-delete (package-native-inputs wine)
287 '("gettext" "perl" "pkg-config")))
288 (inputs `())
289 (arguments
290 `(#:validate-runpath? #f
d39a54ff
RH
291 #:phases
292 (modify-phases %standard-phases
293 (add-after 'configure 'patch-dlopen-paths
294 ;; Hardcode dlopened sonames to absolute paths.
295 (lambda _
296 (let* ((library-path (search-path-as-string->list
297 (getenv "LIBRARY_PATH")))
298 (find-so (lambda (soname)
299 (search-path library-path soname))))
300 (substitute* "include/config.h"
301 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
302 (format #f "~a\"~a\"" defso (find-so soname))))
303 #t))))
a5466f38
RH
304 #:configure-flags
305 (list "--without-freetype"
306 "--without-x")
d39a54ff 307 ,@(strip-keyword-arguments '(#:configure-flags #:phases)
a5466f38
RH
308 (package-arguments wine))))))
309
f6246195
RH
310(define-public wine-staging-patchset-data
311 (package
cb2ad4f5 312 (name "wine-staging-patchset-data")
09fd82ce 313 (version "4.13")
cb2ad4f5
RH
314 (source
315 (origin
316 (method git-fetch)
317 (uri (git-reference
318 (url "https://github.com/wine-staging/wine-staging")
319 (commit (string-append "v" version))))
320 (file-name (git-file-name name version))
321 (sha256
322 (base32
09fd82ce 323 "0bbwsd2qpjilxpjscqbp78p0gl0awj1yj62g0wvybh4x89fzy8zj"))))
cb2ad4f5
RH
324 (build-system trivial-build-system)
325 (native-inputs
326 `(("bash" ,bash)
327 ("coreutils" ,coreutils)))
328 (arguments
329 `(#:modules ((guix build utils))
330 #:builder
331 (begin
332 (use-modules (guix build utils))
333 (let* ((build-directory ,(string-append name "-" version))
334 (source (assoc-ref %build-inputs "source"))
335 (bash (assoc-ref %build-inputs "bash"))
336 (coreutils (assoc-ref %build-inputs "coreutils"))
337 (out (assoc-ref %outputs "out"))
338 (wine-staging (string-append out "/share/wine-staging")))
339 (copy-recursively source build-directory)
340 (with-directory-excursion build-directory
341 (substitute* "patches/patchinstall.sh"
342 (("/bin/sh")
343 (string-append bash "/bin/sh")))
344 (substitute* "patches/gitapply.sh"
345 (("/usr/bin/env")
346 (string-append coreutils "/bin/env"))))
347 (copy-recursively build-directory wine-staging)
348 #t))))
349 (home-page "https://github.com/wine-staging")
350 (synopsis "Patchset for Wine")
351 (description
352 "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
353 (license license:lgpl2.1+)))
f6246195 354
7866d8c8
NG
355(define-public wine-staging
356 (package
357 (inherit wine)
358 (name "wine-staging")
b53b9c8d 359 (version (package-version wine-staging-patchset-data))
7866d8c8
NG
360 (source (origin
361 (method url-fetch)
362 (uri (string-append
732a1489 363 "https://dl.winehq.org/wine/source/"
a10050e2 364 (version-major version) ".x"
732a1489 365 "/wine-" version ".tar.xz"))
b53b9c8d 366 (file-name (string-append name "-" version ".tar.xz"))
7866d8c8
NG
367 (sha256
368 (base32
09fd82ce 369 "0rqx8g394aj5q913cd18zsi60sldvxarrp178w6ja0y4rd8l25vr"))))
b53b9c8d 370 (inputs `(("autoconf" ,autoconf) ; for autoreconf
0fa3d705 371 ("faudio" ,faudio)
a51ac7af 372 ("ffmpeg" ,ffmpeg)
c695fb76
TGR
373 ("gtk+" ,gtk+)
374 ("libva" ,libva)
cb2ad4f5 375 ("mesa" ,mesa)
b53b9c8d
RH
376 ("python" ,python)
377 ("util-linux" ,util-linux) ; for hexdump
b53b9c8d 378 ("wine-staging-patchset-data" ,wine-staging-patchset-data)
141708ed 379 ,@(package-inputs wine)))
39b4744a
RH
380 (arguments
381 `(#:phases
382 (modify-phases %standard-phases
cb2ad4f5
RH
383 ;; Explicitely set the 32-bit version of vulkan-loader when installing
384 ;; to i686-linux or x86_64-linux.
385 ;; TODO: Add more JSON files as they become available in Mesa.
386 ,@(match (%current-system)
387 ((or "i686-linux" "x86_64-linux")
388 `((add-after 'install 'wrap-executable
389 (lambda* (#:key inputs outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (icd (string-append out "/share/vulkan/icd.d")))
392 (mkdir-p icd)
393 (copy-file (string-append (assoc-ref inputs "mesa")
394 "/share/vulkan/icd.d/radeon_icd.i686.json")
395 (string-append icd "/radeon_icd.i686.json"))
396 (wrap-program (string-append out "/bin/wine-preloader")
397 `("VK_ICD_FILENAMES" ":" =
398 (,(string-append icd
399 "/radeon_icd.i686.json"))))
400 #t)))))
401 (_
402 `())
403 )
b53b9c8d 404 (add-before 'configure 'patch-source-wine-staging
39b4744a 405 (lambda* (#:key outputs #:allow-other-keys)
b53b9c8d
RH
406 (let* ((source (assoc-ref %build-inputs "source"))
407 (script (string-append (assoc-ref %build-inputs
408 "wine-staging-patchset-data")
409 "/share/wine-staging/patches/patchinstall.sh")))
09fd82ce 410 (invoke script (string-append "DESTDIR=" ".") "--all")
39b4744a
RH
411 #t)))
412 (add-after 'configure 'patch-dlopen-paths
413 ;; Hardcode dlopened sonames to absolute paths.
414 (lambda _
415 (let* ((library-path (search-path-as-string->list
416 (getenv "LIBRARY_PATH")))
417 (find-so (lambda (soname)
418 (search-path library-path soname))))
419 (substitute* "include/config.h"
420 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
421 (format #f "~a\"~a\"" defso (find-so soname))))
422 #t))))
423 ,@(strip-keyword-arguments '(#:phases)
424 (package-arguments wine))))
95c45e53 425 (synopsis "Implementation of the Windows API (staging branch, 32-bit only)")
7866d8c8
NG
426 (description "Wine-Staging is the testing area of Wine. It
427contains bug fixes and features, which have not been integrated into
428the development branch yet. The idea of Wine-Staging is to provide
429experimental features faster to end users and to give developers the
430possibility to discuss and improve their patches before they are
431integrated into the main branch.")
b53b9c8d 432 (home-page "https://github.com/wine-staging")
7866d8c8
NG
433 ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging
434 ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use
435 ;; different licenses. In particular, the latter is licensed under
436 ;; both GPL3+ and Apache 2 License.
437 (license
438 (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
6cd46747
RH
439
440(define-public wine64-staging
441 (package
442 (inherit wine-staging)
443 (name "wine64-staging")
c41fb54f
RH
444 (inputs `(("wine-staging" ,wine-staging)
445 ,@(package-inputs wine-staging)))
6cd46747
RH
446 (arguments
447 `(#:make-flags
448 (list "SHELL=bash"
c41fb54f
RH
449 (string-append "libdir=" %output "/lib/wine64"))
450 #:phases
451 (modify-phases %standard-phases
cb2ad4f5
RH
452 ;; Explicitely set both the 64-bit and 32-bit versions of vulkan-loader
453 ;; when installing to x86_64-linux so both are available.
454 ;; TODO: Add more JSON files as they become available in Mesa.
455 ,@(match (%current-system)
456 ((or "x86_64-linux")
457 `((add-after 'copy-wine32-binaries 'wrap-executable
458 (lambda* (#:key inputs outputs #:allow-other-keys)
459 (let* ((out (assoc-ref outputs "out")))
460 (wrap-program (string-append out "/bin/wine-preloader")
461 `("VK_ICD_FILENAMES" ":" =
462 (,(string-append (assoc-ref inputs "mesa")
463 "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
464 (assoc-ref inputs "mesa")
465 "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
466 (assoc-ref inputs "wine-staging")
467 "/share/vulkan/icd.d/radeon_icd.i686.json"))))
468 (wrap-program (string-append out "/bin/wine64-preloader")
469 `("VK_ICD_FILENAMES" ":" =
470 (,(string-append (assoc-ref inputs "mesa")
471 "/share/vulkan/icd.d/radeon_icd.x86_64.json"
472 ":" (assoc-ref inputs "mesa")
473 "/share/vulkan/icd.d/intel_icd.x86_64.json"
474 ":" (assoc-ref inputs "wine-staging")
475 "/share/vulkan/icd.d/radeon_icd.i686.json"))))
476 #t)))))
477 (_
478 `())
479 )
3139f185 480 (add-before 'configure 'patch-source-wine-staging
ee5402bf 481 (lambda* (#:key outputs #:allow-other-keys)
3139f185
RH
482 (let* ((source (assoc-ref %build-inputs "source"))
483 (script (string-append (assoc-ref %build-inputs
484 "wine-staging-patchset-data")
485 "/share/wine-staging/patches/patchinstall.sh")))
0fa3d705
RH
486 ;; Exclude specific patches that conflict with FAudio.
487 (invoke script (string-append "DESTDIR=" ".") "--all" "-W"
488 "xaudio2-revert" "-W" "xaudio2_CommitChanges" "-W"
489 "xaudio2_7-WMA_support" "-W" "xaudio2_7-CreateFX-FXEcho")
ee5402bf 490 #t)))
e6b94a02
RH
491 (add-after 'install 'copy-wine32-binaries
492 (lambda* (#:key outputs #:allow-other-keys)
417903c6 493 (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
e6b94a02
RH
494 (out (assoc-ref %outputs "out")))
495 ;; Copy the 32-bit binaries needed for WoW64.
496 (copy-file (string-append wine32 "/bin/wine")
497 (string-append out "/bin/wine"))
cb2ad4f5
RH
498 ;; Copy the real 32-bit wine-preloader instead of the wrapped
499 ;; version.
500 (copy-file (string-append wine32 "/bin/.wine-preloader-real")
e6b94a02
RH
501 (string-append out "/bin/wine-preloader"))
502 #t)))
503 (add-after 'compress-documentation 'copy-wine32-manpage
c41fb54f 504 (lambda* (#:key outputs #:allow-other-keys)
417903c6 505 (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
e6b94a02
RH
506 (out (assoc-ref %outputs "out")))
507 ;; Copy the missing man file for the wine binary from
508 ;; wine-staging.
509 (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
510 (string-append out "/share/man/man1/wine.1.gz"))
511 #t)))
c41fb54f
RH
512 (add-after 'configure 'patch-dlopen-paths
513 ;; Hardcode dlopened sonames to absolute paths.
514 (lambda _
515 (let* ((library-path (search-path-as-string->list
516 (getenv "LIBRARY_PATH")))
517 (find-so (lambda (soname)
518 (search-path library-path soname))))
519 (substitute* "include/config.h"
520 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
521 (format #f "~a\"~a\"" defso (find-so soname))))
522 #t))))
6cd46747
RH
523 #:configure-flags
524 (list "--enable-win64"
c41fb54f
RH
525 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
526 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
527 #:system)
6cd46747 528 (package-arguments wine-staging))))
1adc6013 529 (synopsis "Implementation of the Windows API (staging branch, WoW64
6cd46747
RH
530version)")
531 (supported-systems '("x86_64-linux" "aarch64-linux"))))