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