summary refs log tree commit diff
path: root/gnu/packages/xdisorg.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-27 00:12:15 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-27 00:12:15 +0100
commit18af6870370226b4d502d7372844e7f2aded5887 (patch)
tree749d93209bd0cb9710ccaae2207df670f37eaa36 /gnu/packages/xdisorg.scm
parent0ab8ad46322bea331ed5f5592843ba35e7f38b37 (diff)
parent3089b70d766bd9ec70e1464867130b7b864fbe17 (diff)
downloadguix-18af6870370226b4d502d7372844e7f2aded5887.tar.gz
Merge branch 'master' into core-updates
 Conflicts:
	gnu/packages/icu4c.scm
	gnu/packages/man.scm
	gnu/packages/python-xyz.scm
	guix/scripts/environment.scm
	guix/scripts/pack.scm
	guix/scripts/package.scm
	guix/scripts/pull.scm
	guix/store.scm
Diffstat (limited to 'gnu/packages/xdisorg.scm')
-rw-r--r--gnu/packages/xdisorg.scm125
1 files changed, 72 insertions, 53 deletions
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index b54f7cadb5..9ecfdcf12f 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)
@@ -2149,6 +2150,7 @@ configuring visual settings in different UI toolkits separately.")
                (install-file "README.md" doc)
                #t))))
        #:make-flags (list "CC=gcc")
+       ;; the package provides no test suite:
        #:tests? #f))
     (inputs
      `(("libx11" ,libx11)
@@ -2172,58 +2174,75 @@ tools to complement clipnotify.")
   (let ((commit "a495bcc7a4ab125182a661c5808364f66938a87c")
         (revision "1"))
     (package
-     (name "clipmenu")
-     (version (string-append "5.6.0-"
-                             revision "." (string-take commit 7)))
-     (source
-      (origin
-        (method git-fetch)
-        (uri (git-reference
-              (url "https://github.com/cdown/clipnotify.git")
-              (commit commit)))
-        (file-name (git-file-name name version))
-        (sha256
-         (base32
-          "12vvircdhl4psqi51cnfd6bqy85v2vwfcmdq1mimjgng727nwzys"))))
-     (build-system gnu-build-system)
-     (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
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out  (assoc-ref outputs "out"))
-                    (bin  (string-append out "/bin"))
-                    (doc  (string-append %output "/share/doc/"
-                                         ,name "-" ,version)))
-               (install-file "clipdel" bin)
-               (install-file "clipmenu" bin)
-               (install-file "clipmenud" bin)
-               (install-file "README.md" doc)
-               #t))))
-       #:tests? #f))
-     (inputs
-      `(("clipnotify" ,clipnotify)
-        ("xsel" ,xsel)))
-     (home-page "https://github.com/cdown/clipmenu")
-     (synopsis "Simple clipboard manager using dmenu or rofi and xsel")
-     (description "Start @command{clipmenud}, then run @command{clipmenu} to
+      (name "clipmenu")
+      (version (string-append "5.6.0-"
+                              revision "." (string-take commit 7)))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/cdown/clipnotify.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "12vvircdhl4psqi51cnfd6bqy85v2vwfcmdq1mimjgng727nwzys"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'build)
+           (replace 'install
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((out  (assoc-ref outputs "out"))
+                      (bin  (string-append out "/bin"))
+                      (doc  (string-append %output "/share/doc/"
+                                           ,name "-" ,version)))
+                 (install-file "clipdel" bin)
+                 (install-file "clipmenu" bin)
+                 (install-file "clipmenud" bin)
+                 (install-file "README.md" doc)
+                 #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")
+      (description "Start @command{clipmenud}, then run @command{clipmenu} to
 select something to put on the clipboard.
 
 When @command{clipmenud} detects changes to the clipboard contents, it writes
@@ -2231,4 +2250,4 @@ them out to the cache directory.  @command{clipmenu} reads the cache directory
 to find all available clips and launches @command{dmenu} (or @command{rofi},
 depending on the value of @code{CM_LAUNCHER}) to let the user select a clip.
 After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.")
-     (license license:public-domain))))
+      (license license:public-domain))))