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