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