wine.scm 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  7. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; 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 git-download)
  28. #:use-module (guix utils)
  29. #:use-module (guix build-system gnu)
  30. #:use-module (guix build-system trivial)
  31. #:use-module (gnu packages)
  32. #:use-module (gnu packages admin)
  33. #:use-module (gnu packages audio)
  34. #:use-module (gnu packages autotools)
  35. #:use-module (gnu packages base)
  36. #:use-module (gnu packages bash)
  37. #:use-module (gnu packages bison)
  38. #:use-module (gnu packages compression)
  39. #:use-module (gnu packages cups)
  40. #:use-module (gnu packages databases)
  41. #:use-module (gnu packages fontutils)
  42. #:use-module (gnu packages flex)
  43. #:use-module (gnu packages image)
  44. #:use-module (gnu packages gettext)
  45. #:use-module (gnu packages ghostscript)
  46. #:use-module (gnu packages gl)
  47. #:use-module (gnu packages glib)
  48. #:use-module (gnu packages gstreamer)
  49. #:use-module (gnu packages gtk)
  50. #:use-module (gnu packages kerberos)
  51. #:use-module (gnu packages linux)
  52. #:use-module (gnu packages openldap)
  53. #:use-module (gnu packages perl)
  54. #:use-module (gnu packages pulseaudio)
  55. #:use-module (gnu packages pkg-config)
  56. #:use-module (gnu packages python)
  57. #:use-module (gnu packages mp3)
  58. #:use-module (gnu packages ncurses)
  59. #:use-module (gnu packages photo)
  60. #:use-module (gnu packages samba)
  61. #:use-module (gnu packages scanner)
  62. #:use-module (gnu packages sdl)
  63. #:use-module (gnu packages tls)
  64. #:use-module (gnu packages video)
  65. #:use-module (gnu packages vulkan)
  66. #:use-module (gnu packages xml)
  67. #:use-module (gnu packages xorg)
  68. #:use-module (ice-9 match)
  69. #:use-module (srfi srfi-1))
  70. (define-public wine
  71. (package
  72. (name "wine")
  73. (version "4.0")
  74. (source (origin
  75. (method url-fetch)
  76. (uri (string-append "https://dl.winehq.org/wine/source/"
  77. (version-major+minor version)
  78. "/wine-" version ".tar.xz"))
  79. (sha256
  80. (base32
  81. "0k8d90mgjzv8vjspmnxzr3i5mbccxnbr9hf03q1bpf5jjppcsdk7"))))
  82. (build-system gnu-build-system)
  83. (native-inputs `(("pkg-config" ,pkg-config)
  84. ("gettext" ,gettext-minimal)
  85. ("flex" ,flex)
  86. ("bison" ,bison)
  87. ("perl" ,perl)))
  88. (inputs
  89. `(("alsa-lib" ,alsa-lib)
  90. ("dbus" ,dbus)
  91. ("cups" ,cups)
  92. ("eudev" ,eudev)
  93. ("fontconfig" ,fontconfig)
  94. ("freetype" ,freetype)
  95. ("glu" ,glu)
  96. ("gnutls" ,gnutls)
  97. ("gst-plugins-base" ,gst-plugins-base)
  98. ("lcms" ,lcms)
  99. ("libxml2" ,libxml2)
  100. ("libxslt" ,libxslt)
  101. ("libgphoto2" ,libgphoto2)
  102. ("libmpg123" ,mpg123)
  103. ("libldap" ,openldap)
  104. ("libnetapi" ,samba)
  105. ("libsane" ,sane-backends)
  106. ("libpcap" ,libpcap)
  107. ("libpng" ,libpng)
  108. ("libjpeg" ,libjpeg)
  109. ("libtiff" ,libtiff)
  110. ("libICE" ,libice)
  111. ("libX11" ,libx11)
  112. ("libXi" ,libxi)
  113. ("libXext" ,libxext)
  114. ("libXcursor" ,libxcursor)
  115. ("libXrender" ,libxrender)
  116. ("libXrandr" ,libxrandr)
  117. ("libXinerama" ,libxinerama)
  118. ("libXxf86vm" ,libxxf86vm)
  119. ("libXcomposite" ,libxcomposite)
  120. ("mit-krb5" ,mit-krb5)
  121. ("ncurses" ,ncurses)
  122. ("openal" ,openal)
  123. ("pulseaudio" ,pulseaudio)
  124. ("sdl2" ,sdl2)
  125. ("unixodbc" ,unixodbc)
  126. ("v4l-utils" ,v4l-utils)
  127. ("vkd3d" ,vkd3d)
  128. ("vulkan-loader" ,vulkan-loader)
  129. ("zlib" ,zlib)))
  130. (arguments
  131. `(;; Force a 32-bit build targeting a similar architecture, i.e.:
  132. ;; armhf for armhf/aarch64, i686 for i686/x86_64.
  133. #:system ,@(match (%current-system)
  134. ((or "armhf-linux" "aarch64-linux")
  135. `("armhf-linux"))
  136. (_
  137. `("i686-linux")))
  138. ;; XXX: There's a test suite, but it's unclear whether it's supposed to
  139. ;; pass.
  140. #:tests? #f
  141. #:configure-flags
  142. (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine32"))
  143. #:make-flags
  144. (list "SHELL=bash"
  145. (string-append "libdir=" %output "/lib/wine32"))
  146. #:phases
  147. (modify-phases %standard-phases
  148. ;; Explicitely set the 32-bit version of vulkan-loader when installing
  149. ;; to i686-linux or x86_64-linux.
  150. ;; TODO: Add more JSON files as they become available in Mesa.
  151. ,@(match (%current-system)
  152. ((or "i686-linux" "x86_64-linux")
  153. `((add-after 'install 'wrap-executable
  154. (lambda* (#:key inputs outputs #:allow-other-keys)
  155. (let* ((out (assoc-ref outputs "out"))
  156. (icd (string-append out "/share/vulkan/icd.d")))
  157. (mkdir-p icd)
  158. (copy-file (string-append (assoc-ref inputs "mesa")
  159. "/share/vulkan/icd.d/radeon_icd.i686.json")
  160. (string-append icd "/radeon_icd.i686.json"))
  161. (wrap-program (string-append out "/bin/wine-preloader")
  162. `("VK_ICD_FILENAMES" ":" =
  163. (,(string-append icd
  164. "/radeon_icd.i686.json"))))
  165. #t)))))
  166. (_
  167. `())
  168. )
  169. (add-after 'configure 'patch-dlopen-paths
  170. ;; Hardcode dlopened sonames to absolute paths.
  171. (lambda _
  172. (let* ((library-path (search-path-as-string->list
  173. (getenv "LIBRARY_PATH")))
  174. (find-so (lambda (soname)
  175. (search-path library-path soname))))
  176. (substitute* "include/config.h"
  177. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  178. (format #f "~a\"~a\"" defso (find-so soname))))
  179. #t))))))
  180. (home-page "https://www.winehq.org/")
  181. (synopsis "Implementation of the Windows API (32-bit only)")
  182. (description
  183. "Wine (originally an acronym for \"Wine Is Not an Emulator\") is a
  184. compatibility layer capable of running Windows applications. Instead of
  185. simulating internal Windows logic like a virtual machine or emulator, Wine
  186. translates Windows API calls into POSIX calls on-the-fly, eliminating the
  187. performance and memory penalties of other methods and allowing you to cleanly
  188. integrate Windows applications into your desktop.")
  189. ;; Any platform should be able to build wine, but based on '#:system' these
  190. ;; are thr ones we currently support.
  191. (supported-systems '("i686-linux" "x86_64-linux" "armhf-linux"))
  192. (license license:lgpl2.1+)))
  193. (define-public wine64
  194. (package
  195. (inherit wine)
  196. (name "wine64")
  197. (inputs `(("wine" ,wine)
  198. ,@(package-inputs wine)))
  199. (arguments
  200. `(#:make-flags
  201. (list "SHELL=bash"
  202. (string-append "libdir=" %output "/lib/wine64"))
  203. #:phases
  204. (modify-phases %standard-phases
  205. ;; Explicitely set both the 64-bit and 32-bit versions of vulkan-loader
  206. ;; when installing to x86_64-linux so both are available.
  207. ;; TODO: Add more JSON files as they become available in Mesa.
  208. ,@(match (%current-system)
  209. ((or "x86_64-linux")
  210. `((add-after 'copy-wine32-binaries 'wrap-executable
  211. (lambda* (#:key inputs outputs #:allow-other-keys)
  212. (let* ((out (assoc-ref outputs "out")))
  213. (wrap-program (string-append out "/bin/wine-preloader")
  214. `("VK_ICD_FILENAMES" ":" =
  215. (,(string-append (assoc-ref inputs "mesa")
  216. "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
  217. (assoc-ref inputs "mesa")
  218. "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
  219. (assoc-ref inputs "wine")
  220. "/share/vulkan/icd.d/radeon_icd.i686.json"))))
  221. (wrap-program (string-append out "/bin/wine64-preloader")
  222. `("VK_ICD_FILENAMES" ":" =
  223. (,(string-append (assoc-ref inputs "mesa")
  224. "/share/vulkan/icd.d/radeon_icd.x86_64.json"
  225. ":" (assoc-ref inputs "mesa")
  226. "/share/vulkan/icd.d/intel_icd.x86_64.json"
  227. ":" (assoc-ref inputs "wine")
  228. "/share/vulkan/icd.d/radeon_icd.i686.json"))))
  229. #t)))))
  230. (_
  231. `())
  232. )
  233. (add-after 'install 'copy-wine32-binaries
  234. (lambda* (#:key outputs #:allow-other-keys)
  235. (let* ((wine32 (assoc-ref %build-inputs "wine"))
  236. (out (assoc-ref %outputs "out")))
  237. ;; Copy the 32-bit binaries needed for WoW64.
  238. (copy-file (string-append wine32 "/bin/wine")
  239. (string-append out "/bin/wine"))
  240. ;; Copy the real 32-bit wine-preloader instead of the wrapped
  241. ;; version.
  242. (copy-file (string-append wine32 "/bin/.wine-preloader-real")
  243. (string-append out "/bin/wine-preloader"))
  244. #t)))
  245. (add-after 'compress-documentation 'copy-wine32-manpage
  246. (lambda* (#:key outputs #:allow-other-keys)
  247. (let* ((wine32 (assoc-ref %build-inputs "wine"))
  248. (out (assoc-ref %outputs "out")))
  249. ;; Copy the missing man file for the wine binary from wine.
  250. (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
  251. (string-append out "/share/man/man1/wine.1.gz"))
  252. #t)))
  253. (add-after 'configure 'patch-dlopen-paths
  254. ;; Hardcode dlopened sonames to absolute paths.
  255. (lambda _
  256. (let* ((library-path (search-path-as-string->list
  257. (getenv "LIBRARY_PATH")))
  258. (find-so (lambda (soname)
  259. (search-path library-path soname))))
  260. (substitute* "include/config.h"
  261. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  262. (format #f "~a\"~a\"" defso (find-so soname))))
  263. #t))))
  264. #:configure-flags
  265. (list "--enable-win64"
  266. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
  267. ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
  268. #:system)
  269. (package-arguments wine))))
  270. (synopsis "Implementation of the Windows API (WoW64 version)")
  271. (supported-systems '("x86_64-linux" "aarch64-linux"))))
  272. ;; This minimal build of Wine is needed to prevent a circular dependency with
  273. ;; vkd3d.
  274. (define-public wine-minimal
  275. (package
  276. (inherit wine)
  277. (name "wine-minimal")
  278. (native-inputs (fold alist-delete (package-native-inputs wine)
  279. '("gettext" "perl" "pkg-config")))
  280. (inputs `())
  281. (arguments
  282. `(#:validate-runpath? #f
  283. #:phases
  284. (modify-phases %standard-phases
  285. (add-after 'configure 'patch-dlopen-paths
  286. ;; Hardcode dlopened sonames to absolute paths.
  287. (lambda _
  288. (let* ((library-path (search-path-as-string->list
  289. (getenv "LIBRARY_PATH")))
  290. (find-so (lambda (soname)
  291. (search-path library-path soname))))
  292. (substitute* "include/config.h"
  293. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  294. (format #f "~a\"~a\"" defso (find-so soname))))
  295. #t))))
  296. #:configure-flags
  297. (list "--without-freetype"
  298. "--without-x")
  299. ,@(strip-keyword-arguments '(#:configure-flags #:phases)
  300. (package-arguments wine))))))
  301. (define-public wine-staging-patchset-data
  302. (package
  303. (name "wine-staging-patchset-data")
  304. (version "4.2")
  305. (source
  306. (origin
  307. (method git-fetch)
  308. (uri (git-reference
  309. (url "https://github.com/wine-staging/wine-staging")
  310. (commit (string-append "v" version))))
  311. (file-name (git-file-name name version))
  312. (sha256
  313. (base32
  314. "1dhv6y60g64bj3kgfknbfzxfzmy686dh7svxlvi4lfis2faikxmk"))))
  315. (build-system trivial-build-system)
  316. (native-inputs
  317. `(("bash" ,bash)
  318. ("coreutils" ,coreutils)))
  319. (arguments
  320. `(#:modules ((guix build utils))
  321. #:builder
  322. (begin
  323. (use-modules (guix build utils))
  324. (let* ((build-directory ,(string-append name "-" version))
  325. (source (assoc-ref %build-inputs "source"))
  326. (bash (assoc-ref %build-inputs "bash"))
  327. (coreutils (assoc-ref %build-inputs "coreutils"))
  328. (out (assoc-ref %outputs "out"))
  329. (wine-staging (string-append out "/share/wine-staging")))
  330. (copy-recursively source build-directory)
  331. (with-directory-excursion build-directory
  332. (substitute* "patches/patchinstall.sh"
  333. (("/bin/sh")
  334. (string-append bash "/bin/sh")))
  335. (substitute* "patches/gitapply.sh"
  336. (("/usr/bin/env")
  337. (string-append coreutils "/bin/env"))))
  338. (copy-recursively build-directory wine-staging)
  339. #t))))
  340. (home-page "https://github.com/wine-staging")
  341. (synopsis "Patchset for Wine")
  342. (description
  343. "wine-staging-patchset-data contains the patchset to build Wine-Staging.")
  344. (license license:lgpl2.1+)))
  345. (define-public wine-staging
  346. (package
  347. (inherit wine)
  348. (name "wine-staging")
  349. (version (package-version wine-staging-patchset-data))
  350. (source (origin
  351. (method url-fetch)
  352. (uri (string-append
  353. "https://dl.winehq.org/wine/source/"
  354. (version-major version) ".x"
  355. "/wine-" version ".tar.xz"))
  356. (file-name (string-append name "-" version ".tar.xz"))
  357. (sha256
  358. (base32
  359. "1ysvq2jyvh7r27iwpsrlrwzj672jnrihry91bx3m3fysz3sl3ld1"))))
  360. (inputs `(("autoconf" ,autoconf) ; for autoreconf
  361. ("ffmpeg" ,ffmpeg)
  362. ("gtk+" ,gtk+)
  363. ("libva" ,libva)
  364. ("mesa" ,mesa)
  365. ("python" ,python)
  366. ("util-linux" ,util-linux) ; for hexdump
  367. ("wine-staging-patchset-data" ,wine-staging-patchset-data)
  368. ,@(package-inputs wine)))
  369. (arguments
  370. `(#:phases
  371. (modify-phases %standard-phases
  372. ;; Explicitely set the 32-bit version of vulkan-loader when installing
  373. ;; to i686-linux or x86_64-linux.
  374. ;; TODO: Add more JSON files as they become available in Mesa.
  375. ,@(match (%current-system)
  376. ((or "i686-linux" "x86_64-linux")
  377. `((add-after 'install 'wrap-executable
  378. (lambda* (#:key inputs outputs #:allow-other-keys)
  379. (let* ((out (assoc-ref outputs "out"))
  380. (icd (string-append out "/share/vulkan/icd.d")))
  381. (mkdir-p icd)
  382. (copy-file (string-append (assoc-ref inputs "mesa")
  383. "/share/vulkan/icd.d/radeon_icd.i686.json")
  384. (string-append icd "/radeon_icd.i686.json"))
  385. (wrap-program (string-append out "/bin/wine-preloader")
  386. `("VK_ICD_FILENAMES" ":" =
  387. (,(string-append icd
  388. "/radeon_icd.i686.json"))))
  389. #t)))))
  390. (_
  391. `())
  392. )
  393. (add-before 'configure 'patch-source-wine-staging
  394. (lambda* (#:key outputs #:allow-other-keys)
  395. (let* ((source (assoc-ref %build-inputs "source"))
  396. (script (string-append (assoc-ref %build-inputs
  397. "wine-staging-patchset-data")
  398. "/share/wine-staging/patches/patchinstall.sh")))
  399. (invoke script (string-append "DESTDIR=" ".") "--all")
  400. #t)))
  401. (add-after 'configure 'patch-dlopen-paths
  402. ;; Hardcode dlopened sonames to absolute paths.
  403. (lambda _
  404. (let* ((library-path (search-path-as-string->list
  405. (getenv "LIBRARY_PATH")))
  406. (find-so (lambda (soname)
  407. (search-path library-path soname))))
  408. (substitute* "include/config.h"
  409. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  410. (format #f "~a\"~a\"" defso (find-so soname))))
  411. #t))))
  412. ,@(strip-keyword-arguments '(#:phases)
  413. (package-arguments wine))))
  414. (synopsis "Implementation of the Windows API (staging branch, 32-bit only)")
  415. (description "Wine-Staging is the testing area of Wine. It
  416. contains bug fixes and features, which have not been integrated into
  417. the development branch yet. The idea of Wine-Staging is to provide
  418. experimental features faster to end users and to give developers the
  419. possibility to discuss and improve their patches before they are
  420. integrated into the main branch.")
  421. (home-page "https://github.com/wine-staging")
  422. ;; In addition to the regular Wine license (lgpl2.1+), Wine-Staging
  423. ;; provides Liberation and WenQuanYi Micro Hei fonts. Those use
  424. ;; different licenses. In particular, the latter is licensed under
  425. ;; both GPL3+ and Apache 2 License.
  426. (license
  427. (list license:lgpl2.1+ license:silofl1.1 license:gpl3+ license:asl2.0))))
  428. (define-public wine64-staging
  429. (package
  430. (inherit wine-staging)
  431. (name "wine64-staging")
  432. (inputs `(("wine-staging" ,wine-staging)
  433. ,@(package-inputs wine-staging)))
  434. (arguments
  435. `(#:make-flags
  436. (list "SHELL=bash"
  437. (string-append "libdir=" %output "/lib/wine64"))
  438. #:phases
  439. (modify-phases %standard-phases
  440. ;; Explicitely set both the 64-bit and 32-bit versions of vulkan-loader
  441. ;; when installing to x86_64-linux so both are available.
  442. ;; TODO: Add more JSON files as they become available in Mesa.
  443. ,@(match (%current-system)
  444. ((or "x86_64-linux")
  445. `((add-after 'copy-wine32-binaries 'wrap-executable
  446. (lambda* (#:key inputs outputs #:allow-other-keys)
  447. (let* ((out (assoc-ref outputs "out")))
  448. (wrap-program (string-append out "/bin/wine-preloader")
  449. `("VK_ICD_FILENAMES" ":" =
  450. (,(string-append (assoc-ref inputs "mesa")
  451. "/share/vulkan/icd.d/radeon_icd.x86_64.json" ":"
  452. (assoc-ref inputs "mesa")
  453. "/share/vulkan/icd.d/intel_icd.x86_64.json" ":"
  454. (assoc-ref inputs "wine-staging")
  455. "/share/vulkan/icd.d/radeon_icd.i686.json"))))
  456. (wrap-program (string-append out "/bin/wine64-preloader")
  457. `("VK_ICD_FILENAMES" ":" =
  458. (,(string-append (assoc-ref inputs "mesa")
  459. "/share/vulkan/icd.d/radeon_icd.x86_64.json"
  460. ":" (assoc-ref inputs "mesa")
  461. "/share/vulkan/icd.d/intel_icd.x86_64.json"
  462. ":" (assoc-ref inputs "wine-staging")
  463. "/share/vulkan/icd.d/radeon_icd.i686.json"))))
  464. #t)))))
  465. (_
  466. `())
  467. )
  468. (add-before 'configure 'patch-source-wine-staging
  469. (lambda* (#:key outputs #:allow-other-keys)
  470. (let* ((source (assoc-ref %build-inputs "source"))
  471. (script (string-append (assoc-ref %build-inputs
  472. "wine-staging-patchset-data")
  473. "/share/wine-staging/patches/patchinstall.sh")))
  474. (invoke script (string-append "DESTDIR=" ".") "--all")
  475. #t)))
  476. (add-after 'install 'copy-wine32-binaries
  477. (lambda* (#:key outputs #:allow-other-keys)
  478. (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
  479. (out (assoc-ref %outputs "out")))
  480. ;; Copy the 32-bit binaries needed for WoW64.
  481. (copy-file (string-append wine32 "/bin/wine")
  482. (string-append out "/bin/wine"))
  483. ;; Copy the real 32-bit wine-preloader instead of the wrapped
  484. ;; version.
  485. (copy-file (string-append wine32 "/bin/.wine-preloader-real")
  486. (string-append out "/bin/wine-preloader"))
  487. #t)))
  488. (add-after 'compress-documentation 'copy-wine32-manpage
  489. (lambda* (#:key outputs #:allow-other-keys)
  490. (let* ((wine32 (assoc-ref %build-inputs "wine-staging"))
  491. (out (assoc-ref %outputs "out")))
  492. ;; Copy the missing man file for the wine binary from
  493. ;; wine-staging.
  494. (copy-file (string-append wine32 "/share/man/man1/wine.1.gz")
  495. (string-append out "/share/man/man1/wine.1.gz"))
  496. #t)))
  497. (add-after 'configure 'patch-dlopen-paths
  498. ;; Hardcode dlopened sonames to absolute paths.
  499. (lambda _
  500. (let* ((library-path (search-path-as-string->list
  501. (getenv "LIBRARY_PATH")))
  502. (find-so (lambda (soname)
  503. (search-path library-path soname))))
  504. (substitute* "include/config.h"
  505. (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
  506. (format #f "~a\"~a\"" defso (find-so soname))))
  507. #t))))
  508. #:configure-flags
  509. (list "--enable-win64"
  510. (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib/wine64"))
  511. ,@(strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
  512. #:system)
  513. (package-arguments wine-staging))))
  514. (synopsis "Implementation of the Windows API (staging branch, WoW64
  515. version)")
  516. (supported-systems '("x86_64-linux" "aarch64-linux"))))