gnu: wine: Update to 2.11.
[guix.git] / gnu / packages / wine.scm
blob1fb2c542cfa08cd147b834211ba1c58dfa34ae33
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/>.
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))
55 (define-public wine
56   (package
57     (name "wine")
58     (version "2.11")
59     (source (origin
60               (method url-fetch)
61               (uri (string-append "https://dl.winehq.org/wine/source/2.x"
62                                   "/wine-" version ".tar.xz"))
63               (sha256
64                (base32
65                 "0g6cwjyqwc660w33453aklh3hpc0b8rrb88dryn23ah6wannvagg"))))
66     (build-system gnu-build-system)
67     (native-inputs `(("pkg-config" ,pkg-config)
68                      ("gettext" ,gettext-minimal)
69                      ; A bug in flex prevents building with flex-2.6.3.
70                      ("flex" ,flex-2.6.1)
71                      ("bison" ,bison)
72                      ("perl" ,perl)))
73     (inputs
74      `(("alsa-lib" ,alsa-lib)
75        ("dbus" ,dbus)
76        ("cups" ,cups)
77        ("fontconfig" ,fontconfig)
78        ("freetype" ,freetype)
79        ("glu" ,glu)
80        ("gnutls" ,gnutls)
81        ("lcms" ,lcms)
82        ("libxml2" ,libxml2)
83        ("libxslt" ,libxslt)
84        ("libgphoto2" ,libgphoto2)
85        ("libmpg123" ,mpg123)
86        ("libldap" ,openldap)
87        ("libnetapi" ,samba)
88        ("libsane" ,sane-backends)
89        ("libpng" ,libpng)
90        ("libjpeg" ,libjpeg)
91        ("libtiff" ,libtiff)
92        ("libICE" ,libice)
93        ("libX11" ,libx11)
94        ("libXi" ,libxi)
95        ("libXext" ,libxext)
96        ("libXcursor" ,libxcursor)
97        ("libXrender" ,libxrender)
98        ("libXrandr" ,libxrandr)
99        ("libXinerama" ,libxinerama)
100        ("libXxf86vm" ,libxxf86vm)
101        ("libXcomposite" ,libxcomposite)
102        ("ncurses" ,ncurses)
103        ("openal" ,openal)
104        ("pulseaudio" ,pulseaudio)
105        ("unixodbc" ,unixodbc)
106        ("zlib" ,zlib)))
107     (arguments
108      `(;; Force a 32-bit build (under the assumption that this package is
109        ;; being used on an IA32-compatible architecture.)
110        #:system "i686-linux"
112        ;; XXX: There's a test suite, but it's unclear whether it's supposed to
113        ;; pass.
114        #:tests? #f
116        #:configure-flags
117        (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
119        #:make-flags
120        (list "SHELL=bash")
122        #:phases
123        (modify-phases %standard-phases
124          (add-after 'configure 'patch-dlopen-paths
125            ;; Hardcode dlopened sonames to absolute paths.
126            (lambda _
127              (let* ((library-path (search-path-as-string->list
128                                    (getenv "LIBRARY_PATH")))
129                     (find-so (lambda (soname)
130                                (search-path library-path soname))))
131                (substitute* "include/config.h"
132                  (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
133                   (format #f "~a\"~a\"" defso (find-so soname))))
134                #t))))))
135     (home-page "https://www.winehq.org/")
136     (synopsis "Implementation of the Windows API")
137     (description
138      "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
139 compatibility layer capable of running Windows applications.  Instead of
140 simulating internal Windows logic like a virtual machine or emulator, Wine
141 translates Windows API calls into POSIX calls on-the-fly, eliminating the
142 performance and memory penalties of other methods and allowing you to cleanly
143 integrate Windows applications into your desktop.")
144     (license license:lgpl2.1+)
146     ;; It really only supports IA32, but building on x86_64 will have the same
147     ;; effect as building on i686 anyway.
148     (supported-systems '("i686-linux" "x86_64-linux"))))
150 (define-public wine64
151   (package
152     (inherit wine)
153     (name "wine64")
154     (arguments
155      `(#:configure-flags
156        (list "--enable-win64"
157              (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib64"))
158        ,@(strip-keyword-arguments '(#:configure-flags #:system)
159                                   (package-arguments wine))))
160     (synopsis "Implementation of the Windows API (64-bit version)")
161     (supported-systems '("x86_64-linux"))))