Commit | Line | Data |
---|---|---|
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> |
4b506a3f | 6 | ;;; Copyright © 2017, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
7b23a69d | 7 | ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
76dbadac | 8 | ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> |
8f9580ca SB |
9 | ;;; |
10 | ;;; This file is part of GNU Guix. | |
11 | ;;; | |
12 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
13 | ;;; under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
15 | ;;; your option) any later version. | |
16 | ;;; | |
17 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
18 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
24 | ||
25 | (define-module (gnu packages wine) | |
26 | #:use-module ((guix licenses) #:prefix license:) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix download) | |
f868276b | 29 | #:use-module (guix git-download) |
eeabe5a1 | 30 | #:use-module (guix utils) |
8f9580ca | 31 | #:use-module (guix build-system gnu) |
76dbadac | 32 | #:use-module (guix build-system meson) |
f6246195 | 33 | #:use-module (guix build-system trivial) |
8f9580ca | 34 | #:use-module (gnu packages) |
1aa6582e | 35 | #:use-module (gnu packages admin) |
025cc9a1 | 36 | #:use-module (gnu packages audio) |
b53b9c8d | 37 | #:use-module (gnu packages autotools) |
f6246195 RH |
38 | #:use-module (gnu packages base) |
39 | #:use-module (gnu packages bash) | |
8f9580ca SB |
40 | #:use-module (gnu packages bison) |
41 | #:use-module (gnu packages compression) | |
025cc9a1 | 42 | #:use-module (gnu packages cups) |
8f9580ca SB |
43 | #:use-module (gnu packages databases) |
44 | #:use-module (gnu packages fontutils) | |
45 | #:use-module (gnu packages flex) | |
46 | #:use-module (gnu packages image) | |
f2c71f62 | 47 | #:use-module (gnu packages gcc) |
8f9580ca SB |
48 | #:use-module (gnu packages gettext) |
49 | #:use-module (gnu packages ghostscript) | |
50 | #:use-module (gnu packages gl) | |
51 | #:use-module (gnu packages glib) | |
1aa6582e | 52 | #:use-module (gnu packages gstreamer) |
141708ed | 53 | #:use-module (gnu packages gtk) |
d95e4864 | 54 | #:use-module (gnu packages kerberos) |
8f9580ca | 55 | #:use-module (gnu packages linux) |
76dbadac | 56 | #:use-module (gnu packages mingw) |
8f9580ca SB |
57 | #:use-module (gnu packages openldap) |
58 | #:use-module (gnu packages perl) | |
05740895 | 59 | #:use-module (gnu packages pulseaudio) |
8f9580ca | 60 | #:use-module (gnu packages pkg-config) |
b53b9c8d | 61 | #:use-module (gnu packages python) |
8f9580ca SB |
62 | #:use-module (gnu packages mp3) |
63 | #:use-module (gnu packages ncurses) | |
64 | #:use-module (gnu packages photo) | |
65 | #:use-module (gnu packages samba) | |
66 | #:use-module (gnu packages scanner) | |
51158d83 | 67 | #:use-module (gnu packages sdl) |
a7fd7b68 | 68 | #:use-module (gnu packages tls) |
1aa6582e | 69 | #:use-module (gnu packages video) |
39b4744a | 70 | #:use-module (gnu packages vulkan) |
8f9580ca | 71 | #:use-module (gnu packages xml) |
b4a330ac | 72 | #:use-module (gnu packages xorg) |
a5466f38 RH |
73 | #:use-module (ice-9 match) |
74 | #:use-module (srfi srfi-1)) | |
8f9580ca SB |
75 | |
76 | (define-public wine | |
77 | (package | |
78 | (name "wine") | |
fa61610f | 79 | (version "5.21") |
4b506a3f NG |
80 | (source |
81 | (origin | |
82 | (method url-fetch) | |
d8104034 NG |
83 | (uri (let ((dir (string-append |
84 | (version-major version) | |
85 | (if (string-suffix? ".0" (version-major+minor version)) | |
86 | ".0/" | |
53b48447 NG |
87 | ".x/")))) |
88 | (string-append "https://dl.winehq.org/wine/source/" dir | |
89 | "wine-" version ".tar.xz"))) | |
4b506a3f | 90 | (sha256 |
fa61610f | 91 | (base32 "0h185lfpid6cw1sz8rmkpky2l11izpb0w8j0cq6ww6yi94jmq6js")))) |
8f9580ca | 92 | (build-system gnu-build-system) |
d8104034 NG |
93 | (native-inputs |
94 | `(("bison" ,bison) | |
95 | ("flex" ,flex) | |
96 | ("gettext" ,gettext-minimal) | |
97 | ("perl" ,perl) | |
98 | ("pkg-config" ,pkg-config))) | |
8f9580ca SB |
99 | (inputs |
100 | `(("alsa-lib" ,alsa-lib) | |
101 | ("dbus" ,dbus) | |
025cc9a1 | 102 | ("cups" ,cups) |
1aa6582e | 103 | ("eudev" ,eudev) |
ffa37422 | 104 | ("faudio" ,faudio) |
8f9580ca SB |
105 | ("fontconfig" ,fontconfig) |
106 | ("freetype" ,freetype) | |
025cc9a1 | 107 | ("glu" ,glu) |
8f9580ca | 108 | ("gnutls" ,gnutls) |
1aa6582e | 109 | ("gst-plugins-base" ,gst-plugins-base) |
8f9580ca SB |
110 | ("lcms" ,lcms) |
111 | ("libxml2" ,libxml2) | |
112 | ("libxslt" ,libxslt) | |
113 | ("libgphoto2" ,libgphoto2) | |
114 | ("libmpg123" ,mpg123) | |
115 | ("libldap" ,openldap) | |
116 | ("libnetapi" ,samba) | |
4c928743 | 117 | ("libsane" ,sane-backends) |
1aa6582e | 118 | ("libpcap" ,libpcap) |
8f9580ca | 119 | ("libpng" ,libpng) |
4bd428a7 | 120 | ("libjpeg" ,libjpeg-turbo) |
8f9580ca SB |
121 | ("libtiff" ,libtiff) |
122 | ("libICE" ,libice) | |
123 | ("libX11" ,libx11) | |
124 | ("libXi" ,libxi) | |
125 | ("libXext" ,libxext) | |
126 | ("libXcursor" ,libxcursor) | |
127 | ("libXrender" ,libxrender) | |
128 | ("libXrandr" ,libxrandr) | |
129 | ("libXinerama" ,libxinerama) | |
130 | ("libXxf86vm" ,libxxf86vm) | |
131 | ("libXcomposite" ,libxcomposite) | |
d95e4864 | 132 | ("mit-krb5" ,mit-krb5) |
8f9580ca | 133 | ("ncurses" ,ncurses) |
025cc9a1 | 134 | ("openal" ,openal) |
05740895 | 135 | ("pulseaudio" ,pulseaudio) |
0e41f95e | 136 | ("sdl2" ,sdl2) |
8f9580ca | 137 | ("unixodbc" ,unixodbc) |
1aa6582e | 138 | ("v4l-utils" ,v4l-utils) |
e3b1d4ea | 139 | ("vkd3d" ,vkd3d) |
0e41f95e | 140 | ("vulkan-loader" ,vulkan-loader) |
8f9580ca SB |
141 | ("zlib" ,zlib))) |
142 | (arguments | |
b4a330ac EF |
143 | `(;; Force a 32-bit build targeting a similar architecture, i.e.: |
144 | ;; armhf for armhf/aarch64, i686 for i686/x86_64. | |
145 | #:system ,@(match (%current-system) | |
146 | ((or "armhf-linux" "aarch64-linux") | |
147 | `("armhf-linux")) | |
148 | (_ | |
149 | `("i686-linux"))) | |
8f9580ca SB |
150 | |
151 | ;; XXX: There's a test suite, but it's unclear whether it's supposed to | |
152 | ;; pass. | |
153 | #:tests? #f | |
154 | ||
6c0dfb19 | 155 | #:configure-flags |
5cead945 | 156 | (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32")) |
6c0dfb19 | 157 | |
eeabe5a1 | 158 | #:make-flags |
5cead945 RH |
159 | (list "SHELL=bash" |
160 | (string-append "libdir=" %output "/lib/wine32")) | |
eeabe5a1 | 161 | |
8f9580ca | 162 | #:phases |
07cda02c | 163 | (modify-phases %standard-phases |
2f7bdf53 | 164 | ;; Explicitly set the 32-bit version of vulkan-loader when installing |
d39a54ff RH |
165 | ;; to i686-linux or x86_64-linux. |
166 | ;; TODO: Add more JSON files as they become available in Mesa. | |
167 | ,@(match (%current-system) | |
168 | ((or "i686-linux" "x86_64-linux") | |
169 | `((add-after 'install 'wrap-executable | |
170 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
171 | (let* ((out (assoc-ref outputs "out")) | |
172 | (icd (string-append out "/share/vulkan/icd.d"))) | |
173 | (mkdir-p icd) | |
e2b4450d CB |
174 | (copy-file (string-append |
175 | (assoc-ref inputs "mesa") | |
176 | "/share/vulkan/icd.d/radeon_icd.i686.json") | |
d39a54ff | 177 | (string-append icd "/radeon_icd.i686.json")) |
e2b4450d CB |
178 | (copy-file (string-append |
179 | (assoc-ref inputs "mesa") | |
180 | "/share/vulkan/icd.d/intel_icd.i686.json") | |
c94884bc | 181 | (string-append icd "/intel_icd.i686.json")) |
d39a54ff | 182 | (wrap-program (string-append out "/bin/wine-preloader") |
e2b4450d CB |
183 | `("VK_ICD_FILENAMES" ":" = |
184 | (,(string-append icd | |
185 | "/radeon_icd.i686.json" ":" | |
186 | icd "/intel_icd.i686.json")))) | |
d39a54ff RH |
187 | #t))))) |
188 | (_ | |
e2b4450d | 189 | `())) |
07cda02c EF |
190 | (add-after 'configure 'patch-dlopen-paths |
191 | ;; Hardcode dlopened sonames to absolute paths. | |
192 | (lambda _ | |
193 | (let* ((library-path (search-path-as-string->list | |
194 | (getenv "LIBRARY_PATH"))) | |
195 | (find-so (lambda (soname) | |
196 | (search-path library-path soname)))) | |
197 | (substitute* "include/config.h" | |
198 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
199 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
200 | #t)))))) | |
658c987f | 201 | (home-page "https://www.winehq.org/") |
06e57331 | 202 | (synopsis "Implementation of the Windows API (32-bit only)") |
8f9580ca SB |
203 | (description |
204 | "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a | |
205 | compatibility layer capable of running Windows applications. Instead of | |
206 | simulating internal Windows logic like a virtual machine or emulator, Wine | |
207 | translates Windows API calls into POSIX calls on-the-fly, eliminating the | |
208 | performance and memory penalties of other methods and allowing you to cleanly | |
209 | integrate Windows applications into your desktop.") | |
7ba2a1af EF |
210 | ;; Any platform should be able to build wine, but based on '#:system' these |
211 | ;; are thr ones we currently support. | |
212 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux")) | |
cac274aa | 213 | (license license:lgpl2.1+))) |
b3ebd241 RH |
214 | |
215 | (define-public wine64 | |
216 | (package | |
217 | (inherit wine) | |
218 | (name "wine64") | |
58cbcb02 RH |
219 | (inputs `(("wine" ,wine) |
220 | ,@(package-inputs wine))) | |
b3ebd241 | 221 | (arguments |
e02693a3 RH |
222 | `(#:make-flags |
223 | (list "SHELL=bash" | |
58cbcb02 RH |
224 | (string-append "libdir=" %output "/lib/wine64")) |
225 | #:phases | |
226 | (modify-phases %standard-phases | |
2f7bdf53 | 227 | ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader |
d39a54ff RH |
228 | ;; when installing to x86_64-linux so both are available. |
229 | ;; TODO: Add more JSON files as they become available in Mesa. | |
230 | ,@(match (%current-system) | |
e2b4450d CB |
231 | ((or "x86_64-linux") |
232 | `((add-after 'copy-wine32-binaries 'wrap-executable | |
233 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
234 | (let* ((out (assoc-ref outputs "out"))) | |
235 | (wrap-program (string-append out "/bin/wine-preloader") | |
236 | `("VK_ICD_FILENAMES" ":" = | |
237 | (,(string-append | |
238 | (assoc-ref inputs "mesa") | |
239 | "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":" | |
240 | (assoc-ref inputs "mesa") | |
241 | "/share/vulkan/icd.d/intel_icd.x86_64.json" ":" | |
242 | (assoc-ref inputs "wine") | |
243 | "/share/vulkan/icd.d/radeon_icd.i686.json" ":" | |
244 | (assoc-ref inputs "wine") | |
245 | "/share/vulkan/icd.d/intel_icd.i686.json")))) | |
246 | (wrap-program (string-append out "/bin/wine64-preloader") | |
247 | `("VK_ICD_FILENAMES" ":" = | |
248 | (,(string-append | |
249 | (assoc-ref inputs "mesa") | |
250 | "/share/vulkan/icd.d/radeon_icd.x86_64.json" | |
251 | ":" (assoc-ref inputs "mesa") | |
252 | "/share/vulkan/icd.d/intel_icd.x86_64.json" | |
253 | ":" (assoc-ref inputs "wine") | |
254 | "/share/vulkan/icd.d/radeon_icd.i686.json" | |
255 | ":" (assoc-ref inputs "wine") | |
256 | "/share/vulkan/icd.d/intel_icd.i686.json")))) | |
257 | #t))))) | |
258 | (_ | |
259 | `())) | |
036f3577 | 260 | (add-after 'install 'copy-wine32-binaries |
58cbcb02 | 261 | (lambda* (#:key outputs #:allow-other-keys) |
036f3577 RH |
262 | (let* ((wine32 (assoc-ref %build-inputs "wine")) |
263 | (out (assoc-ref %outputs "out"))) | |
264 | ;; Copy the 32-bit binaries needed for WoW64. | |
265 | (copy-file (string-append wine32 "/bin/wine") | |
266 | (string-append out "/bin/wine")) | |
d39a54ff RH |
267 | ;; Copy the real 32-bit wine-preloader instead of the wrapped |
268 | ;; version. | |
269 | (copy-file (string-append wine32 "/bin/.wine-preloader-real") | |
036f3577 RH |
270 | (string-append out "/bin/wine-preloader")) |
271 | #t))) | |
80c65f30 LP |
272 | (add-after 'install 'copy-wine32-libraries |
273 | (lambda* (#:key outputs #:allow-other-keys) | |
274 | (let* ((wine32 (assoc-ref %build-inputs "wine")) | |
275 | (out (assoc-ref %outputs "out"))) | |
276 | (copy-recursively (string-append wine32 "/lib/wine32") | |
277 | (string-append out "/lib/wine32")) | |
278 | #t))) | |
036f3577 RH |
279 | (add-after 'compress-documentation 'copy-wine32-manpage |
280 | (lambda* (#:key outputs #:allow-other-keys) | |
281 | (let* ((wine32 (assoc-ref %build-inputs "wine")) | |
282 | (out (assoc-ref %outputs "out"))) | |
283 | ;; Copy the missing man file for the wine binary from wine. | |
284 | (copy-file (string-append wine32 "/share/man/man1/wine.1.gz") | |
285 | (string-append out "/share/man/man1/wine.1.gz")) | |
286 | #t))) | |
58cbcb02 RH |
287 | (add-after 'configure 'patch-dlopen-paths |
288 | ;; Hardcode dlopened sonames to absolute paths. | |
289 | (lambda _ | |
290 | (let* ((library-path (search-path-as-string->list | |
291 | (getenv "LIBRARY_PATH"))) | |
292 | (find-so (lambda (soname) | |
293 | (search-path library-path soname)))) | |
294 | (substitute* "include/config.h" | |
295 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
296 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
297 | #t)))) | |
e02693a3 | 298 | #:configure-flags |
b3ebd241 | 299 | (list "--enable-win64" |
58cbcb02 RH |
300 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64")) |
301 | ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases | |
302 | #:system) | |
b3ebd241 | 303 | (package-arguments wine)))) |
68e49211 | 304 | (synopsis "Implementation of the Windows API (WoW64 version)") |
5010d0e3 | 305 | (supported-systems '("x86_64-linux" "aarch64-linux")))) |
f6444059 | 306 | |
a5466f38 RH |
307 | ;; This minimal build of Wine is needed to prevent a circular dependency with |
308 | ;; vkd3d. | |
309 | (define-public wine-minimal | |
310 | (package | |
311 | (inherit wine) | |
312 | (name "wine-minimal") | |
313 | (native-inputs (fold alist-delete (package-native-inputs wine) | |
314 | '("gettext" "perl" "pkg-config"))) | |
315 | (inputs `()) | |
316 | (arguments | |
317 | `(#:validate-runpath? #f | |
d39a54ff RH |
318 | #:phases |
319 | (modify-phases %standard-phases | |
320 | (add-after 'configure 'patch-dlopen-paths | |
321 | ;; Hardcode dlopened sonames to absolute paths. | |
322 | (lambda _ | |
323 | (let* ((library-path (search-path-as-string->list | |
324 | (getenv "LIBRARY_PATH"))) | |
325 | (find-so (lambda (soname) | |
326 | (search-path library-path soname)))) | |
327 | (substitute* "include/config.h" | |
328 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
329 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
330 | #t)))) | |
a5466f38 RH |
331 | #:configure-flags |
332 | (list "--without-freetype" | |
333 | "--without-x") | |
d39a54ff | 334 | ,@(strip-keyword-arguments '(#:configure-flags #:phases) |
a5466f38 RH |
335 | (package-arguments wine)))))) |
336 | ||
f6246195 RH |
337 | (define-public wine-staging-patchset-data |
338 | (package | |
cb2ad4f5 | 339 | (name "wine-staging-patchset-data") |
db80caa8 | 340 | (version "5.13") |
cb2ad4f5 RH |
341 | (source |
342 | (origin | |
343 | (method git-fetch) | |
344 | (uri (git-reference | |
345 | (url "https://github.com/wine-staging/wine-staging") | |
346 | (commit (string-append "v" version)))) | |
347 | (file-name (git-file-name name version)) | |
348 | (sha256 | |
db80caa8 | 349 | (base32 "0sw7790gsi3h08xgc8i1y282rk8xrdhqjlwpvbpvyw5zi0i95cvq")))) |
cb2ad4f5 RH |
350 | (build-system trivial-build-system) |
351 | (native-inputs | |
352 | `(("bash" ,bash) | |
353 | ("coreutils" ,coreutils))) | |
354 | (arguments | |
355 | `(#:modules ((guix build utils)) | |
356 | #:builder | |
357 | (begin | |
358 | (use-modules (guix build utils)) | |
359 | (let* ((build-directory ,(string-append name "-" version)) | |
360 | (source (assoc-ref %build-inputs "source")) | |
361 | (bash (assoc-ref %build-inputs "bash")) | |
362 | (coreutils (assoc-ref %build-inputs "coreutils")) | |
363 | (out (assoc-ref %outputs "out")) | |
364 | (wine-staging (string-append out "/share/wine-staging"))) | |
365 | (copy-recursively source build-directory) | |
366 | (with-directory-excursion build-directory | |
367 | (substitute* "patches/patchinstall.sh" | |
368 | (("/bin/sh") | |
369 | (string-append bash "/bin/sh"))) | |
370 | (substitute* "patches/gitapply.sh" | |
371 | (("/usr/bin/env") | |
372 | (string-append coreutils "/bin/env")))) | |
373 | (copy-recursively build-directory wine-staging) | |
374 | #t)))) | |
375 | (home-page "https://github.com/wine-staging") | |
376 | (synopsis "Patchset for Wine") | |
377 | (description | |
378 | "wine-staging-patchset-data contains the patchset to build Wine-Staging.") | |
379 | (license license:lgpl2.1+))) | |
f6246195 | 380 | |
7866d8c8 NG |
381 | (define-public wine-staging |
382 | (package | |
383 | (inherit wine) | |
384 | (name "wine-staging") | |
b53b9c8d | 385 | (version (package-version wine-staging-patchset-data)) |
b8088be0 | 386 | (source |
8252d77f TGR |
387 | (let* ((wine-version (version-major+minor version)) |
388 | (subdirectory (string-append | |
389 | (version-major version) | |
390 | (if (string-suffix? ".0" wine-version) | |
391 | ".0" | |
392 | ".x")))) | |
393 | (origin | |
394 | (method url-fetch) | |
395 | (uri (string-append "https://dl.winehq.org/wine/source/" | |
396 | subdirectory "/" | |
397 | "wine-" wine-version ".tar.xz")) | |
398 | (file-name (string-append name "-" wine-version ".tar.xz")) | |
399 | (sha256 | |
db80caa8 | 400 | (base32 "0lh1bqr8xq1acz5d0cb50rvhw3h6h1vqprx5wlyrjhdg58f5qsn4"))))) |
b8088be0 | 401 | (inputs `(("autoconf" ,autoconf) ; for autoreconf |
a51ac7af | 402 | ("ffmpeg" ,ffmpeg) |
c695fb76 TGR |
403 | ("gtk+" ,gtk+) |
404 | ("libva" ,libva) | |
cb2ad4f5 | 405 | ("mesa" ,mesa) |
b53b9c8d RH |
406 | ("python" ,python) |
407 | ("util-linux" ,util-linux) ; for hexdump | |
b53b9c8d | 408 | ("wine-staging-patchset-data" ,wine-staging-patchset-data) |
141708ed | 409 | ,@(package-inputs wine))) |
39b4744a RH |
410 | (arguments |
411 | `(#:phases | |
412 | (modify-phases %standard-phases | |
2f7bdf53 | 413 | ;; Explicitly set the 32-bit version of vulkan-loader when installing |
cb2ad4f5 RH |
414 | ;; to i686-linux or x86_64-linux. |
415 | ;; TODO: Add more JSON files as they become available in Mesa. | |
416 | ,@(match (%current-system) | |
417 | ((or "i686-linux" "x86_64-linux") | |
418 | `((add-after 'install 'wrap-executable | |
419 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
420 | (let* ((out (assoc-ref outputs "out")) | |
421 | (icd (string-append out "/share/vulkan/icd.d"))) | |
422 | (mkdir-p icd) | |
423 | (copy-file (string-append (assoc-ref inputs "mesa") | |
424 | "/share/vulkan/icd.d/radeon_icd.i686.json") | |
425 | (string-append icd "/radeon_icd.i686.json")) | |
c94884bc RH |
426 | (copy-file (string-append (assoc-ref inputs "mesa") |
427 | "/share/vulkan/icd.d/intel_icd.i686.json") | |
428 | (string-append icd "/intel_icd.i686.json")) | |
cb2ad4f5 RH |
429 | (wrap-program (string-append out "/bin/wine-preloader") |
430 | `("VK_ICD_FILENAMES" ":" = | |
431 | (,(string-append icd | |
c94884bc RH |
432 | "/radeon_icd.i686.json" ":" |
433 | icd "/intel_icd.i686.json")))) | |
cb2ad4f5 RH |
434 | #t))))) |
435 | (_ | |
436 | `()) | |
437 | ) | |
b53b9c8d | 438 | (add-before 'configure 'patch-source-wine-staging |
39b4744a | 439 | (lambda* (#:key outputs #:allow-other-keys) |
b53b9c8d RH |
440 | (let* ((source (assoc-ref %build-inputs "source")) |
441 | (script (string-append (assoc-ref %build-inputs | |
442 | "wine-staging-patchset-data") | |
443 | "/share/wine-staging/patches/patchinstall.sh"))) | |
09fd82ce | 444 | (invoke script (string-append "DESTDIR=" ".") "--all") |
39b4744a RH |
445 | #t))) |
446 | (add-after 'configure 'patch-dlopen-paths | |
447 | ;; Hardcode dlopened sonames to absolute paths. | |
448 | (lambda _ | |
449 | (let* ((library-path (search-path-as-string->list | |
450 | (getenv "LIBRARY_PATH"))) | |
451 | (find-so (lambda (soname) | |
452 | (search-path library-path soname)))) | |
453 | (substitute* "include/config.h" | |
454 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
455 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
456 | #t)))) | |
457 | ,@(strip-keyword-arguments '(#:phases) | |
458 | (package-arguments wine)))) | |
95c45e53 | 459 | (synopsis "Implementation of the Windows API (staging branch, 32-bit only)") |
7866d8c8 NG |
460 | (description "Wine-Staging is the testing area of Wine. It |
461 | contains bug fixes and features, which have not been integrated into | |
462 | the development branch yet. The idea of Wine-Staging is to provide | |
463 | experimental features faster to end users and to give developers the | |
464 | possibility to discuss and improve their patches before they are | |
465 | integrated into the main branch.") | |
b53b9c8d | 466 | (home-page "https://github.com/wine-staging") |
7866d8c8 NG |
467 | ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging |
468 | ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use | |
469 | ;; different licenses. In particular, the latter is licensed under | |
470 | ;; both GPL3+ and Apache 2 License. | |
471 | (license | |
472 | (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0)))) | |
6cd46747 RH |
473 | |
474 | (define-public wine64-staging | |
475 | (package | |
476 | (inherit wine-staging) | |
477 | (name "wine64-staging") | |
c41fb54f RH |
478 | (inputs `(("wine-staging" ,wine-staging) |
479 | ,@(package-inputs wine-staging))) | |
6cd46747 RH |
480 | (arguments |
481 | `(#:make-flags | |
482 | (list "SHELL=bash" | |
c41fb54f RH |
483 | (string-append "libdir=" %output "/lib/wine64")) |
484 | #:phases | |
485 | (modify-phases %standard-phases | |
2f7bdf53 | 486 | ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader |
cb2ad4f5 RH |
487 | ;; when installing to x86_64-linux so both are available. |
488 | ;; TODO: Add more JSON files as they become available in Mesa. | |
489 | ,@(match (%current-system) | |
490 | ((or "x86_64-linux") | |
491 | `((add-after 'copy-wine32-binaries 'wrap-executable | |
492 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
493 | (let* ((out (assoc-ref outputs "out"))) | |
494 | (wrap-program (string-append out "/bin/wine-preloader") | |
495 | `("VK_ICD_FILENAMES" ":" = | |
496 | (,(string-append (assoc-ref inputs "mesa") | |
497 | "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":" | |
498 | (assoc-ref inputs "mesa") | |
499 | "/share/vulkan/icd.d/intel_icd.x86_64.json" ":" | |
500 | (assoc-ref inputs "wine-staging") | |
c94884bc RH |
501 | "/share/vulkan/icd.d/radeon_icd.i686.json" ":" |
502 | (assoc-ref inputs "wine-staging") | |
503 | "/share/vulkan/icd.d/intel_icd.i686.json")))) | |
cb2ad4f5 RH |
504 | (wrap-program (string-append out "/bin/wine64-preloader") |
505 | `("VK_ICD_FILENAMES" ":" = | |
506 | (,(string-append (assoc-ref inputs "mesa") | |
507 | "/share/vulkan/icd.d/radeon_icd.x86_64.json" | |
508 | ":" (assoc-ref inputs "mesa") | |
509 | "/share/vulkan/icd.d/intel_icd.x86_64.json" | |
510 | ":" (assoc-ref inputs "wine-staging") | |
c94884bc RH |
511 | "/share/vulkan/icd.d/radeon_icd.i686.json" |
512 | ":" (assoc-ref inputs "wine-staging") | |
513 | "/share/vulkan/icd.d/intel_icd.i686.json")))) | |
cb2ad4f5 RH |
514 | #t))))) |
515 | (_ | |
516 | `()) | |
517 | ) | |
3139f185 | 518 | (add-before 'configure 'patch-source-wine-staging |
ee5402bf | 519 | (lambda* (#:key outputs #:allow-other-keys) |
3139f185 RH |
520 | (let* ((source (assoc-ref %build-inputs "source")) |
521 | (script (string-append (assoc-ref %build-inputs | |
522 | "wine-staging-patchset-data") | |
523 | "/share/wine-staging/patches/patchinstall.sh"))) | |
036feaf9 | 524 | (invoke script (string-append "DESTDIR=" ".") "--all") |
ee5402bf | 525 | #t))) |
e6b94a02 RH |
526 | (add-after 'install 'copy-wine32-binaries |
527 | (lambda* (#:key outputs #:allow-other-keys) | |
417903c6 | 528 | (let* ((wine32 (assoc-ref %build-inputs "wine-staging")) |
e6b94a02 RH |
529 | (out (assoc-ref %outputs "out"))) |
530 | ;; Copy the 32-bit binaries needed for WoW64. | |
531 | (copy-file (string-append wine32 "/bin/wine") | |
532 | (string-append out "/bin/wine")) | |
cb2ad4f5 RH |
533 | ;; Copy the real 32-bit wine-preloader instead of the wrapped |
534 | ;; version. | |
535 | (copy-file (string-append wine32 "/bin/.wine-preloader-real") | |
e6b94a02 RH |
536 | (string-append out "/bin/wine-preloader")) |
537 | #t))) | |
538 | (add-after 'compress-documentation 'copy-wine32-manpage | |
c41fb54f | 539 | (lambda* (#:key outputs #:allow-other-keys) |
417903c6 | 540 | (let* ((wine32 (assoc-ref %build-inputs "wine-staging")) |
e6b94a02 RH |
541 | (out (assoc-ref %outputs "out"))) |
542 | ;; Copy the missing man file for the wine binary from | |
543 | ;; wine-staging. | |
544 | (copy-file (string-append wine32 "/share/man/man1/wine.1.gz") | |
545 | (string-append out "/share/man/man1/wine.1.gz")) | |
546 | #t))) | |
c41fb54f RH |
547 | (add-after 'configure 'patch-dlopen-paths |
548 | ;; Hardcode dlopened sonames to absolute paths. | |
549 | (lambda _ | |
550 | (let* ((library-path (search-path-as-string->list | |
551 | (getenv "LIBRARY_PATH"))) | |
552 | (find-so (lambda (soname) | |
553 | (search-path library-path soname)))) | |
554 | (substitute* "include/config.h" | |
555 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
556 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
557 | #t)))) | |
6cd46747 RH |
558 | #:configure-flags |
559 | (list "--enable-win64" | |
c41fb54f RH |
560 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64")) |
561 | ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases | |
562 | #:system) | |
6cd46747 | 563 | (package-arguments wine-staging)))) |
1adc6013 | 564 | (synopsis "Implementation of the Windows API (staging branch, WoW64 |
6cd46747 RH |
565 | version)") |
566 | (supported-systems '("x86_64-linux" "aarch64-linux")))) | |
76dbadac PN |
567 | |
568 | (define dxvk32 | |
569 | ;; This package provides 32-bit dxvk libraries on 64-bit systems. | |
570 | (package | |
571 | (name "dxvk32") | |
adb1e3b6 | 572 | (version "1.5.5") |
76dbadac PN |
573 | (home-page "https://github.com/doitsujin/dxvk/") |
574 | (source (origin | |
575 | (method git-fetch) | |
576 | (uri (git-reference | |
577 | (url home-page) | |
578 | (commit (string-append "v" version)))) | |
579 | (file-name (git-file-name name version)) | |
580 | (sha256 | |
581 | (base32 | |
adb1e3b6 | 582 | "1inl0qswgvbp0fs76md86ilqf9mbshkpjm8ga81khn9zd6v3fvan")))) |
76dbadac PN |
583 | (build-system meson-build-system) |
584 | (arguments | |
585 | `(#:system "i686-linux" | |
586 | #:configure-flags (list "--cross-file" | |
587 | (string-append (assoc-ref %build-inputs "source") | |
588 | "/build-wine32.txt")))) | |
589 | (native-inputs | |
f2c71f62 PN |
590 | ;; Since 1.5 dxvk needs gcc-8.1. See |
591 | ;; https://github.com/doitsujin/dxvk/issues/1292#issuecomment-567067373. | |
592 | `(("gcc" ,gcc-9) | |
593 | ("glslang" ,glslang))) | |
594 | (inputs | |
595 | `(("wine" ,wine-staging))) | |
596 | (synopsis "Vulkan-based D3D9, D3D10 and D3D11 implementation for Wine") | |
597 | (description "A Vulkan-based translation layer for Direct3D 9/10/11 which | |
76dbadac PN |
598 | allows running complex 3D applications with high performance using Wine. |
599 | ||
600 | Use @command{setup_dxvk} to install the required libraries to a Wine prefix.") | |
601 | (supported-systems '("x86_64-linux")) | |
602 | (license license:zlib))) | |
603 | ||
604 | (define-public dxvk | |
605 | (package | |
606 | (inherit dxvk32) | |
607 | (name "dxvk") | |
608 | (arguments | |
609 | `(#:configure-flags (list "--cross-file" | |
610 | (string-append (assoc-ref %build-inputs "source") | |
611 | "/build-wine" | |
223492f3 PN |
612 | ,(match (%current-system) |
613 | ("x86_64-linux" "64") | |
614 | (_ "32")) | |
76dbadac PN |
615 | ".txt")) |
616 | #:phases | |
617 | (modify-phases %standard-phases | |
618 | ,@(if (string=? (%current-system) "x86_64-linux") | |
619 | `((add-after 'unpack 'install-32 | |
620 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
621 | (let* ((out (assoc-ref outputs "out")) | |
622 | (dxvk32 (assoc-ref inputs "dxvk32"))) | |
623 | (mkdir-p (string-append out "/lib32")) | |
624 | (copy-recursively (string-append dxvk32 "/lib") | |
3842baa0 PN |
625 | (string-append out "/lib32")) |
626 | #t)))) | |
76dbadac PN |
627 | '()) |
628 | (add-after 'install 'install-setup | |
629 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
630 | (let* ((out (assoc-ref outputs "out")) | |
631 | (bin (string-append out "/bin/setup_dxvk"))) | |
632 | (mkdir-p (string-append out "/bin")) | |
633 | (copy-file "../source/setup_dxvk.sh" | |
634 | bin) | |
635 | (chmod bin #o755) | |
636 | (substitute* bin | |
637 | (("wine=\"wine\"") | |
638 | (string-append "wine=" (assoc-ref inputs "wine") "/bin/wine")) | |
639 | (("x32") ,(match (%current-system) | |
640 | ("x86_64-linux" "../lib32") | |
641 | (_ "../lib"))) | |
642 | (("x64") "../lib")))))))) | |
223492f3 PN |
643 | (inputs |
644 | `(("wine" ,(match (%current-system) | |
f2c71f62 PN |
645 | ;; ("x86_64-linux" wine64) |
646 | ("x86_64-linux" wine64-staging) | |
647 | ;; ("x86_64-linux" mingw-w64-x86_64) | |
76dbadac PN |
648 | (_ wine))) |
649 | ,@(match (%current-system) | |
650 | ("x86_64-linux" | |
651 | `(("dxvk32" ,dxvk32))) | |
98e3953e | 652 | (_ '())))) |
76dbadac | 653 | (supported-systems '("i686-linux" "x86_64-linux")))) |