Merge branch 'master' into core-updates
[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 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages wine)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages audio)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages cups)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages ghostscript)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages openldap)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pulseaudio)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages mp3)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages photo)
49 #:use-module (gnu packages samba)
50 #:use-module (gnu packages scanner)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages xml)
53 #:use-module (gnu packages xorg))
54
55 (define-public wine
56 (package
57 (name "wine")
58 (version "2.0.1")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "https://dl.winehq.org/wine/source/2.0"
62 "/wine-" version ".tar.xz"))
63 (sha256
64 (base32
65 "10qm0xxqzvl4y3mhvaxcaacrcs8d5kdz5wf0gbxpmp36wnm4xyvc"))))
66 (build-system gnu-build-system)
67 (native-inputs `(("pkg-config" ,pkg-config)
68 ("gettext" ,gettext-minimal)
69 ("flex" ,flex)
70 ("bison" ,bison)
71 ("perl" ,perl)))
72 (inputs
73 `(("alsa-lib" ,alsa-lib)
74 ("dbus" ,dbus)
75 ("cups" ,cups)
76 ("fontconfig" ,fontconfig)
77 ("freetype" ,freetype)
78 ("glu" ,glu)
79 ("gnutls" ,gnutls)
80 ("lcms" ,lcms)
81 ("libxml2" ,libxml2)
82 ("libxslt" ,libxslt)
83 ("libgphoto2" ,libgphoto2)
84 ("libmpg123" ,mpg123)
85 ("libldap" ,openldap)
86 ("libnetapi" ,samba)
87 ("libsane" ,sane-backends)
88 ("libpng" ,libpng)
89 ("libjpeg" ,libjpeg)
90 ("libtiff" ,libtiff)
91 ("libICE" ,libice)
92 ("libX11" ,libx11)
93 ("libXi" ,libxi)
94 ("libXext" ,libxext)
95 ("libXcursor" ,libxcursor)
96 ("libXrender" ,libxrender)
97 ("libXrandr" ,libxrandr)
98 ("libXinerama" ,libxinerama)
99 ("libXxf86vm" ,libxxf86vm)
100 ("libXcomposite" ,libxcomposite)
101 ("ncurses" ,ncurses)
102 ("openal" ,openal)
103 ("pulseaudio" ,pulseaudio)
104 ("unixodbc" ,unixodbc)
105 ("zlib" ,zlib)))
106 (arguments
107 `(;; Force a 32-bit build (under the assumption that this package is
108 ;; being used on an IA32-compatible architecture.)
109 #:system "i686-linux"
110
111 ;; XXX: There's a test suite, but it's unclear whether it's supposed to
112 ;; pass.
113 #:tests? #f
114
115 #:configure-flags
116 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
117
118 #:make-flags
119 (list "SHELL=bash")
120
121 #:phases
122 (modify-phases %standard-phases
123 (add-after 'configure 'patch-dlopen-paths
124 ;; Hardcode dlopened sonames to absolute paths.
125 (lambda _
126 (let* ((library-path (search-path-as-string->list
127 (getenv "LIBRARY_PATH")))
128 (find-so (lambda (soname)
129 (search-path library-path soname))))
130 (substitute* "include/config.h"
131 (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
132 (format #f "~a\"~a\"" defso (find-so soname))))
133 #t))))))
134 (home-page "https://www.winehq.org/")
135 (synopsis "Implementation of the Windows API")
136 (description
137 "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
138 compatibility layer capable of running Windows applications. Instead of
139 simulating internal Windows logic like a virtual machine or emulator, Wine
140 translates Windows API calls into POSIX calls on-the-fly, eliminating the
141 performance and memory penalties of other methods and allowing you to cleanly
142 integrate Windows applications into your desktop.")
143 (license license:lgpl2.1+)
144
145 ;; It really only supports IA32, but building on x86_64 will have the same
146 ;; effect as building on i686 anyway.
147 (supported-systems '("i686-linux" "x86_64-linux"))))
148
149 (define-public wine64
150 (package
151 (inherit wine)
152 (name "wine64")
153 (arguments
154 `(#:configure-flags
155 (list "--enable-win64"
156 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib64"))
157 ,@(strip-keyword-arguments '(#:configure-flags #:system)
158 (package-arguments wine))))
159 (synopsis "Implementation of the Windows API (64-bit version)")
160 (supported-systems '("x86_64-linux"))))
161
162 ;; TODO: This is wine development version, provided for historical reasons.
163 ;; We can remove it as soon as a new stable release is out.
164 (define-public wine-next
165 (package (inherit wine)
166 (name "wine-next")
167 (version "2.11")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append "https://dl.winehq.org/wine/source/2.x"
171 "/wine-" version ".tar.xz"))
172 (sha256
173 (base32
174 "0g6cwjyqwc660w33453aklh3hpc0b8rrb88dryn23ah6wannvagg"))))))
175