diff options
author | Damien Cassou <damien@cassou.me> | 2020-03-21 17:33:39 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-03-22 00:02:23 +0100 |
commit | f5e0634431819f753f5e20e6c8ddc310215d9051 (patch) | |
tree | 353bd67202cc07d98428c08cdc52d07c5c8f246f | |
parent | fb2709ef988f5a27a7bc60e12288a6d497835725 (diff) | |
download | guix-f5e0634431819f753f5e20e6c8ddc310215d9051.tar guix-f5e0634431819f753f5e20e6c8ddc310215d9051.tar.gz |
gnu: clipmenu: Improve the package definition
* gnu/packages/xdisorg.scm (clipmenu): Add the package's unit-tests to the
check phase. Wrap the program so the PATH contains all dependencies. The
previous approach to patch the script was incomplete and more complex.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | gnu/packages/xdisorg.scm | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 21165f384f..facd63ab53 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -74,6 +74,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages flex) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) #:use-module (gnu packages glib) @@ -2188,21 +2189,6 @@ tools to complement clipnotify.") (arguments `(#:phases (modify-phases %standard-phases - (add-after 'unpack 'fix-hardcoded-paths - (lambda _ - (substitute* "clipmenud" - (("has_clipnotify=0") - "has_clipnotify=1") - (("command -v clipnotify >/dev/null 2>&1 && has_clipnotify=1") - "") - (("clipnotify \\|\\| .*") - (string-append (which "clipnotify") "\n")) - (("xsel --logfile") - (string-append (which "xsel") " --logfile"))) - (substitute* "clipmenu" - (("xsel --logfile") - (string-append (which "xsel") " --logfile"))) - #t)) (delete 'configure) (delete 'build) (replace 'install @@ -2215,10 +2201,42 @@ tools to complement clipnotify.") (install-file "clipmenu" bin) (install-file "clipmenud" bin) (install-file "README.md" doc) - #t)))) - #:tests? #f)) + #t))) + (add-after 'install 'wrap-script + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (clipnotify (assoc-ref inputs "clipnotify")) + (coreutils-minimal (assoc-ref inputs "coreutils-minimal")) + (gawk (assoc-ref inputs "gawk")) + (util-linux (assoc-ref inputs "util-linux")) + (xdotool (assoc-ref inputs "xdotool")) + (xsel (assoc-ref inputs "xsel"))) + (for-each + (lambda (prog) + (wrap-script (string-append out "/bin/" prog) + `("PATH" ":" prefix + ,(map (lambda (dir) + (string-append dir "/bin")) + (list clipnotify coreutils-minimal + gawk util-linux xdotool xsel))))) + '("clipmenu" "clipmenud" "clipdel"))) + #t)) + (replace 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; substitute a shebang appearing inside a string (the test + ;; file writes this string to a temporary file): + (substitute* "tests/test-clipmenu" + (("#!/usr/bin/env bash") + (string-append "#!" (which "bash")))) + (invoke "tests/test-clipmenu") + #t))))) (inputs `(("clipnotify" ,clipnotify) + ("coreutils-minimal" ,coreutils-minimal) + ("gawk" ,gawk) + ("guile" ,guile-3.0) ; for wrap-script + ("util-linux" ,util-linux) + ("xdotool" ,xdotool) ("xsel" ,xsel))) (home-page "https://github.com/cdown/clipmenu") (synopsis "Simple clipboard manager using dmenu or rofi and xsel") |