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> |
06e57331 | 5 | ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com> |
51f01907 | 6 | ;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
8f9580ca SB |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages wine) | |
24 | #:use-module ((guix licenses) #:prefix license:) | |
25 | #:use-module (guix packages) | |
26 | #:use-module (guix download) | |
eeabe5a1 | 27 | #:use-module (guix utils) |
8f9580ca | 28 | #:use-module (guix build-system gnu) |
f6246195 | 29 | #:use-module (guix build-system trivial) |
8f9580ca | 30 | #:use-module (gnu packages) |
1aa6582e | 31 | #:use-module (gnu packages admin) |
025cc9a1 | 32 | #:use-module (gnu packages audio) |
b53b9c8d | 33 | #:use-module (gnu packages autotools) |
f6246195 RH |
34 | #:use-module (gnu packages base) |
35 | #:use-module (gnu packages bash) | |
8f9580ca SB |
36 | #:use-module (gnu packages bison) |
37 | #:use-module (gnu packages compression) | |
025cc9a1 | 38 | #:use-module (gnu packages cups) |
8f9580ca SB |
39 | #:use-module (gnu packages databases) |
40 | #:use-module (gnu packages fontutils) | |
41 | #:use-module (gnu packages flex) | |
42 | #:use-module (gnu packages image) | |
43 | #:use-module (gnu packages gettext) | |
44 | #:use-module (gnu packages ghostscript) | |
45 | #:use-module (gnu packages gl) | |
46 | #:use-module (gnu packages glib) | |
1aa6582e | 47 | #:use-module (gnu packages gstreamer) |
141708ed | 48 | #:use-module (gnu packages gtk) |
8f9580ca SB |
49 | #:use-module (gnu packages linux) |
50 | #:use-module (gnu packages openldap) | |
51 | #:use-module (gnu packages perl) | |
05740895 | 52 | #:use-module (gnu packages pulseaudio) |
8f9580ca | 53 | #:use-module (gnu packages pkg-config) |
b53b9c8d | 54 | #:use-module (gnu packages python) |
8f9580ca SB |
55 | #:use-module (gnu packages mp3) |
56 | #:use-module (gnu packages ncurses) | |
57 | #:use-module (gnu packages photo) | |
58 | #:use-module (gnu packages samba) | |
59 | #:use-module (gnu packages scanner) | |
a7fd7b68 | 60 | #:use-module (gnu packages tls) |
1aa6582e | 61 | #:use-module (gnu packages video) |
39b4744a | 62 | #:use-module (gnu packages vulkan) |
8f9580ca | 63 | #:use-module (gnu packages xml) |
b4a330ac EF |
64 | #:use-module (gnu packages xorg) |
65 | #:use-module (ice-9 match)) | |
8f9580ca SB |
66 | |
67 | (define-public wine | |
68 | (package | |
69 | (name "wine") | |
048fca7b | 70 | (version "3.0") |
8f9580ca SB |
71 | (source (origin |
72 | (method url-fetch) | |
6f10e74f EF |
73 | (uri (string-append "https://dl.winehq.org/wine/source/" |
74 | (version-major+minor version) | |
5a717a95 | 75 | "/wine-" version ".tar.xz")) |
8f9580ca SB |
76 | (sha256 |
77 | (base32 | |
048fca7b | 78 | "1v7vq9iinkscbq6wg85fb0d2137660fg2nk5iabxkl2wr850asil")))) |
8f9580ca SB |
79 | (build-system gnu-build-system) |
80 | (native-inputs `(("pkg-config" ,pkg-config) | |
b94a6ca0 | 81 | ("gettext" ,gettext-minimal) |
5e54f4ad | 82 | ("flex" ,flex) |
8f9580ca SB |
83 | ("bison" ,bison) |
84 | ("perl" ,perl))) | |
85 | (inputs | |
86 | `(("alsa-lib" ,alsa-lib) | |
87 | ("dbus" ,dbus) | |
025cc9a1 | 88 | ("cups" ,cups) |
1aa6582e | 89 | ("eudev" ,eudev) |
8f9580ca SB |
90 | ("fontconfig" ,fontconfig) |
91 | ("freetype" ,freetype) | |
025cc9a1 | 92 | ("glu" ,glu) |
8f9580ca | 93 | ("gnutls" ,gnutls) |
1aa6582e | 94 | ("gst-plugins-base" ,gst-plugins-base) |
8f9580ca SB |
95 | ("lcms" ,lcms) |
96 | ("libxml2" ,libxml2) | |
97 | ("libxslt" ,libxslt) | |
98 | ("libgphoto2" ,libgphoto2) | |
99 | ("libmpg123" ,mpg123) | |
100 | ("libldap" ,openldap) | |
101 | ("libnetapi" ,samba) | |
4c928743 | 102 | ("libsane" ,sane-backends) |
1aa6582e | 103 | ("libpcap" ,libpcap) |
8f9580ca SB |
104 | ("libpng" ,libpng) |
105 | ("libjpeg" ,libjpeg) | |
106 | ("libtiff" ,libtiff) | |
107 | ("libICE" ,libice) | |
108 | ("libX11" ,libx11) | |
109 | ("libXi" ,libxi) | |
110 | ("libXext" ,libxext) | |
111 | ("libXcursor" ,libxcursor) | |
112 | ("libXrender" ,libxrender) | |
113 | ("libXrandr" ,libxrandr) | |
114 | ("libXinerama" ,libxinerama) | |
115 | ("libXxf86vm" ,libxxf86vm) | |
116 | ("libXcomposite" ,libxcomposite) | |
8f9580ca | 117 | ("ncurses" ,ncurses) |
025cc9a1 | 118 | ("openal" ,openal) |
05740895 | 119 | ("pulseaudio" ,pulseaudio) |
8f9580ca | 120 | ("unixodbc" ,unixodbc) |
1aa6582e | 121 | ("v4l-utils" ,v4l-utils) |
8f9580ca SB |
122 | ("zlib" ,zlib))) |
123 | (arguments | |
b4a330ac EF |
124 | `(;; Force a 32-bit build targeting a similar architecture, i.e.: |
125 | ;; armhf for armhf/aarch64, i686 for i686/x86_64. | |
126 | #:system ,@(match (%current-system) | |
127 | ((or "armhf-linux" "aarch64-linux") | |
128 | `("armhf-linux")) | |
129 | (_ | |
130 | `("i686-linux"))) | |
8f9580ca SB |
131 | |
132 | ;; XXX: There's a test suite, but it's unclear whether it's supposed to | |
133 | ;; pass. | |
134 | #:tests? #f | |
135 | ||
6c0dfb19 | 136 | #:configure-flags |
5cead945 | 137 | (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32")) |
6c0dfb19 | 138 | |
eeabe5a1 | 139 | #:make-flags |
5cead945 RH |
140 | (list "SHELL=bash" |
141 | (string-append "libdir=" %output "/lib/wine32")) | |
eeabe5a1 | 142 | |
8f9580ca | 143 | #:phases |
07cda02c EF |
144 | (modify-phases %standard-phases |
145 | (add-after 'configure 'patch-dlopen-paths | |
146 | ;; Hardcode dlopened sonames to absolute paths. | |
147 | (lambda _ | |
148 | (let* ((library-path (search-path-as-string->list | |
149 | (getenv "LIBRARY_PATH"))) | |
150 | (find-so (lambda (soname) | |
151 | (search-path library-path soname)))) | |
152 | (substitute* "include/config.h" | |
153 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
154 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
155 | #t)))))) | |
658c987f | 156 | (home-page "https://www.winehq.org/") |
06e57331 | 157 | (synopsis "Implementation of the Windows API (32-bit only)") |
8f9580ca SB |
158 | (description |
159 | "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a | |
160 | compatibility layer capable of running Windows applications. Instead of | |
161 | simulating internal Windows logic like a virtual machine or emulator, Wine | |
162 | translates Windows API calls into POSIX calls on-the-fly, eliminating the | |
163 | performance and memory penalties of other methods and allowing you to cleanly | |
164 | integrate Windows applications into your desktop.") | |
7ba2a1af EF |
165 | ;; Any platform should be able to build wine, but based on '#:system' these |
166 | ;; are thr ones we currently support. | |
167 | (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux")) | |
cac274aa | 168 | (license license:lgpl2.1+))) |
b3ebd241 RH |
169 | |
170 | (define-public wine64 | |
171 | (package | |
172 | (inherit wine) | |
173 | (name "wine64") | |
58cbcb02 RH |
174 | (inputs `(("wine" ,wine) |
175 | ,@(package-inputs wine))) | |
b3ebd241 | 176 | (arguments |
e02693a3 RH |
177 | `(#:make-flags |
178 | (list "SHELL=bash" | |
58cbcb02 RH |
179 | (string-append "libdir=" %output "/lib/wine64")) |
180 | #:phases | |
181 | (modify-phases %standard-phases | |
036f3577 | 182 | (add-after 'install 'copy-wine32-binaries |
58cbcb02 | 183 | (lambda* (#:key outputs #:allow-other-keys) |
036f3577 RH |
184 | (let* ((wine32 (assoc-ref %build-inputs "wine")) |
185 | (out (assoc-ref %outputs "out"))) | |
186 | ;; Copy the 32-bit binaries needed for WoW64. | |
187 | (copy-file (string-append wine32 "/bin/wine") | |
188 | (string-append out "/bin/wine")) | |
189 | (copy-file (string-append wine32 "/bin/wine-preloader") | |
190 | (string-append out "/bin/wine-preloader")) | |
191 | #t))) | |
192 | (add-after 'compress-documentation 'copy-wine32-manpage | |
193 | (lambda* (#:key outputs #:allow-other-keys) | |
194 | (let* ((wine32 (assoc-ref %build-inputs "wine")) | |
195 | (out (assoc-ref %outputs "out"))) | |
196 | ;; Copy the missing man file for the wine binary from wine. | |
197 | (copy-file (string-append wine32 "/share/man/man1/wine.1.gz") | |
198 | (string-append out "/share/man/man1/wine.1.gz")) | |
199 | #t))) | |
58cbcb02 RH |
200 | (add-after 'configure 'patch-dlopen-paths |
201 | ;; Hardcode dlopened sonames to absolute paths. | |
202 | (lambda _ | |
203 | (let* ((library-path (search-path-as-string->list | |
204 | (getenv "LIBRARY_PATH"))) | |
205 | (find-so (lambda (soname) | |
206 | (search-path library-path soname)))) | |
207 | (substitute* "include/config.h" | |
208 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
209 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
210 | #t)))) | |
e02693a3 | 211 | #:configure-flags |
b3ebd241 | 212 | (list "--enable-win64" |
58cbcb02 RH |
213 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64")) |
214 | ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases | |
215 | #:system) | |
b3ebd241 | 216 | (package-arguments wine)))) |
68e49211 | 217 | (synopsis "Implementation of the Windows API (WoW64 version)") |
5010d0e3 | 218 | (supported-systems '("x86_64-linux" "aarch64-linux")))) |
f6444059 | 219 | |
f6246195 RH |
220 | (define-public wine-staging-patchset-data |
221 | (package | |
222 | (name "wine-staging-patchset-data") | |
223 | (version "3.3") | |
224 | (source | |
225 | (origin | |
226 | (method url-fetch) | |
227 | (uri (string-append "https://github.com/wine-staging/wine-staging/archive/v" | |
228 | version ".zip")) | |
229 | (file-name (string-append name "-" version ".zip")) | |
230 | (sha256 | |
231 | (base32 | |
232 | "16l28vrhqn27kipqwms622jz1prfky8qkjb8pj747k3qjnm2k1g9")))) | |
233 | (build-system trivial-build-system) | |
234 | (native-inputs | |
235 | `(("bash" ,bash) | |
236 | ("coreutils" ,coreutils) | |
237 | ("unzip" ,unzip))) | |
238 | (arguments | |
239 | `(#:modules ((guix build utils)) | |
240 | #:builder | |
241 | (begin | |
242 | (use-modules (guix build utils)) | |
243 | (let* ((out (assoc-ref %outputs "out")) | |
244 | (wine-staging (string-append out "/share/wine-staging")) | |
245 | (source (assoc-ref %build-inputs "source")) | |
246 | (sh (string-append (assoc-ref %build-inputs "bash") "/bin/bash")) | |
247 | (env (string-append (assoc-ref %build-inputs "coreutils") "/bin/env")) | |
248 | (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))) | |
249 | (copy-file source (string-append ,name "-" ,version ".zip")) | |
250 | (invoke unzip (string-append ,name "-" ,version ".zip")) | |
251 | (substitute* (string-append "wine-staging-" ,version | |
252 | "/patches/patchinstall.sh") (("/bin/sh") sh)) | |
253 | (substitute* (string-append "wine-staging-" ,version | |
254 | "/patches/gitapply.sh") (("/usr/bin/env") env)) | |
255 | (mkdir-p wine-staging) | |
256 | (copy-recursively (string-append "wine-staging-" ,version) | |
257 | wine-staging))))) | |
258 | (home-page "https://github.com/wine-staging") | |
259 | (synopsis "Patchset for Wine") | |
260 | (description | |
261 | "wine-staging-patchset-data contains the patchset to build Wine-Staging.") | |
262 | (license license:lgpl2.1+))) | |
263 | ||
7866d8c8 NG |
264 | (define-public wine-staging |
265 | (package | |
266 | (inherit wine) | |
267 | (name "wine-staging") | |
b53b9c8d | 268 | (version (package-version wine-staging-patchset-data)) |
7866d8c8 NG |
269 | (source (origin |
270 | (method url-fetch) | |
271 | (uri (string-append | |
b53b9c8d RH |
272 | "https://dl.winehq.org/wine/source/3.x/wine-" version |
273 | ".tar.xz")) | |
274 | (file-name (string-append name "-" version ".tar.xz")) | |
7866d8c8 NG |
275 | (sha256 |
276 | (base32 | |
b53b9c8d RH |
277 | "0cx31jsll7mxd9r7v0vpahajqwb6da6cpwybv06l5ydkgfrbv505")))) |
278 | (inputs `(("autoconf" ,autoconf) ; for autoreconf | |
279 | ("gtk+", gtk+) | |
141708ed | 280 | ("libva", libva) |
b53b9c8d RH |
281 | ("python" ,python) |
282 | ("util-linux" ,util-linux) ; for hexdump | |
39b4744a | 283 | ("vulkan-icd-loader" ,vulkan-icd-loader) |
b53b9c8d | 284 | ("wine-staging-patchset-data" ,wine-staging-patchset-data) |
141708ed | 285 | ,@(package-inputs wine))) |
39b4744a RH |
286 | (arguments |
287 | `(#:phases | |
288 | (modify-phases %standard-phases | |
b53b9c8d | 289 | (add-before 'configure 'patch-source-wine-staging |
39b4744a | 290 | (lambda* (#:key outputs #:allow-other-keys) |
b53b9c8d RH |
291 | (let* ((source (assoc-ref %build-inputs "source")) |
292 | (script (string-append (assoc-ref %build-inputs | |
293 | "wine-staging-patchset-data") | |
294 | "/share/wine-staging/patches/patchinstall.sh"))) | |
295 | (invoke script (string-append "DESTDIR=" ".") "--all") | |
39b4744a RH |
296 | #t))) |
297 | (add-after 'configure 'patch-dlopen-paths | |
298 | ;; Hardcode dlopened sonames to absolute paths. | |
299 | (lambda _ | |
300 | (let* ((library-path (search-path-as-string->list | |
301 | (getenv "LIBRARY_PATH"))) | |
302 | (find-so (lambda (soname) | |
303 | (search-path library-path soname)))) | |
304 | (substitute* "include/config.h" | |
305 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
306 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
307 | #t)))) | |
308 | ,@(strip-keyword-arguments '(#:phases) | |
309 | (package-arguments wine)))) | |
95c45e53 | 310 | (synopsis "Implementation of the Windows API (staging branch, 32-bit only)") |
7866d8c8 NG |
311 | (description "Wine-Staging is the testing area of Wine. It |
312 | contains bug fixes and features, which have not been integrated into | |
313 | the development branch yet. The idea of Wine-Staging is to provide | |
314 | experimental features faster to end users and to give developers the | |
315 | possibility to discuss and improve their patches before they are | |
316 | integrated into the main branch.") | |
b53b9c8d | 317 | (home-page "https://github.com/wine-staging") |
7866d8c8 NG |
318 | ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging |
319 | ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use | |
320 | ;; different licenses. In particular, the latter is licensed under | |
321 | ;; both GPL3+ and Apache 2 License. | |
322 | (license | |
323 | (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0)))) | |
6cd46747 RH |
324 | |
325 | (define-public wine64-staging | |
326 | (package | |
327 | (inherit wine-staging) | |
328 | (name "wine64-staging") | |
c41fb54f RH |
329 | (inputs `(("wine-staging" ,wine-staging) |
330 | ,@(package-inputs wine-staging))) | |
6cd46747 RH |
331 | (arguments |
332 | `(#:make-flags | |
333 | (list "SHELL=bash" | |
c41fb54f RH |
334 | (string-append "libdir=" %output "/lib/wine64")) |
335 | #:phases | |
336 | (modify-phases %standard-phases | |
3139f185 | 337 | (add-before 'configure 'patch-source-wine-staging |
ee5402bf | 338 | (lambda* (#:key outputs #:allow-other-keys) |
3139f185 RH |
339 | (let* ((source (assoc-ref %build-inputs "source")) |
340 | (script (string-append (assoc-ref %build-inputs | |
341 | "wine-staging-patchset-data") | |
342 | "/share/wine-staging/patches/patchinstall.sh"))) | |
343 | (invoke script (string-append "DESTDIR=" ".") "--all") | |
ee5402bf | 344 | #t))) |
e6b94a02 RH |
345 | (add-after 'install 'copy-wine32-binaries |
346 | (lambda* (#:key outputs #:allow-other-keys) | |
417903c6 | 347 | (let* ((wine32 (assoc-ref %build-inputs "wine-staging")) |
e6b94a02 RH |
348 | (out (assoc-ref %outputs "out"))) |
349 | ;; Copy the 32-bit binaries needed for WoW64. | |
350 | (copy-file (string-append wine32 "/bin/wine") | |
351 | (string-append out "/bin/wine")) | |
352 | (copy-file (string-append wine32 "/bin/wine-preloader") | |
353 | (string-append out "/bin/wine-preloader")) | |
354 | #t))) | |
355 | (add-after 'compress-documentation 'copy-wine32-manpage | |
c41fb54f | 356 | (lambda* (#:key outputs #:allow-other-keys) |
417903c6 | 357 | (let* ((wine32 (assoc-ref %build-inputs "wine-staging")) |
e6b94a02 RH |
358 | (out (assoc-ref %outputs "out"))) |
359 | ;; Copy the missing man file for the wine binary from | |
360 | ;; wine-staging. | |
361 | (copy-file (string-append wine32 "/share/man/man1/wine.1.gz") | |
362 | (string-append out "/share/man/man1/wine.1.gz")) | |
363 | #t))) | |
c41fb54f RH |
364 | (add-after 'configure 'patch-dlopen-paths |
365 | ;; Hardcode dlopened sonames to absolute paths. | |
366 | (lambda _ | |
367 | (let* ((library-path (search-path-as-string->list | |
368 | (getenv "LIBRARY_PATH"))) | |
369 | (find-so (lambda (soname) | |
370 | (search-path library-path soname)))) | |
371 | (substitute* "include/config.h" | |
372 | (("(#define SONAME_.* )\"(.*)\"" _ defso soname) | |
373 | (format #f "~a\"~a\"" defso (find-so soname)))) | |
374 | #t)))) | |
6cd46747 RH |
375 | #:configure-flags |
376 | (list "--enable-win64" | |
c41fb54f RH |
377 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64")) |
378 | ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases | |
379 | #:system) | |
6cd46747 | 380 | (package-arguments wine-staging)))) |
1adc6013 | 381 | (synopsis "Implementation of the Windows API (staging branch, WoW64 |
6cd46747 RH |
382 | version)") |
383 | (supported-systems '("x86_64-linux" "aarch64-linux")))) |