gnu: wine64: Fix arguments.
[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>
44cba47e 4;;; Copyright © 2016, 2017 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
SB
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
1aa6582e 30 #:use-module (gnu packages admin)
025cc9a1 31 #:use-module (gnu packages audio)
8f9580ca
SB
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages compression)
025cc9a1 34 #:use-module (gnu packages cups)
8f9580ca
SB
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages fontutils)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages image)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages ghostscript)
41 #:use-module (gnu packages gl)
42 #:use-module (gnu packages glib)
1aa6582e 43 #:use-module (gnu packages gstreamer)
141708ed 44 #:use-module (gnu packages gtk)
8f9580ca
SB
45 #:use-module (gnu packages linux)
46 #:use-module (gnu packages openldap)
47 #:use-module (gnu packages perl)
05740895 48 #:use-module (gnu packages pulseaudio)
8f9580ca
SB
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages mp3)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages photo)
53 #:use-module (gnu packages samba)
54 #:use-module (gnu packages scanner)
a7fd7b68 55 #:use-module (gnu packages tls)
1aa6582e 56 #:use-module (gnu packages video)
8f9580ca 57 #:use-module (gnu packages xml)
b4a330ac
EF
58 #:use-module (gnu packages xorg)
59 #:use-module (ice-9 match))
8f9580ca
SB
60
61(define-public wine
62 (package
63 (name "wine")
3ee6315d 64 (version "2.0.4")
8f9580ca
SB
65 (source (origin
66 (method url-fetch)
f6444059 67 (uri (string-append "https://dl.winehq.org/wine/source/2.0"
5a717a95 68 "/wine-" version ".tar.xz"))
8f9580ca
SB
69 (sha256
70 (base32
3ee6315d 71 "0nlq6apyq7hq36l3g6gw76lhi8ijz11v3v8m4vxy8d6x1qsppq5m"))))
8f9580ca
SB
72 (build-system gnu-build-system)
73 (native-inputs `(("pkg-config" ,pkg-config)
b94a6ca0 74 ("gettext" ,gettext-minimal)
5e54f4ad 75 ("flex" ,flex)
8f9580ca
SB
76 ("bison" ,bison)
77 ("perl" ,perl)))
78 (inputs
79 `(("alsa-lib" ,alsa-lib)
80 ("dbus" ,dbus)
025cc9a1 81 ("cups" ,cups)
1aa6582e 82 ("eudev" ,eudev)
8f9580ca
SB
83 ("fontconfig" ,fontconfig)
84 ("freetype" ,freetype)
025cc9a1 85 ("glu" ,glu)
8f9580ca 86 ("gnutls" ,gnutls)
1aa6582e 87 ("gst-plugins-base" ,gst-plugins-base)
8f9580ca
SB
88 ("lcms" ,lcms)
89 ("libxml2" ,libxml2)
90 ("libxslt" ,libxslt)
91 ("libgphoto2" ,libgphoto2)
92 ("libmpg123" ,mpg123)
93 ("libldap" ,openldap)
94 ("libnetapi" ,samba)
4c928743 95 ("libsane" ,sane-backends)
1aa6582e 96 ("libpcap" ,libpcap)
8f9580ca
SB
97 ("libpng" ,libpng)
98 ("libjpeg" ,libjpeg)
99 ("libtiff" ,libtiff)
100 ("libICE" ,libice)
101 ("libX11" ,libx11)
102 ("libXi" ,libxi)
103 ("libXext" ,libxext)
104 ("libXcursor" ,libxcursor)
105 ("libXrender" ,libxrender)
106 ("libXrandr" ,libxrandr)
107 ("libXinerama" ,libxinerama)
108 ("libXxf86vm" ,libxxf86vm)
109 ("libXcomposite" ,libxcomposite)
8f9580ca 110 ("ncurses" ,ncurses)
025cc9a1 111 ("openal" ,openal)
05740895 112 ("pulseaudio" ,pulseaudio)
8f9580ca 113 ("unixodbc" ,unixodbc)
1aa6582e 114 ("v4l-utils" ,v4l-utils)
8f9580ca
SB
115 ("zlib" ,zlib)))
116 (arguments
b4a330ac
EF
117 `(;; Force a 32-bit build targeting a similar architecture, i.e.:
118 ;; armhf for armhf/aarch64, i686 for i686/x86_64.
119 #:system ,@(match (%current-system)
120 ((or "armhf-linux" "aarch64-linux")
121 `("armhf-linux"))
122 (_
123 `("i686-linux")))
8f9580ca
SB
124
125 ;; XXX: There's a test suite, but it's unclear whether it's supposed to
126 ;; pass.
127 #:tests? #f
128
6c0dfb19 129 #:configure-flags
5cead945 130 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
6c0dfb19 131
eeabe5a1 132 #:make-flags
5cead945
RH
133 (list "SHELL=bash"
134 (string-append "libdir=" %output "/lib/wine32"))
eeabe5a1 135
8f9580ca 136 #:phases
07cda02c
EF
137 (modify-phases %standard-phases
138 (add-after 'configure 'patch-dlopen-paths
139 ;; Hardcode dlopened sonames to absolute paths.
140 (lambda _
141 (let* ((library-path (search-path-as-string->list
142 (getenv "LIBRARY_PATH")))
143 (find-so (lambda (soname)
144 (search-path library-path soname))))
145 (substitute* "include/config.h"
146 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
147 (format #f "~a\"~a\"" defso (find-so soname))))
148 #t))))))
658c987f 149 (home-page "https://www.winehq.org/")
06e57331 150 (synopsis "Implementation of the Windows API (32-bit only)")
8f9580ca
SB
151 (description
152 "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
153compatibility layer capable of running Windows applications. Instead of
154simulating internal Windows logic like a virtual machine or emulator, Wine
155translates Windows API calls into POSIX calls on-the-fly, eliminating the
156performance and memory penalties of other methods and allowing you to cleanly
157integrate Windows applications into your desktop.")
158 (license license:lgpl2.1+)
159
160 ;; It really only supports IA32, but building on x86_64 will have the same
161 ;; effect as building on i686 anyway.
b4a330ac 162 (supported-systems (delete "mips64el-linux" %supported-systems))))
b3ebd241
RH
163
164(define-public wine64
165 (package
166 (inherit wine)
167 (name "wine64")
58cbcb02
RH
168 (inputs `(("wine" ,wine)
169 ,@(package-inputs wine)))
b3ebd241 170 (arguments
e02693a3
RH
171 `(#:make-flags
172 (list "SHELL=bash"
58cbcb02
RH
173 (string-append "libdir=" %output "/lib/wine64"))
174 #:phases
175 (modify-phases %standard-phases
036f3577 176 (add-after 'install 'copy-wine32-binaries
58cbcb02 177 (lambda* (#:key outputs #:allow-other-keys)
036f3577
RH
178 (let* ((wine32 (assoc-ref %build-inputs "wine"))
179 (out (assoc-ref %outputs "out")))
180 ;; Copy the 32-bit binaries needed for WoW64.
181 (copy-file (string-append wine32 "/bin/wine")
182 (string-append out "/bin/wine"))
183 (copy-file (string-append wine32 "/bin/wine-preloader")
184 (string-append out "/bin/wine-preloader"))
185 #t)))
186 (add-after 'compress-documentation 'copy-wine32-manpage
187 (lambda* (#:key outputs #:allow-other-keys)
188 (let* ((wine32 (assoc-ref %build-inputs "wine"))
189 (out (assoc-ref %outputs "out")))
190 ;; Copy the missing man file for the wine binary from wine.
191 (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
192 (string-append out "/share/man/man1/wine.1.gz"))
193 #t)))
58cbcb02
RH
194 (add-after 'configure 'patch-dlopen-paths
195 ;; Hardcode dlopened sonames to absolute paths.
196 (lambda _
197 (let* ((library-path (search-path-as-string->list
198 (getenv "LIBRARY_PATH")))
199 (find-so (lambda (soname)
200 (search-path library-path soname))))
201 (substitute* "include/config.h"
202 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
203 (format #f "~a\"~a\"" defso (find-so soname))))
204 #t))))
e02693a3 205 #:configure-flags
b3ebd241 206 (list "--enable-win64"
58cbcb02
RH
207 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
208 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
209 #:system)
b3ebd241 210 (package-arguments wine))))
68e49211 211 (synopsis "Implementation of the Windows API (WoW64 version)")
5010d0e3 212 (supported-systems '("x86_64-linux" "aarch64-linux"))))
f6444059
NG
213
214;; TODO: This is wine development version, provided for historical reasons.
215;; We can remove it as soon as a new stable release is out.
216(define-public wine-next
217 (package (inherit wine)
218 (name "wine-next")
219 (version "2.11")
220 (source (origin
221 (method url-fetch)
222 (uri (string-append "https://dl.winehq.org/wine/source/2.x"
223 "/wine-" version ".tar.xz"))
224 (sha256
225 (base32
226 "0g6cwjyqwc660w33453aklh3hpc0b8rrb88dryn23ah6wannvagg"))))))
227
7866d8c8
NG
228(define-public wine-staging
229 (package
230 (inherit wine)
231 (name "wine-staging")
232 (version "2.21")
233 (source (origin
234 (method url-fetch)
235 (uri (string-append
236 "https://github.com/wine-compholio/wine-patched/archive/"
237 "staging-" version ".tar.gz"))
238 (file-name (string-append name "-" version ".tar.gz"))
239 (sha256
240 (base32
241 "1pjaxj7h3q6y356np908fvsx0bf7yx5crqvgl4hza6gfssdmsr5r"))))
141708ed
RH
242 (inputs `(("gtk+", gtk+)
243 ("libva", libva)
244 ,@(package-inputs wine)))
95c45e53 245 (synopsis "Implementation of the Windows API (staging branch, 32-bit only)")
7866d8c8
NG
246 (description "Wine-Staging is the testing area of Wine. It
247contains bug fixes and features, which have not been integrated into
248the development branch yet. The idea of Wine-Staging is to provide
249experimental features faster to end users and to give developers the
250possibility to discuss and improve their patches before they are
251integrated into the main branch.")
252 (home-page "https://wine-staging.com")
253 ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging
254 ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use
255 ;; different licenses. In particular, the latter is licensed under
256 ;; both GPL3+ and Apache 2 License.
257 (license
258 (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
6cd46747
RH
259
260(define-public wine64-staging
261 (package
262 (inherit wine-staging)
263 (name "wine64-staging")
c41fb54f
RH
264 (inputs `(("wine-staging" ,wine-staging)
265 ,@(package-inputs wine-staging)))
6cd46747
RH
266 (arguments
267 `(#:make-flags
268 (list "SHELL=bash"
c41fb54f
RH
269 (string-append "libdir=" %output "/lib/wine64"))
270 #:phases
271 (modify-phases %standard-phases
272 (add-after 'install 'copy-wine32-files
273 (lambda* (#:key outputs #:allow-other-keys)
1adc6013 274 ;; Copy the 32-bit binaries needed for WoW64.
c41fb54f
RH
275 (copy-file (string-append (assoc-ref %build-inputs "wine-staging")
276 "/bin/wine") (string-append (assoc-ref
277 %outputs "out") "/bin/wine"))
278 (copy-file (string-append (assoc-ref %build-inputs "wine-staging")
279 "/bin/wine-preloader") (string-append
280 (assoc-ref %outputs "out")
281 "/bin/wine-preloader"))
1adc6013
RH
282 ;; Copy the missing man file for the wine binary from wine-staging.
283 (system (string-append "gunzip < " (string-append (assoc-ref
284 %build-inputs "wine-staging")
285 "/share/man/man1/wine.1.gz") "> "
286 (string-append (assoc-ref %outputs "out")
287 "/share/man/man1/wine.1")))
c41fb54f
RH
288 #t))
289 (add-after 'configure 'patch-dlopen-paths
290 ;; Hardcode dlopened sonames to absolute paths.
291 (lambda _
292 (let* ((library-path (search-path-as-string->list
293 (getenv "LIBRARY_PATH")))
294 (find-so (lambda (soname)
295 (search-path library-path soname))))
296 (substitute* "include/config.h"
297 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
298 (format #f "~a\"~a\"" defso (find-so soname))))
299 #t))))
6cd46747
RH
300 #:configure-flags
301 (list "--enable-win64"
c41fb54f
RH
302 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
303 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
304 #:system)
6cd46747 305 (package-arguments wine-staging))))
1adc6013 306 (synopsis "Implementation of the Windows API (staging branch, WoW64
6cd46747
RH
307version)")
308 (supported-systems '("x86_64-linux" "aarch64-linux"))))