summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2021-04-02 09:23:37 +0200
committerPierre Neidhardt <mail@ambrevar.xyz>2021-04-02 09:26:44 +0200
commita8c9d24a296e8b9c5eb283c69c3f56ab50ff2833 (patch)
tree0ed0ded511883c9ac6ce7e3a475605d1d4e9c437
parent829eda38b632e9253cdbc9fc5ac9582d65e92bc9 (diff)
gnu: winetricks: Fix GUI support and Perl dependency.
* nongnu/packages/wine.scm (winetricks)[inputs]: Add perl. [arguments]: Replace patch-zenity-path phase with wrap-program phase which sets PATH to include all required dependencies. Add phase to patch embedded Perl shabang.
-rw-r--r--nongnu/packages/wine.scm42
1 files changed, 29 insertions, 13 deletions
diff --git a/nongnu/packages/wine.scm b/nongnu/packages/wine.scm
index 21343f4..2fa386a 100644
--- a/nongnu/packages/wine.scm
+++ b/nongnu/packages/wine.scm
@@ -27,6 +27,7 @@
#:use-module (guix git-download)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages wget)
#:use-module (gnu packages compression)
#:use-module (gnu packages gnome)
@@ -47,11 +48,12 @@
"0x2ykd6krk0fric45yl4gcc8cdv6j206l62rc9klw0rxfv12hz5n"))))
(build-system gnu-build-system)
(inputs
- `(("wget" ,wget)
- ("cabextract" ,cabextract)
+ `(("cabextract" ,cabextract)
("p7zip" ,p7zip)
- ("unzip" ,unzip)
+ ("perl" ,perl)
;; ("unrar" ,unrar) ; TODO: Include unrar? It is referenced in the source.
+ ("unzip" ,unzip)
+ ("wget" ,wget)
("zenity" ,zenity)))
(arguments
`(#:tests? #f
@@ -61,16 +63,30 @@
#:phases
(modify-phases %standard-phases
(delete 'configure)
- (add-after 'unpack 'patch-zenity-path
- (lambda* (#:key inputs #:allow-other-keys)
- (let* ((zenity (assoc-ref inputs "zenity"))
- (zenity-bin (string-append zenity "/bin/zenity")))
- (substitute* "src/winetricks"
- ;; TODO: There might need more command substitution needed, e.g. wget, 7z, etc.
- ;; TODO: Add coreutils to the input?
- (("command -v zenity") (string-append "command -v " zenity-bin))
- (("WINETRICKS_GUI=zenity") (string-append "WINETRICKS_GUI=" zenity-bin))
- (("WINETRICKS_GUI_VERSION=\"\\$\\(zenity") (string-append "WINETRICKS_GUI_VERSION=\"$(" zenity-bin)))))))))
+ (add-after 'install 'wrap-program
+ ;; The script relies on WINETRICKS_GUI being exactly "zenity", so
+ ;; we can't patch the path directly. Probably same for other dependencies.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((zenity-bin (string-append (assoc-ref inputs "zenity") "/bin/"))
+ (perl-bin (string-append (assoc-ref inputs "perl") "/bin/"))
+ (winetricks (string-append (assoc-ref outputs "out")
+ "/bin/winetricks")))
+ (wrap-program winetricks
+ `("PATH" prefix (,@(map (lambda (in)
+ (string-append (assoc-ref inputs in) "/bin/"))
+ '("cabextract"
+ "p7zip"
+ "perl"
+ "unzip"
+ "wget"
+ "zenity"))))))))
+ (add-after 'install 'patch-perl-path
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
+ (winetricks (string-append (assoc-ref outputs "out")
+ "/bin/winetricks")))
+ (substitute* winetricks
+ (("#!/usr/bin/env perl") (string-append "#!" perl)))))))))
(home-page "https://github.com/Winetricks/winetricks")
(synopsis "Easy way to work around problems in Wine")
(description "Winetricks is an easy way to work around problems in Wine.