You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

644 lines
29 KiB

gnu: Replace uses of 'libjpeg' with 'libjpeg-turbo'. * gnu/packages/abiword.scm (abiword)[inputs]: Change from LIBJPEG to LIBJPEG-TURBO. * gnu/packages/admin.scm (testdisk)[inputs]: Likewise. * gnu/packages/algebra.scm (giac)[inputs]: Likewise. * gnu/packages/animation.scm (synfig)[inputs]: Likewise. * gnu/packages/astronomy.scm (gnuastro, celestia)[inputs]: Likewise. * gnu/packages/cdrom.scm (dvdstyler)[inputs]: Likewise. * gnu/packages/cran.scm (r-jpeg, r-tiff, r-readbitmap)[inputs]: Likewise. * gnu/packages/cups.scm (cups-filters, hplip)[inputs]: Likewise. * gnu/packages/display-managers.scm (slim)[inputs]: Likewise. * gnu/packages/ebook.scm (fbreader)[inputs]: Likewise. * gnu/packages/emacs.scm (emacs)[inputs]: Likewise. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/fltk.scm (fltk, ntk)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontforge)[inputs]: Likewise. * gnu/packages/freedesktop.scm (weston)[inputs]: Likewise. * gnu/packages/game-development.scm (sfml, allegro, aseprite, python-pygame, eureka, ioquake3)[inputs]: Likewise. * gnu/packages/games.scm (adanaxisgpl, freedroidrpg, irrlicht, minetest, fizmo, supertuxkart, gzdoom, xmoto, xonotic)[inputs]: Likewise. * gnu/packages/gd.scm (gd, perl-gd)[inputs]: Likewise. * gnu/packages/ghostscript.scm (lcms)[inputs]: Likewise. (ghostscript)[inputs, native-inputs]: Likewise. * gnu/packages/gimp.scm (gegl, gimp)[inputs]: Likewise. * gnu/packages/gnome.scm (libgnomeui, eog, tracker-miners, gthumb)[inputs]: Likewise. * gnu/packages/gnunet.scm (libextractor)[inputs]: Likewise. * gnu/packages/gnustep.scm (windowmaker)[inputs]: Likewise. * gnu/packages/graphics.scm (blender, blender-2.79, openimageio, openscenegraph, openscenegraph-3.4, povray, fgallery)[inputs]: Likewise. * gnu/packages/graphviz.scm (graphviz)[inputs]: Likewise. * gnu/packages/gstreamer.scm (gst-plugins-good)[inputs]: Likewise. * gnu/packages/gtk.scm (gdk-pixbuf)[inputs]: Likewise. * gnu/packages/image-processing.scm (dcmtk, mia, vtk, opencv, vips, nip2, vxl, insight-toolkit)[inputs]: Likewise. * gnu/packages/image-viewers.scm (gpicview, luminance-hdr)[inputs]: Likewise. * gnu/packages/image.scm (jpegoptim, libtiff, leptonica, imlib2, freeimage, vigra, libwebp, libmng, jasper, steghide, jp2a)[inputs]: Likewise. * gnu/packages/imagemagick.scm (imagemagick, graphicsmagick)[inputs]: Likewise. * gnu/packages/java.scm (icedtea-6, icedtea-7, openjdk9, openjdk11, openjdk12)[inputs]: Likewise. * gnu/packages/kde-frameworks.scm (khtml)[inputs]: Likewise. * gnu/packages/kodi.scm (kodi)[inputs]: Likewise. * gnu/packages/machine-learning.scm (dlib, tensorflow)[inputs]: Likewise. * gnu/packages/mate.scm (atril, eom)[inputs]: Likewise. * gnu/packages/maths.scm (hdf4, hdf-java, hdf-eos2, netcdf)[inputs]: Likewise. * gnu/packages/netpbm.scm (netpbm)[inputs]: Likewise. * gnu/packages/pdf.scm (zathura-pdf-mupdf, podofo, mupdf, fbida)[inputs]: Likewise. * gnu/packages/photo.scm (libraw, libpano13, enblend-enfuse, darktable, hugin, rawtherapee)[inputs]: Likewise. * gnu/packages/prolog.scm (swi-prolog)[native-inputs]: Likewise. * gnu/packages/python-xyz.scm (python-hdf4, python-pillow)[inputs]: Likewise. * gnu/packages/qt.scm (qtbase, qtwebkit)[inputs]: Likewise. * gnu/packages/rdesktop.scm (freerdp)[inputs]: Likewise. * gnu/packages/scanner.scm (sane-backends, xsane)[inputs]: Likewise. * gnu/packages/scheme.scm (racket)[inputs]: Likewise. * gnu/packages/scribus.scm (scribus)[inputs]: Likewise. * gnu/packages/sdl.scm (sdl-image)[propagated-inputs]: Likewise. (guile-sdl)[native-inputs]: Likewise. * gnu/packages/spice.scm (spice-gtk)[inputs]: Likewise. * gnu/packages/statistics.scm (r-with-tests)[inputs]: Likewise. * gnu/packages/tcl.scm (perl-tk)[inputs]: Likewise. * gnu/packages/upnp.scm (readymedia)[inputs]: Likewise. * gnu/packages/video.scm (mplayer, mpv, v4l-utils, motion)[inputs]: Likewise. * gnu/packages/web-browsers.scm (dillo, links)[inputs]: Likewise. * gnu/packages/web.scm (netsurf)[inputs]: Likewise. * gnu/packages/webkit.scm (webkitgtk)[inputs]: Likewise. * gnu/packages/wine.scm (wine)[inputs]: Likewise. * gnu/packages/wv.scm (wv)[inputs]: Likewise. * gnu/packages/wxwidgets.scm (wxwidgets, wxwidgets-2)[inputs]: Likewise. * gnu/packages/xdisorg.scm (xscreensaver)[inputs]: Likewise. * gnu/packages/xfce.scm (tumbler)[inputs]: Likewise. * gnu/packages/xfig.scm (xfig, transfig)[inputs]: Likewise. * gnu/packages/xorg.scm (xpra)[inputs]: Likewise.
2 years ago
gnu: Fix common unquote typos. It's easy to mistype ‘("foo" foo)’ as ‘("foo", foo)’ (which also works). Fix such typos for the proper edification of our young. * gnu/packages/android.scm: Move unquotes to their operands. * gnu/packages/bootloaders.scm: Likewise. * gnu/packages/build-tools.scm: Likewise. * gnu/packages/chemistry.scm: Likewise. * gnu/packages/compression.scm: Likewise. * gnu/packages/connman.scm: Likewise. * gnu/packages/django.scm: Likewise. * gnu/packages/emulators.scm: Likewise. * gnu/packages/engineering.scm: Likewise. * gnu/packages/file-systems.scm: Likewise. * gnu/packages/freedesktop.scm: Likewise. * gnu/packages/games.scm: Likewise. * gnu/packages/gimp.scm: Likewise. * gnu/packages/gl.scm: Likewise. * gnu/packages/gnome.scm: Likewise. * gnu/packages/graphics.scm: Likewise. * gnu/packages/haskell.scm: Likewise. * gnu/packages/irc.scm: Likewise. * gnu/packages/julia.scm: Likewise. * gnu/packages/kde-frameworks.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/lua.scm: Likewise. * gnu/packages/mail.scm: Likewise. * gnu/packages/make-bootstrap.scm: Likewise. * gnu/packages/messaging.scm: Likewise. * gnu/packages/music.scm: Likewise. * gnu/packages/networking.scm: Likewise. * gnu/packages/ocaml.scm: Likewise. * gnu/packages/perl.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/python-web.scm: Likewise. * gnu/packages/qt.scm: Likewise. * gnu/packages/ratpoison.scm: Likewise. * gnu/packages/sdl.scm: Likewise. * gnu/packages/sml.scm: Likewise. * gnu/packages/terminals.scm: Likewise. * gnu/packages/text-editors.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/virtualization.scm: Likewise. * gnu/packages/vulkan.scm: Likewise. * gnu/packages/wget.scm: Likewise. * gnu/packages/wine.scm: Likewise. * gnu/packages/wm.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/packages/xml.scm: Likewise. * gnu/packages/xorg.scm: Likewise.
4 years ago
  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, 2018 Efraim Flashner <efraim@flashner.co.il>
  5. ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
  6. ;;; Copyright © 2017, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  7. ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
  9. ;;;
  10. ;;; This file is part of GNU Guix.
  11. ;;;
  12. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  13. ;;; under the terms of the GNU General Public License as published by
  14. ;;; the Free Software Foundation; either version 3 of the License, or (at
  15. ;;; your option) any later version.
  16. ;;;
  17. ;;; GNU Guix is distributed in the hope that it will be useful, but
  18. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;;; GNU General Public License for more details.
  21. ;;;
  22. ;;; You should have received a copy of the GNU General Public License
  23. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  24. (define-module (gnu packages wine)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix git-download)
  29. #:use-module (guix utils)
  30. #:use-module (guix build-system gnu)
  31. #:use-module (guix build-system meson)
  32. #:use-module (guix build-system trivial)
  33. #:use-module (gnu packages)
  34. #:use-module (gnu packages admin)
  35. #:use-module (gnu packages audio)
  36. #:use-module (gnu packages autotools)
  37. #:use-module (gnu packages base)
  38. #:use-module (gnu packages bash)
  39. #:use-module (gnu packages bison)
  40. #:use-module (gnu packages compression)
  41. #:use-module (gnu packages cups)
  42. #:use-module (gnu packages databases)
  43. #:use-module (gnu packages fontutils)
  44. #:use-module (gnu packages flex)
  45. #:use-module (gnu packages image)
  46. #:use-module (gnu packages gcc)
  47. #:use-module (gnu packages gettext)
  48. #:use-module (gnu packages ghostscript)
  49. #:use-module (gnu packages gl)
  50. #:use-module (gnu packages glib)
  51. #:use-module (gnu packages gstreamer)
  52. #:use-module (gnu packages gtk)
  53. #:use-module (gnu packages kerberos)
  54. #:use-module (gnu packages linux)
  55. #:use-module (gnu packages mingw)
  56. #:use-module (gnu packages openldap)
  57. #:use-module (gnu packages perl)
  58. #:use-module (gnu packages pulseaudio)
  59. #:use-module (gnu packages pkg-config)
  60. #:use-module (gnu packages python)
  61. #:use-module (gnu packages mp3)
  62. #:use-module (gnu packages ncurses)
  63. #:use-module (gnu packages photo)
  64. #:use-module (gnu packages samba)
  65. #:use-module (gnu packages scanner)
  66. #:use-module (gnu packages sdl)
  67. #:use-module (gnu packages tls)
  68. #:use-module (gnu packages video)
  69. #:use-module (gnu packages vulkan)
  70. #:use-module (gnu packages xml)
  71. #:use-module (gnu packages xorg)
  72. #:use-module (ice-9 match)
  73. #:use-module (srfi srfi-1))
  74. (define-public wine
  75. (package
  76. (name "wine")
  77. (version "5.12")
  78. (source
  79. (origin
  80. (method url-fetch)
  81. (uri (let ((dir (string-append
  82. (version-major version)
  83. (if (string-suffix? ".0" (version-major+minor version))
  84. ".0/"
  85. ".x/"))))
  86. (string-append "https://dl.winehq.org/wine/source/" dir
  87. "wine-" version ".tar.xz")))
  88. (sha256
  89. (base32 "0bl4ii4h1w4z8kb6dpdc1pgwk0wrhm61c2q2nzpcckkrqra75wc7"))))
  90. (build-system gnu-build-system)
  91. (native-inputs
  92. `(("bison" ,bison)
  93. ("flex" ,flex)
  94. ("gettext" ,gettext-minimal)
  95. ("perl" ,perl)
  96. ("pkg-config" ,pkg-config)))
  97. (inputs
  98. `(("alsa-lib" ,alsa-lib)
  99. ("dbus" ,dbus)
  100. ("cups" ,cups)
  101. ("eudev" ,eudev)
  102. ("faudio" ,faudio)
  103. ("fontconfig" ,fontconfig)
  104. ("freetype" ,freetype)
  105. ("glu" ,glu)
  106. ("gnutls" ,gnutls)
  107. ("gst-plugins-base" ,gst-plugins-base)
  108. ("lcms" ,lcms)
  109. ("libxml2" ,libxml2)
  110. ("libxslt" ,libxslt)
  111. ("libgphoto2" ,libgphoto2)
  112. ("libmpg123" ,mpg123)
  113. ("libldap" ,openldap)
  114. ("libnetapi" ,samba)
  115. ("libsane" ,sane-backends)
  116. ("libpcap" ,libpcap)
  117. ("libpng" ,libpng)
  118. ("libjpeg" ,libjpeg-turbo)
  119. ("libtiff" ,libtiff)
  120. ("libICE" ,libice)
  121. ("libX11" ,libx11)
  122. ("libXi" ,libxi)
  123. ("libXext" ,libxext)
  124. ("libXcursor" ,libxcursor)
  125. ("libXrender" ,libxrender)
  126. ("libXrandr" ,libxrandr)
  127. ("libXinerama" ,libxinerama)
  128. ("libXxf86vm" ,libxxf86vm)
  129. ("libXcomposite" ,libxcomposite)
  130. ("mit-krb5" ,mit-krb5)
  131. ("ncurses" ,ncurses)
  132. ("openal" ,openal)
  133. ("pulseaudio" ,pulseaudio)
  134. ("sdl2" ,sdl2)
  135. ("unixodbc" ,unixodbc)
  136. ("v4l-utils" ,v4l-utils)
  137. ("vkd3d" ,vkd3d)
  138. ("vulkan-loader" ,vulkan-loader)
  139. ("zlib" ,zlib)))
  140. (arguments
  141. `(;; Force a 32-bit build targeting a similar architecture, i.e.:
  142. ;; armhf for armhf/aarch64, i686 for i686/x86_64.
  143. #:system ,@(match (%current-system)
  144. ((or "armhf-linux" "aarch64-linux")
  145. `("armhf-linux"))
  146. (_
  147. `("i686-linux")))
  148. ;; XXX: There's a test suite, but it's unclear whether it's supposed to
  149. ;; pass.
  150. #:tests? #f
  151. #:configure-flags
  152. (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
  153. #:make-flags
  154. (list "SHELL=bash"
  155. (string-append "libdir=" %output "/lib/wine32"))
  156. #:phases
  157. (modify-phases %standard-phases
  158. ;; Explicitly set the 32-bit version of vulkan-loader when installing
  159. ;; to i686-linux or x86_64-linux.
  160. ;; TODO: Add more JSON files as they become available in Mesa.
  161. ,@(match (%current-system)
  162. ((or "i686-linux" "x86_64-linux")
  163. `((add-after 'install 'wrap-executable
  164. (lambda* (#:key inputs outputs #:allow-other-keys)
  165. (let* ((out (assoc-ref outputs "out"))
  166. (icd (string-append out "/share/vulkan/icd.d")))
  167. (mkdir-p icd)
  168. (copy-file (string-append (assoc-ref inputs "mesa")
  169. "/share/vulkan/icd.d/radeon_icd.i686.json")
  170. (string-append icd "/radeon_icd.i686.json"))
  171. (copy-file (string-append (assoc-ref inputs "mesa")
  172. "/share/vulkan/icd.d/intel_icd.i686.json")
  173. (string-append icd "/intel_icd.i686.json"))
  174. (wrap-program (string-append out "/bin/wine-preloader")
  175. `("VK_ICD_FILENAMES" ":" =
  176. (,(string-append icd
  177. "/radeon_icd.i686.json" ":"
  178. icd "/intel_icd.i686.json"))))
  179. #t)))))
  180. (_
  181. `())
  182. )
  183. (add-after 'configure 'patch-dlopen-paths
  184. ;; Hardcode dlopened sonames to absolute paths.
  185. (lambda _
  186. (let* ((library-path (search-path-as-string->list
  187. (getenv "LIBRARY_PATH")))
  188. (find-so (lambda (soname)
  189. (search-path library-path soname))))
  190. (substitute* "include/config.h"
  191. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  192. (format #f "~a\"~a\"" defso (find-so soname))))
  193. #t))))))
  194. (home-page "https://www.winehq.org/")
  195. (synopsis "Implementation of the Windows API (32-bit only)")
  196. (description
  197. "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
  198. compatibility layer capable of running Windows applications. Instead of
  199. simulating internal Windows logic like a virtual machine or emulator, Wine
  200. translates Windows API calls into POSIX calls on-the-fly, eliminating the
  201. performance and memory penalties of other methods and allowing you to cleanly
  202. integrate Windows applications into your desktop.")
  203. ;; Any platform should be able to build wine, but based on '#:system' these
  204. ;; are thr ones we currently support.
  205. (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
  206. (license license:lgpl2.1+)))
  207. (define-public wine64
  208. (package
  209. (inherit wine)
  210. (name "wine64")
  211. (inputs `(("wine" ,wine)
  212. ,@(package-inputs wine)))
  213. (arguments
  214. `(#:make-flags
  215. (list "SHELL=bash"
  216. (string-append "libdir=" %output "/lib/wine64"))
  217. #:phases
  218. (modify-phases %standard-phases
  219. ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
  220. ;; when installing to x86_64-linux so both are available.
  221. ;; TODO: Add more JSON files as they become available in Mesa.
  222. ,@(match (%current-system)
  223. ((or "x86_64-linux")
  224. `((add-after 'copy-wine32-binaries 'wrap-executable
  225. (lambda* (#:key inputs outputs #:allow-other-keys)
  226. (let* ((out (assoc-ref outputs "out")))
  227. (wrap-program (string-append out "/bin/wine-preloader")
  228. `("VK_ICD_FILENAMES" ":" =
  229. (,(string-append (assoc-ref inputs "mesa")
  230. "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
  231. (assoc-ref inputs "mesa")
  232. "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
  233. (assoc-ref inputs "wine")
  234. "/share/vulkan/icd.d/radeon_icd.i686.json" ":"
  235. (assoc-ref inputs "wine")
  236. "/share/vulkan/icd.d/intel_icd.i686.json"))))
  237. (wrap-program (string-append out "/bin/wine64-preloader")
  238. `("VK_ICD_FILENAMES" ":" =
  239. (,(string-append (assoc-ref inputs "mesa")
  240. "/share/vulkan/icd.d/radeon_icd.x86_64.json"
  241. ":" (assoc-ref inputs "mesa")
  242. "/share/vulkan/icd.d/intel_icd.x86_64.json"
  243. ":" (assoc-ref inputs "wine")
  244. "/share/vulkan/icd.d/radeon_icd.i686.json"
  245. ":" (assoc-ref inputs "wine")
  246. "/share/vulkan/icd.d/intel_icd.i686.json"))))
  247. #t)))))
  248. (_
  249. `())
  250. )
  251. (add-after 'install 'copy-wine32-binaries
  252. (lambda* (#:key outputs #:allow-other-keys)
  253. (let* ((wine32 (assoc-ref %build-inputs "wine"))
  254. (out (assoc-ref %outputs "out")))
  255. ;; Copy the 32-bit binaries needed for WoW64.
  256. (copy-file (string-append wine32 "/bin/wine")
  257. (string-append out "/bin/wine"))
  258. ;; Copy the real 32-bit wine-preloader instead of the wrapped
  259. ;; version.
  260. (copy-file (string-append wine32 "/bin/.wine-preloader-real")
  261. (string-append out "/bin/wine-preloader"))
  262. #t)))
  263. (add-after 'compress-documentation 'copy-wine32-manpage
  264. (lambda* (#:key outputs #:allow-other-keys)
  265. (let* ((wine32 (assoc-ref %build-inputs "wine"))
  266. (out (assoc-ref %outputs "out")))
  267. ;; Copy the missing man file for the wine binary from wine.
  268. (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
  269. (string-append out "/share/man/man1/wine.1.gz"))
  270. #t)))
  271. (add-after 'configure 'patch-dlopen-paths
  272. ;; Hardcode dlopened sonames to absolute paths.
  273. (lambda _
  274. (let* ((library-path (search-path-as-string->list
  275. (getenv "LIBRARY_PATH")))
  276. (find-so (lambda (soname)
  277. (search-path library-path soname))))
  278. (substitute* "include/config.h"
  279. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  280. (format #f "~a\"~a\"" defso (find-so soname))))
  281. #t))))
  282. #:configure-flags
  283. (list "--enable-win64"
  284. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
  285. ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
  286. #:system)
  287. (package-arguments wine))))
  288. (synopsis "Implementation of the Windows API (WoW64 version)")
  289. (supported-systems '("x86_64-linux" "aarch64-linux"))))
  290. ;; This minimal build of Wine is needed to prevent a circular dependency with
  291. ;; vkd3d.
  292. (define-public wine-minimal
  293. (package
  294. (inherit wine)
  295. (name "wine-minimal")
  296. (native-inputs (fold alist-delete (package-native-inputs wine)
  297. '("gettext" "perl" "pkg-config")))
  298. (inputs `())
  299. (arguments
  300. `(#:validate-runpath? #f
  301. #:phases
  302. (modify-phases %standard-phases
  303. (add-after 'configure 'patch-dlopen-paths
  304. ;; Hardcode dlopened sonames to absolute paths.
  305. (lambda _
  306. (let* ((library-path (search-path-as-string->list
  307. (getenv "LIBRARY_PATH")))
  308. (find-so (lambda (soname)
  309. (search-path library-path soname))))
  310. (substitute* "include/config.h"
  311. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  312. (format #f "~a\"~a\"" defso (find-so soname))))
  313. #t))))
  314. #:configure-flags
  315. (list "--without-freetype"
  316. "--without-x")
  317. ,@(strip-keyword-arguments '(#:configure-flags #:phases)
  318. (package-arguments wine))))))
  319. (define-public wine-staging-patchset-data
  320. (package
  321. (name "wine-staging-patchset-data")
  322. (version "5.12.1")
  323. (source
  324. (origin
  325. (method git-fetch)
  326. (uri (git-reference
  327. (url "https://github.com/wine-staging/wine-staging")
  328. (commit (string-append "v" version))))
  329. (file-name (git-file-name name version))
  330. (sha256
  331. (base32 "135ddf4zsxwbi0nhvjpqfvqjrh18f3c6hmhcsbm5mc8zmpjpmzdj"))))
  332. (build-system trivial-build-system)
  333. (native-inputs
  334. `(("bash" ,bash)
  335. ("coreutils" ,coreutils)))
  336. (arguments
  337. `(#:modules ((guix build utils))
  338. #:builder
  339. (begin
  340. (use-modules (guix build utils))
  341. (let* ((build-directory ,(string-append name "-" version))
  342. (source (assoc-ref %build-inputs "source"))
  343. (bash (assoc-ref %build-inputs "bash"))
  344. (coreutils (assoc-ref %build-inputs "coreutils"))
  345. (out (assoc-ref %outputs "out"))
  346. (wine-staging (string-append out "/share/wine-staging")))
  347. (copy-recursively source build-directory)
  348. (with-directory-excursion build-directory
  349. (substitute* "patches/patchinstall.sh"
  350. (("/bin/sh")
  351. (string-append bash "/bin/sh")))
  352. (substitute* "patches/gitapply.sh"
  353. (("/usr/bin/env")
  354. (string-append coreutils "/bin/env"))))
  355. (copy-recursively build-directory wine-staging)
  356. #t))))
  357. (home-page "https://github.com/wine-staging")
  358. (synopsis "Patchset for Wine")
  359. (description
  360. "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
  361. (license license:lgpl2.1+)))
  362. (define-public wine-staging
  363. (package
  364. (inherit wine)
  365. (name "wine-staging")
  366. (version (package-version wine-staging-patchset-data))
  367. (source
  368. (let* ((wine-version (version-major+minor version))
  369. (subdirectory (string-append
  370. (version-major version)
  371. (if (string-suffix? ".0" wine-version)
  372. ".0"
  373. ".x"))))
  374. (origin
  375. (method url-fetch)
  376. (uri (string-append "https://dl.winehq.org/wine/source/"
  377. subdirectory "/"
  378. "wine-" wine-version ".tar.xz"))
  379. (file-name (string-append name "-" wine-version ".tar.xz"))
  380. (sha256
  381. (base32 "0bl4ii4h1w4z8kb6dpdc1pgwk0wrhm61c2q2nzpcckkrqra75wc7")))))
  382. (inputs `(("autoconf" ,autoconf) ; for autoreconf
  383. ("ffmpeg" ,ffmpeg)
  384. ("gtk+" ,gtk+)
  385. ("libva" ,libva)
  386. ("mesa" ,mesa)
  387. ("python" ,python)
  388. ("util-linux" ,util-linux) ; for hexdump
  389. ("wine-staging-patchset-data" ,wine-staging-patchset-data)
  390. ,@(package-inputs wine)))
  391. (arguments
  392. `(#:phases
  393. (modify-phases %standard-phases
  394. ;; Explicitly set the 32-bit version of vulkan-loader when installing
  395. ;; to i686-linux or x86_64-linux.
  396. ;; TODO: Add more JSON files as they become available in Mesa.
  397. ,@(match (%current-system)
  398. ((or "i686-linux" "x86_64-linux")
  399. `((add-after 'install 'wrap-executable
  400. (lambda* (#:key inputs outputs #:allow-other-keys)
  401. (let* ((out (assoc-ref outputs "out"))
  402. (icd (string-append out "/share/vulkan/icd.d")))
  403. (mkdir-p icd)
  404. (copy-file (string-append (assoc-ref inputs "mesa")
  405. "/share/vulkan/icd.d/radeon_icd.i686.json")
  406. (string-append icd "/radeon_icd.i686.json"))
  407. (copy-file (string-append (assoc-ref inputs "mesa")
  408. "/share/vulkan/icd.d/intel_icd.i686.json")
  409. (string-append icd "/intel_icd.i686.json"))
  410. (wrap-program (string-append out "/bin/wine-preloader")
  411. `("VK_ICD_FILENAMES" ":" =
  412. (,(string-append icd
  413. "/radeon_icd.i686.json" ":"
  414. icd "/intel_icd.i686.json"))))
  415. #t)))))
  416. (_
  417. `())
  418. )
  419. (add-before 'configure 'patch-source-wine-staging
  420. (lambda* (#:key outputs #:allow-other-keys)
  421. (let* ((source (assoc-ref %build-inputs "source"))
  422. (script (string-append (assoc-ref %build-inputs
  423. "wine-staging-patchset-data")
  424. "/share/wine-staging/patches/patchinstall.sh")))
  425. (invoke script (string-append "DESTDIR=" ".") "--all")
  426. #t)))
  427. (add-after 'configure 'patch-dlopen-paths
  428. ;; Hardcode dlopened sonames to absolute paths.
  429. (lambda _
  430. (let* ((library-path (search-path-as-string->list
  431. (getenv "LIBRARY_PATH")))
  432. (find-so (lambda (soname)
  433. (search-path library-path soname))))
  434. (substitute* "include/config.h"
  435. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  436. (format #f "~a\"~a\"" defso (find-so soname))))
  437. #t))))
  438. ,@(strip-keyword-arguments '(#:phases)
  439. (package-arguments wine))))
  440. (synopsis "Implementation of the Windows API (staging branch, 32-bit only)")
  441. (description "Wine-Staging is the testing area of Wine. It
  442. contains bug fixes and features, which have not been integrated into
  443. the development branch yet. The idea of Wine-Staging is to provide
  444. experimental features faster to end users and to give developers the
  445. possibility to discuss and improve their patches before they are
  446. integrated into the main branch.")
  447. (home-page "https://github.com/wine-staging")
  448. ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging
  449. ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use
  450. ;; different licenses. In particular, the latter is licensed under
  451. ;; both GPL3+ and Apache 2 License.
  452. (license
  453. (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
  454. (define-public wine64-staging
  455. (package
  456. (inherit wine-staging)
  457. (name "wine64-staging")
  458. (inputs `(("wine-staging" ,wine-staging)
  459. ,@(package-inputs wine-staging)))
  460. (arguments
  461. `(#:make-flags
  462. (list "SHELL=bash"
  463. (string-append "libdir=" %output "/lib/wine64"))
  464. #:phases
  465. (modify-phases %standard-phases
  466. ;; Explicitly set both the 64-bit and 32-bit versions of vulkan-loader
  467. ;; when installing to x86_64-linux so both are available.
  468. ;; TODO: Add more JSON files as they become available in Mesa.
  469. ,@(match (%current-system)
  470. ((or "x86_64-linux")
  471. `((add-after 'copy-wine32-binaries 'wrap-executable
  472. (lambda* (#:key inputs outputs #:allow-other-keys)
  473. (let* ((out (assoc-ref outputs "out")))
  474. (wrap-program (string-append out "/bin/wine-preloader")
  475. `("VK_ICD_FILENAMES" ":" =
  476. (,(string-append (assoc-ref inputs "mesa")
  477. "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
  478. (assoc-ref inputs "mesa")
  479. "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
  480. (assoc-ref inputs "wine-staging")
  481. "/share/vulkan/icd.d/radeon_icd.i686.json" ":"
  482. (assoc-ref inputs "wine-staging")
  483. "/share/vulkan/icd.d/intel_icd.i686.json"))))
  484. (wrap-program (string-append out "/bin/wine64-preloader")
  485. `("VK_ICD_FILENAMES" ":" =
  486. (,(string-append (assoc-ref inputs "mesa")
  487. "/share/vulkan/icd.d/radeon_icd.x86_64.json"
  488. ":" (assoc-ref inputs "mesa")
  489. "/share/vulkan/icd.d/intel_icd.x86_64.json"
  490. ":" (assoc-ref inputs "wine-staging")
  491. "/share/vulkan/icd.d/radeon_icd.i686.json"
  492. ":" (assoc-ref inputs "wine-staging")
  493. "/share/vulkan/icd.d/intel_icd.i686.json"))))
  494. #t)))))
  495. (_
  496. `())
  497. )
  498. (add-before 'configure 'patch-source-wine-staging
  499. (lambda* (#:key outputs #:allow-other-keys)
  500. (let* ((source (assoc-ref %build-inputs "source"))
  501. (script (string-append (assoc-ref %build-inputs
  502. "wine-staging-patchset-data")
  503. "/share/wine-staging/patches/patchinstall.sh")))
  504. (invoke script (string-append "DESTDIR=" ".") "--all")
  505. #t)))
  506. (add-after 'install 'copy-wine32-binaries
  507. (lambda* (#:key outputs #:allow-other-keys)
  508. (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
  509. (out (assoc-ref %outputs "out")))
  510. ;; Copy the 32-bit binaries needed for WoW64.
  511. (copy-file (string-append wine32 "/bin/wine")
  512. (string-append out "/bin/wine"))
  513. ;; Copy the real 32-bit wine-preloader instead of the wrapped
  514. ;; version.
  515. (copy-file (string-append wine32 "/bin/.wine-preloader-real")
  516. (string-append out "/bin/wine-preloader"))
  517. #t)))
  518. (add-after 'compress-documentation 'copy-wine32-manpage
  519. (lambda* (#:key outputs #:allow-other-keys)
  520. (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
  521. (out (assoc-ref %outputs "out")))
  522. ;; Copy the missing man file for the wine binary from
  523. ;; wine-staging.
  524. (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
  525. (string-append out "/share/man/man1/wine.1.gz"))
  526. #t)))
  527. (add-after 'configure 'patch-dlopen-paths
  528. ;; Hardcode dlopened sonames to absolute paths.
  529. (lambda _
  530. (let* ((library-path (search-path-as-string->list
  531. (getenv "LIBRARY_PATH")))
  532. (find-so (lambda (soname)
  533. (search-path library-path soname))))
  534. (substitute* "include/config.h"
  535. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  536. (format #f "~a\"~a\"" defso (find-so soname))))
  537. #t))))
  538. #:configure-flags
  539. (list "--enable-win64"
  540. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
  541. ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
  542. #:system)
  543. (package-arguments wine-staging))))
  544. (synopsis "Implementation of the Windows API (staging branch, WoW64
  545. version)")
  546. (supported-systems '("x86_64-linux" "aarch64-linux"))))
  547. (define dxvk32
  548. ;; This package provides 32-bit dxvk libraries on 64-bit systems.
  549. (package
  550. (name "dxvk32")
  551. (version "1.5.5")
  552. (home-page "https://github.com/doitsujin/dxvk/")
  553. (source (origin
  554. (method git-fetch)
  555. (uri (git-reference
  556. (url home-page)
  557. (commit (string-append "v" version))))
  558. (file-name (git-file-name name version))
  559. (sha256
  560. (base32
  561. "1inl0qswgvbp0fs76md86ilqf9mbshkpjm8ga81khn9zd6v3fvan"))))
  562. (build-system meson-build-system)
  563. (arguments
  564. `(#:system "i686-linux"
  565. #:configure-flags (list "--cross-file"
  566. (string-append (assoc-ref %build-inputs "source")
  567. "/build-wine32.txt"))))
  568. (native-inputs
  569. ;; Since 1.5 dxvk needs gcc-8.1. See
  570. ;; https://github.com/doitsujin/dxvk/issues/1292#issuecomment-567067373.
  571. `(("gcc" ,gcc-9)
  572. ("glslang" ,glslang)))
  573. (inputs
  574. `(("wine" ,wine-staging)))
  575. (synopsis "Vulkan-based D3D9, D3D10 and D3D11 implementation for Wine")
  576. (description "A Vulkan-based translation layer for Direct3D 9/10/11 which
  577. allows running complex 3D applications with high performance using Wine.
  578. Use @command{setup_dxvk} to install the required libraries to a Wine prefix.")
  579. (supported-systems '("x86_64-linux"))
  580. (license license:zlib)))
  581. (define-public dxvk
  582. (package
  583. (inherit dxvk32)
  584. (name "dxvk")
  585. (arguments
  586. `(#:configure-flags (list "--cross-file"
  587. (string-append (assoc-ref %build-inputs "source")
  588. "/build-wine"
  589. ,(match (%current-system)
  590. ("x86_64-linux" "64")
  591. (_ "32"))
  592. ".txt"))
  593. #:phases
  594. (modify-phases %standard-phases
  595. ,@(if (string=? (%current-system) "x86_64-linux")
  596. `((add-after 'unpack 'install-32
  597. (lambda* (#:key inputs outputs #:allow-other-keys)
  598. (let* ((out (assoc-ref outputs "out"))
  599. (dxvk32 (assoc-ref inputs "dxvk32")))
  600. (mkdir-p (string-append out "/lib32"))
  601. (copy-recursively (string-append dxvk32 "/lib")
  602. (string-append out "/lib32"))
  603. #t))))
  604. '())
  605. (add-after 'install 'install-setup
  606. (lambda* (#:key inputs outputs #:allow-other-keys)
  607. (let* ((out (assoc-ref outputs "out"))
  608. (bin (string-append out "/bin/setup_dxvk")))
  609. (mkdir-p (string-append out "/bin"))
  610. (copy-file "../source/setup_dxvk.sh"
  611. bin)
  612. (chmod bin #o755)
  613. (substitute* bin
  614. (("wine=\"wine\"")
  615. (string-append "wine=" (assoc-ref inputs "wine") "/bin/wine"))
  616. (("x32") ,(match (%current-system)
  617. ("x86_64-linux" "../lib32")
  618. (_ "../lib")))
  619. (("x64") "../lib"))))))))
  620. (inputs
  621. `(("wine" ,(match (%current-system)
  622. ;; ("x86_64-linux" wine64)
  623. ("x86_64-linux" wine64-staging)
  624. ;; ("x86_64-linux" mingw-w64-x86_64)
  625. (_ wine)))
  626. ,@(match (%current-system)
  627. ("x86_64-linux"
  628. `(("dxvk32" ,dxvk32)))
  629. (_ '()))))
  630. (supported-systems '("i686-linux" "x86_64-linux"))))