diff mbox series

[bug#58931,2/2] gnu: clipmenu: Improve package style.

Message ID 20221031201741.29100-2-eu@euandre.org
State New
Headers show
Series Update clipmenu and improve it | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue

Commit Message

EuAndreh Oct. 31, 2022, 8:17 p.m. UTC
* gnu/packages/xdisorg.scm (clipmenu)[arguments]: Use g-expressions;
  remove trailing #t from phases.
  [source]: Use url-fetch over ad-hoc git-fetch.
---
 gnu/packages/xdisorg.scm | 148 +++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 77 deletions(-)

Comments

Christopher Baines Nov. 3, 2022, 5:15 p.m. UTC | #1
EuAndreh via Guix-patches via <guix-patches@gnu.org> writes:

> * gnu/packages/xdisorg.scm (clipmenu)[arguments]: Use g-expressions;
>   remove trailing #t from phases.
>   [source]: Use url-fetch over ad-hoc git-fetch.

The linter points out:

  the source URI should not be an autogenerated tarball

Given that, we probably want to stick with fetching via Git?
Christopher Baines March 14, 2023, 10:39 a.m. UTC | #2
EuAndreh via Guix-patches via <guix-patches@gnu.org> writes:

> Indeed the patch was triggering lint warnings.
>
> These two do just the same thing, but now without changing from
> git-fetch to url-fetch.
>
> EuAndreh (2):
>   gnu: clipmenu: Update to 6.2.0.
>   gnu: clipmenu: Improve package style.
>
>  gnu/packages/xdisorg.scm | 95 ++++++++++++++++++++--------------------
>  1 file changed, 47 insertions(+), 48 deletions(-)

Sorry for the delay in pushing these, I've finally pushed them to master
as 15bab8f1f70a64d2ba775e9083d39d91a6f22221.

Thanks,

Chris
EuAndreh March 14, 2023, 11:44 a.m. UTC | #3
No worries, thanks for taking the time.
diff mbox series

Patch

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index a0f0f54773..288a01129f 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -2768,82 +2768,76 @@  (define-public clipnotify
     (license license:public-domain)))
 
 (define-public clipmenu
-  (let ((commit "7c34ace1fbab76eb1c1dc9b30dd4ac1a7fe4b90b")
-        (revision "1"))
-    (package
-      (name "clipmenu")
-      (version (string-append "6.2.0-"
-                              revision "." (string-take commit 7)))
-      (source
-       (origin
-         (method git-fetch)
-         (uri (git-reference
-               (url "https://github.com/cdown/clipmenu")
-               (commit commit)))
-         (file-name (git-file-name name version))
-         (sha256
-          (base32
-           "1403sw49ccb8xsd8v611fzp0csaglfz8nmz3wcjsk8x11h9jvxwy"))))
-      (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 "clipfsck" bin)
-                 (install-file "clipctl" 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"))
-                      (guile             (search-input-file inputs "bin/guile")))
-                 (for-each
-                  (lambda (prog)
-                    (wrap-script (string-append out "/bin/" prog)
-                      #:guile guile
-                      `("PATH" ":" prefix
-                        ,(map (lambda (dir)
-                                (string-append dir "/bin"))
-                              (list clipnotify coreutils-minimal
-                                    gawk util-linux xdotool xsel)))))
-                  '("clipmenu" "clipmenud" "clipdel" "clipfsck" "clipctl")))
-               #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
-       (list clipnotify
-             coreutils-minimal
-             gawk
-             guile-3.0 ; for wrap-script
-             util-linux
-             xdotool
-             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
+  (package
+    (name "clipmenu")
+    (version "6.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/cdown/clipmenu/archive/refs/tags/"
+             version
+             "/clipmenu-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1f5vmncamnx5n3pwrs5s7v8c9xfckz6f3ikiiqbai3g7vclh90qm"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (delete 'build)
+          (replace 'install
+            (lambda _
+              (let ((bin (string-append #$output "/bin"))
+                    (doc (string-append #$output "/share/doc/"
+                                        #$name "-" #$version)))
+                (install-file "clipdel" bin)
+                (install-file "clipmenu" bin)
+                (install-file "clipmenud" bin)
+                (install-file "clipfsck" bin)
+                (install-file "clipctl" bin)
+                (install-file "README.md" doc))))
+          (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"))
+                     (guile             (search-input-file inputs "bin/guile")))
+                (for-each
+                 (lambda (prog)
+                   (wrap-script (string-append out "/bin/" prog)
+                     #:guile guile
+                     `("PATH" ":" prefix
+                       ,(map (lambda (dir)
+                               (string-append dir "/bin"))
+                             (list clipnotify coreutils-minimal
+                                   gawk util-linux xdotool xsel)))))
+                 '("clipmenu" "clipmenud" "clipdel" "clipfsck" "clipctl")))))
+          (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"))))))
+    (inputs
+     (list clipnotify
+           coreutils-minimal
+           gawk
+           guile-3.0 ; for wrap-script
+           util-linux
+           xdotool
+           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
@@ -2851,7 +2845,7 @@  (define-public clipmenu
 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)))
 
 (define-public kbdd
   (package