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