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>
8 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
66 (uri (string-append "https://dl.winehq.org/wine/source/2.0"
67 "/wine-" version ".tar.xz"))
70 "0mmyc94r5drffir8zr8jx6iawhgfzjk96fj494aa18vhz1jcc4d8"))))
71 (build-system gnu-build-system)
72 (native-inputs `(("pkg-config" ,pkg-config)
73 ("gettext" ,gettext-minimal)
78 `(("alsa-lib" ,alsa-lib)
82 ("fontconfig" ,fontconfig)
83 ("freetype" ,freetype)
86 ("gst-plugins-base" ,gst-plugins-base)
90 ("libgphoto2" ,libgphoto2)
94 ("libsane" ,sane-backends)
103 ("libXcursor" ,libxcursor)
104 ("libXrender" ,libxrender)
105 ("libXrandr" ,libxrandr)
106 ("libXinerama" ,libxinerama)
107 ("libXxf86vm" ,libxxf86vm)
108 ("libXcomposite" ,libxcomposite)
111 ("pulseaudio" ,pulseaudio)
112 ("unixodbc" ,unixodbc)
113 ("v4l-utils" ,v4l-utils)
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"
120 ;; XXX: There's a test suite, but it's unclear whether it's supposed to
125 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
129 (string-append "libdir=" %output "/lib/wine32"))
132 (modify-phases %standard-phases
133 (add-after 'configure 'patch-dlopen-paths
134 ;; Hardcode dlopened sonames to absolute paths.
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))))
144 (home-page "https://www.winehq.org/")
145 (synopsis "Implementation of the Windows API")
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+)
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"))))
159 (define-public wine64
163 (inputs `(("wine" ,wine)
164 ,@(package-inputs wine)))
168 (string-append "libdir=" %output "/lib/wine64"))
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"))
181 (add-after 'configure 'patch-dlopen-paths
182 ;; Hardcode dlopened sonames to absolute paths.
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))))
193 (list "--enable-win64"
194 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
195 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
197 (package-arguments wine))))
198 (synopsis "Implementation of the Windows API (WOW64 version)")
199 (supported-systems '("x86_64-linux" "aarch64-linux"))))
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)
209 (uri (string-append "https://dl.winehq.org/wine/source/2.x"
210 "/wine-" version ".tar.xz"))
213 "0g6cwjyqwc660w33453aklh3hpc0b8rrb88dryn23ah6wannvagg"))))))
215 (define-public wine-staging
218 (name "wine-staging")
223 "https://github.com/wine-compholio/wine-patched/archive/"
224 "staging-" version ".tar.gz"))
225 (file-name (string-append name "-" version ".tar.gz"))
228 "1pjaxj7h3q6y356np908fvsx0bf7yx5crqvgl4hza6gfssdmsr5r"))))
229 (inputs `(("gtk+", gtk+)
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.
245 (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
247 (define-public wine64-staging
249 (inherit wine-staging)
250 (name "wine64-staging")
251 (inputs `(("wine-staging" ,wine-staging)
252 ,@(package-inputs wine-staging)))
256 (string-append "libdir=" %output "/lib/wine64"))
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"))
269 (add-after 'configure 'patch-dlopen-paths
270 ;; Hardcode dlopened sonames to absolute paths.
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))))
281 (list "--enable-win64"
282 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
283 ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
285 (package-arguments wine-staging))))
286 (synopsis "Implementation of the Windows API (staging branch, WOW64
288 (supported-systems '("x86_64-linux" "aarch64-linux"))))