gnu: mariadb: Remove huge mysql_embedded executable.
[jackhill/guix/guix.git] / gnu / packages / wine.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Sou Bunnbu <iyzsong@gmail.com>
3 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
6 ;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
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)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system trivial)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages admin)
32 #:use-module (gnu packages audio)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages bash)
36 #:use-module (gnu packages bison)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages cups)
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)
47 #:use-module (gnu packages gstreamer)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages kerberos)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages openldap)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pulseaudio)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
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)
61 #:use-module (gnu packages sdl)
62 #:use-module (gnu packages tls)
63 #:use-module (gnu packages video)
64 #:use-module (gnu packages vulkan)
65 #:use-module (gnu packages xml)
66 #:use-module (gnu packages xorg)
67 #:use-module (ice-9 match))
68
69 (define-public wine
70 (package
71 (name "wine")
72 (version "3.0.2")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "https://dl.winehq.org/wine/source/"
76 (version-major+minor version)
77 "/wine-" version ".tar.xz"))
78 (sha256
79 (base32
80 "1zv3nk31s758ghp4795ym3w8l5868c2dllmjx9245qh9ahvp3mya"))))
81 (build-system gnu-build-system)
82 (native-inputs `(("pkg-config" ,pkg-config)
83 ("gettext" ,gettext-minimal)
84 ("flex" ,flex)
85 ("bison" ,bison)
86 ("perl" ,perl)))
87 (inputs
88 `(("alsa-lib" ,alsa-lib)
89 ("dbus" ,dbus)
90 ("cups" ,cups)
91 ("eudev" ,eudev)
92 ("fontconfig" ,fontconfig)
93 ("freetype" ,freetype)
94 ("glu" ,glu)
95 ("gnutls" ,gnutls)
96 ("gst-plugins-base" ,gst-plugins-base)
97 ("lcms" ,lcms)
98 ("libxml2" ,libxml2)
99 ("libxslt" ,libxslt)
100 ("libgphoto2" ,libgphoto2)
101 ("libmpg123" ,mpg123)
102 ("libldap" ,openldap)
103 ("libnetapi" ,samba)
104 ("libsane" ,sane-backends)
105 ("libpcap" ,libpcap)
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)
119 ("mit-krb5" ,mit-krb5)
120 ("ncurses" ,ncurses)
121 ("openal" ,openal)
122 ("pulseaudio" ,pulseaudio)
123 ("unixodbc" ,unixodbc)
124 ("v4l-utils" ,v4l-utils)
125 ("zlib" ,zlib)))
126 (arguments
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")))
134
135 ;; XXX: There's a test suite, but it's unclear whether it's supposed to
136 ;; pass.
137 #:tests? #f
138
139 #:configure-flags
140 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
141
142 #:make-flags
143 (list "SHELL=bash"
144 (string-append "libdir=" %output "/lib/wine32"))
145
146 #:phases
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))))))
159 (home-page "https://www.winehq.org/")
160 (synopsis "Implementation of the Windows API (32-bit only)")
161 (description
162 "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
163 compatibility layer capable of running Windows applications. Instead of
164 simulating internal Windows logic like a virtual machine or emulator, Wine
165 translates Windows API calls into POSIX calls on-the-fly, eliminating the
166 performance and memory penalties of other methods and allowing you to cleanly
167 integrate Windows applications into your desktop.")
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"))
171 (license license:lgpl2.1+)))
172
173 (define-public wine64
174 (package
175 (inherit wine)
176 (name "wine64")
177 (inputs `(("wine" ,wine)
178 ,@(package-inputs wine)))
179 (arguments
180 `(#:make-flags
181 (list "SHELL=bash"
182 (string-append "libdir=" %output "/lib/wine64"))
183 #:phases
184 (modify-phases %standard-phases
185 (add-after 'install 'copy-wine32-binaries
186 (lambda* (#:key outputs #:allow-other-keys)
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)))
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))))
214 #:configure-flags
215 (list "--enable-win64"
216 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
217 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
218 #:system)
219 (package-arguments wine))))
220 (synopsis "Implementation of the Windows API (WoW64 version)")
221 (supported-systems '("x86_64-linux" "aarch64-linux"))))
222
223 (define-public wine-staging-patchset-data
224 (package
225 (name "wine-staging-patchset-data")
226 (version "3.13")
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
235 "0h27h4z4m2m77chp3alkv6fagppjhh9ys39d3n21j0yfjknyhdd8"))))
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 #t))))
262 (home-page "https://github.com/wine-staging")
263 (synopsis "Patchset for Wine")
264 (description
265 "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
266 (license license:lgpl2.1+)))
267
268 (define-public wine-staging
269 (package
270 (inherit wine)
271 (name "wine-staging")
272 (version (package-version wine-staging-patchset-data))
273 (source (origin
274 (method url-fetch)
275 (uri (string-append
276 "https://dl.winehq.org/wine/source/"
277 (version-major version) ".x"
278 "/wine-" version ".tar.xz"))
279 (file-name (string-append name "-" version ".tar.xz"))
280 (sha256
281 (base32
282 "1m5v854r5wgw68b97j6wim1a8692x5sih25c0xp1yb13a94dg187"))))
283 (inputs `(("autoconf" ,autoconf) ; for autoreconf
284 ("gtk+" ,gtk+)
285 ("libva" ,libva)
286 ("python" ,python)
287 ("sdl2" ,sdl2)
288 ("util-linux" ,util-linux) ; for hexdump
289 ("vkd3d" ,vkd3d)
290 ("vulkan-loader" ,vulkan-loader)
291 ("wine-staging-patchset-data" ,wine-staging-patchset-data)
292 ,@(package-inputs wine)))
293 (arguments
294 `(#:phases
295 (modify-phases %standard-phases
296 (add-before 'configure 'patch-source-wine-staging
297 (lambda* (#:key outputs #:allow-other-keys)
298 (let* ((source (assoc-ref %build-inputs "source"))
299 (script (string-append (assoc-ref %build-inputs
300 "wine-staging-patchset-data")
301 "/share/wine-staging/patches/patchinstall.sh")))
302 (invoke script (string-append "DESTDIR=" ".") "--all")
303 #t)))
304 (add-after 'configure 'patch-dlopen-paths
305 ;; Hardcode dlopened sonames to absolute paths.
306 (lambda _
307 (let* ((library-path (search-path-as-string->list
308 (getenv "LIBRARY_PATH")))
309 (find-so (lambda (soname)
310 (search-path library-path soname))))
311 (substitute* "include/config.h"
312 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
313 (format #f "~a\"~a\"" defso (find-so soname))))
314 #t))))
315 ,@(strip-keyword-arguments '(#:phases)
316 (package-arguments wine))))
317 (synopsis "Implementation of the Windows API (staging branch, 32-bit only)")
318 (description "Wine-Staging is the testing area of Wine. It
319 contains bug fixes and features, which have not been integrated into
320 the development branch yet. The idea of Wine-Staging is to provide
321 experimental features faster to end users and to give developers the
322 possibility to discuss and improve their patches before they are
323 integrated into the main branch.")
324 (home-page "https://github.com/wine-staging")
325 ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging
326 ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use
327 ;; different licenses. In particular, the latter is licensed under
328 ;; both GPL3+ and Apache 2 License.
329 (license
330 (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
331
332 (define-public wine64-staging
333 (package
334 (inherit wine-staging)
335 (name "wine64-staging")
336 (inputs `(("wine-staging" ,wine-staging)
337 ,@(package-inputs wine-staging)))
338 (arguments
339 `(#:make-flags
340 (list "SHELL=bash"
341 (string-append "libdir=" %output "/lib/wine64"))
342 #:phases
343 (modify-phases %standard-phases
344 (add-before 'configure 'patch-source-wine-staging
345 (lambda* (#:key outputs #:allow-other-keys)
346 (let* ((source (assoc-ref %build-inputs "source"))
347 (script (string-append (assoc-ref %build-inputs
348 "wine-staging-patchset-data")
349 "/share/wine-staging/patches/patchinstall.sh")))
350 (invoke script (string-append "DESTDIR=" ".") "--all")
351 #t)))
352 (add-after 'install 'copy-wine32-binaries
353 (lambda* (#:key outputs #:allow-other-keys)
354 (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
355 (out (assoc-ref %outputs "out")))
356 ;; Copy the 32-bit binaries needed for WoW64.
357 (copy-file (string-append wine32 "/bin/wine")
358 (string-append out "/bin/wine"))
359 (copy-file (string-append wine32 "/bin/wine-preloader")
360 (string-append out "/bin/wine-preloader"))
361 #t)))
362 (add-after 'compress-documentation 'copy-wine32-manpage
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
365 (out (assoc-ref %outputs "out")))
366 ;; Copy the missing man file for the wine binary from
367 ;; wine-staging.
368 (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
369 (string-append out "/share/man/man1/wine.1.gz"))
370 #t)))
371 (add-after 'configure 'patch-dlopen-paths
372 ;; Hardcode dlopened sonames to absolute paths.
373 (lambda _
374 (let* ((library-path (search-path-as-string->list
375 (getenv "LIBRARY_PATH")))
376 (find-so (lambda (soname)
377 (search-path library-path soname))))
378 (substitute* "include/config.h"
379 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
380 (format #f "~a\"~a\"" defso (find-so soname))))
381 #t))))
382 #:configure-flags
383 (list "--enable-win64"
384 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
385 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
386 #:system)
387 (package-arguments wine-staging))))
388 (synopsis "Implementation of the Windows API (staging branch, WoW64
389 version)")
390 (supported-systems '("x86_64-linux" "aarch64-linux"))))