wine.scm 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
  3. ;;;
  4. ;;; This file is not part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (nongnu packages wine)
  19. #:use-module ((guix licenses) :prefix license:)
  20. #:use-module (guix packages)
  21. #:use-module (guix build-system gnu)
  22. #:use-module (guix build-system trivial)
  23. #:use-module (guix download)
  24. #:use-module (guix git-download)
  25. #:use-module (gnu packages base)
  26. #:use-module (gnu packages bash)
  27. #:use-module (gnu packages wget)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages gnome)
  30. #:use-module (gnu packages wine))
  31. (define-public winetricks
  32. (package
  33. (name "winetricks")
  34. (version "20181203")
  35. (source (origin
  36. (method git-fetch)
  37. (uri (git-reference
  38. (url "https://github.com/Winetricks/winetricks")
  39. (commit version)))
  40. (file-name (git-file-name name version))
  41. (sha256
  42. (base32
  43. "1as5h5xibpplm619b1i73g974p96q2jnd7fqm28xj3zkqy7qjdm3"))))
  44. (build-system gnu-build-system)
  45. (inputs
  46. `(("wget" ,wget)
  47. ("cabextract" ,cabextract)
  48. ("p7zip" ,p7zip)
  49. ("unzip" ,unzip)
  50. ;; ("unrar" ,unrar) ; TODO: Include unrar? It is referenced in the source.
  51. ("zenity" ,zenity)))
  52. (arguments
  53. `(#:tests? #f
  54. ;; TODO: Checks need bashate, shellcheck (in Guix), and checkbashisms.
  55. #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
  56. "PREFIX=")
  57. #:phases
  58. (modify-phases %standard-phases
  59. (delete 'configure)
  60. (add-after 'unpack 'patch-zenity-path
  61. (lambda* (#:key inputs #:allow-other-keys)
  62. (let* ((zenity (assoc-ref inputs "zenity"))
  63. (zenity-bin (string-append zenity "/bin/zenity")))
  64. (substitute* "src/winetricks"
  65. ;; TODO: There might need more command substitution needed, e.g. wget, 7z, etc.
  66. ;; TODO: Add coreutils to the input?
  67. (("command -v zenity") (string-append "command -v " zenity-bin))
  68. (("WINETRICKS_GUI=zenity") (string-append "WINETRICKS_GUI=" zenity-bin))
  69. (("WINETRICKS_GUI_VERSION=\"\\$\\(zenity") (string-append "WINETRICKS_GUI_VERSION=\"$(" zenity-bin)))))))))
  70. (home-page "https://github.com/Winetricks/winetricks")
  71. (synopsis "Easy way to work around problems in Wine")
  72. (description "Winetricks is an easy way to work around problems in Wine.
  73. It has a menu of supported games/apps for which it can do all the workarounds
  74. automatically. It also allows the installation of missing nonfree DLLs and
  75. tweaking of various Wine settings.")
  76. (license license:lgpl2.1)))
  77. ;; TODO: We could package from source and distribute in upstream Guix.
  78. ;; See bug #35031.
  79. (define-public dxvk
  80. (package
  81. (name "dxvk")
  82. (version "1.2.1")
  83. (source (origin
  84. (method url-fetch)
  85. (uri (string-append "https://github.com/doitsujin/dxvk/releases/download/v"
  86. version "/dxvk-" version ".tar.gz"))
  87. (sha256
  88. (base32
  89. "1aix9isys8n0hp8vwrmm4c58716g6famsm62x40z24sdlfhfqaqr"))))
  90. (build-system trivial-build-system)
  91. (native-inputs
  92. `(("gzip" ,gzip)
  93. ("tar" ,tar)))
  94. (inputs
  95. `(("wine" ,wine64)
  96. ("bash" ,bash-minimal)))
  97. (arguments
  98. `(#:modules ((guix build utils))
  99. #:builder
  100. (begin
  101. (use-modules (guix build utils))
  102. (let ((out (assoc-ref %outputs "out"))
  103. (bash (assoc-ref %build-inputs "bash")))
  104. (setenv "PATH" (string-append
  105. (assoc-ref %build-inputs "gzip") "/bin:"
  106. (assoc-ref %build-inputs "tar") "/bin"))
  107. (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
  108. (mkdir-p out)
  109. (copy-recursively (string-append ,name "-" ,version "/") out)
  110. (chdir out)
  111. (mkdir-p "bin")
  112. (rename-file "setup_dxvk.sh" "bin/setup_dxvk")
  113. (patch-shebang "bin/setup_dxvk" (list (string-append bash "/bin")))
  114. (substitute* "bin/setup_dxvk"
  115. (("wine=\"wine\"")
  116. (string-append "wine=" (assoc-ref %build-inputs "wine") "/bin/wine"))
  117. (("x32") "../x32")
  118. (("x64") "../x64")))
  119. #t)))
  120. (home-page "https://github.com/doitsujin/dxvk/")
  121. (synopsis "Vulkan-based D3D11 and D3D10 implementation for Wine")
  122. (description "Vulkan-based D3D11 and D3D10 implementation for Wine.")
  123. (license license:zlib)))