From unknown Sun Jun 15 08:54:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#40168] [PATCH] Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 21 Mar 2020 17:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40168 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40168@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158481019629340 (code B ref -1); Sat, 21 Mar 2020 17:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Mar 2020 17:03:16 +0000 Received: from localhost ([127.0.0.1]:47918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFhWl-0007d9-TN for submit@debbugs.gnu.org; Sat, 21 Mar 2020 13:03:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:44650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFhWk-0007d2-7I for submit@debbugs.gnu.org; Sat, 21 Mar 2020 13:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53111) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFhWi-0007GL-7L for guix-patches@gnu.org; Sat, 21 Mar 2020 13:03:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFhWg-00087J-5m for guix-patches@gnu.org; Sat, 21 Mar 2020 13:03:12 -0400 Received: from mail.choca.pics ([80.67.172.235]:33502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jFhWf-00084U-OI; Sat, 21 Mar 2020 13:03:10 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 3F54618195760; Sat, 21 Mar 2020 18:03:00 +0100 (CET) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id t_luO2ZVzv6w; Sat, 21 Mar 2020 18:02:59 +0100 (CET) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 1557618191BB0; Sat, 21 Mar 2020 18:02:59 +0100 (CET) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id gC0m3GFbBchd; Sat, 21 Mar 2020 18:02:58 +0100 (CET) Received: from luz4 (57.139.120.78.rev.sfr.net [78.120.139.57]) by mail.choca.pics (Postfix) with ESMTPSA id A9F5818192B26; Sat, 21 Mar 2020 18:02:58 +0100 (CET) From: Damien Cassou Date: Sat, 21 Mar 2020 18:02:57 +0100 Message-ID: <87imixr67y.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.67.172.235 X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Hi, I've improved the packaging for clipmenu in gnu/packages/xdisorg.scm. Please give feedback. I found that my usage of wrap-script is very verbose. Is there a simpler way? Thank you Damien Cassou (3): * gnu/packages/xdisorg.scm (clipmenu): Re-indent * gnu/packages/xdisorg.scm (clipnotify): Add a comment gnu: clipmenu: Improve the package definition gnu/packages/xdisorg.scm | 125 ++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 53 deletions(-) -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-packages-xdisorg.scm-clipmenu-Re-indent.patch >From c3dda4474189d32b80f260125115c9f8f159cbaf Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:42:07 +0100 Subject: [PATCH 1/3] * gnu/packages/xdisorg.scm (clipmenu): Re-indent --- gnu/packages/xdisorg.scm | 106 +++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index c714b867f4..817eef6c29 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -2170,58 +2170,58 @@ (define-public clipmenu (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 + (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 select something to put on the clipboard. When @command{clipmenud} detects changes to the clipboard contents, it writes @@ -2229,4 +2229,4 @@ (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)))) -- 2.25.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-packages-xdisorg.scm-clipnotify-Add-a-comment.patch >From 5074bba8c91d24b542b78c07295842fba5c82d9c Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:45:11 +0100 Subject: [PATCH 2/3] * gnu/packages/xdisorg.scm (clipnotify): Add a comment --- gnu/packages/xdisorg.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 817eef6c29..21165f384f 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -2147,6 +2147,7 @@ (define-public clipnotify (install-file "README.md" doc) #t)))) #:make-flags (list "CC=gcc") + ;; the package provides no test suite: #:tests? #f)) (inputs `(("libx11" ,libx11) -- 2.25.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-clipmenu-Improve-the-package-definition.patch >From 391ad6deec073b7e01984fd81a44a5cac52afc5b Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:33:39 +0100 Subject: [PATCH 3/3] 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. --- gnu/packages/xdisorg.scm | 52 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 21165f384f..f7c4668bf8 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -74,6 +74,7 @@ (define-module (gnu packages xdisorg) #: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 @@ (define-public clipmenu (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 @@ (define-public clipmenu (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") + (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") -- 2.25.1 --=-=-=-- From unknown Sun Jun 15 08:54:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Damien Cassou Subject: bug#40168: closed (Re: [bug#40168] [PATCH]) Message-ID: References: <87fte1wcxb.fsf@gnu.org> <87imixr67y.fsf@cassou.me> X-Gnu-PR-Message: they-closed 40168 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 40168@debbugs.gnu.org Date: Sat, 21 Mar 2020 22:40:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1584830402-18718-1" This is a multi-part message in MIME format... ------------=_1584830402-18718-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #40168: [PATCH]=20 which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 40168@debbugs.gnu.org. --=20 40168: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40168 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1584830402-18718-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 40168-done) by debbugs.gnu.org; 21 Mar 2020 22:39:32 +0000 Received: from localhost ([127.0.0.1]:48375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFmmC-0004r7-Gi for submit@debbugs.gnu.org; Sat, 21 Mar 2020 18:39:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFmmA-0004qo-Eu for 40168-done@debbugs.gnu.org; Sat, 21 Mar 2020 18:39:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jFmm4-0008CV-R6; Sat, 21 Mar 2020 18:39:24 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56342 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jFmm4-0001dw-3R; Sat, 21 Mar 2020 18:39:24 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Damien Cassou Subject: Re: [bug#40168] [PATCH] References: <87imixr67y.fsf@cassou.me> Date: Sat, 21 Mar 2020 23:39:12 +0100 In-Reply-To: <87imixr67y.fsf@cassou.me> (Damien Cassou's message of "Sat, 21 Mar 2020 18:02:57 +0100") Message-ID: <87fte1wcxb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40168-done Cc: 40168-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hi Damien, Damien Cassou skribis: > Damien Cassou (3): > * gnu/packages/xdisorg.scm (clipmenu): Re-indent > * gnu/packages/xdisorg.scm (clipnotify): Add a comment > gnu: clipmenu: Improve the package definition Applied! I added a subject line to the commit logs. For the last patch I adjusted the shebang substitute: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index f7c4668bf8..facd63ab53 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -2204,8 +2204,8 @@ tools to complement clipnotify.") #t))) (add-after 'install 'wrap-script (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (clipnotify (assoc-ref inputs "clipnotify")) + (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")) @@ -2227,7 +2227,7 @@ tools to complement clipnotify.") ;; file writes this string to a temporary file): (substitute* "tests/test-clipmenu" (("#!/usr/bin/env bash") - (which "bash"))) + (string-append "#!" (which "bash")))) (invoke "tests/test-clipmenu") #t))))) (inputs --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks! Ludo=E2=80=99. --=-=-=-- ------------=_1584830402-18718-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Mar 2020 17:03:16 +0000 Received: from localhost ([127.0.0.1]:47918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFhWl-0007d9-TN for submit@debbugs.gnu.org; Sat, 21 Mar 2020 13:03:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:44650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFhWk-0007d2-7I for submit@debbugs.gnu.org; Sat, 21 Mar 2020 13:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53111) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFhWi-0007GL-7L for guix-patches@gnu.org; Sat, 21 Mar 2020 13:03:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFhWg-00087J-5m for guix-patches@gnu.org; Sat, 21 Mar 2020 13:03:12 -0400 Received: from mail.choca.pics ([80.67.172.235]:33502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jFhWf-00084U-OI; Sat, 21 Mar 2020 13:03:10 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 3F54618195760; Sat, 21 Mar 2020 18:03:00 +0100 (CET) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id t_luO2ZVzv6w; Sat, 21 Mar 2020 18:02:59 +0100 (CET) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 1557618191BB0; Sat, 21 Mar 2020 18:02:59 +0100 (CET) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id gC0m3GFbBchd; Sat, 21 Mar 2020 18:02:58 +0100 (CET) Received: from luz4 (57.139.120.78.rev.sfr.net [78.120.139.57]) by mail.choca.pics (Postfix) with ESMTPSA id A9F5818192B26; Sat, 21 Mar 2020 18:02:58 +0100 (CET) From: Damien Cassou To: guix-patches@gnu.org Subject: [PATCH] Date: Sat, 21 Mar 2020 18:02:57 +0100 Message-ID: <87imixr67y.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.67.172.235 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Hi, I've improved the packaging for clipmenu in gnu/packages/xdisorg.scm. Please give feedback. I found that my usage of wrap-script is very verbose. Is there a simpler way? Thank you Damien Cassou (3): * gnu/packages/xdisorg.scm (clipmenu): Re-indent * gnu/packages/xdisorg.scm (clipnotify): Add a comment gnu: clipmenu: Improve the package definition gnu/packages/xdisorg.scm | 125 ++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 53 deletions(-) -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-packages-xdisorg.scm-clipmenu-Re-indent.patch >From c3dda4474189d32b80f260125115c9f8f159cbaf Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:42:07 +0100 Subject: [PATCH 1/3] * gnu/packages/xdisorg.scm (clipmenu): Re-indent --- gnu/packages/xdisorg.scm | 106 +++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index c714b867f4..817eef6c29 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -2170,58 +2170,58 @@ (define-public clipmenu (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 + (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 select something to put on the clipboard. When @command{clipmenud} detects changes to the clipboard contents, it writes @@ -2229,4 +2229,4 @@ (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)))) -- 2.25.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-packages-xdisorg.scm-clipnotify-Add-a-comment.patch >From 5074bba8c91d24b542b78c07295842fba5c82d9c Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:45:11 +0100 Subject: [PATCH 2/3] * gnu/packages/xdisorg.scm (clipnotify): Add a comment --- gnu/packages/xdisorg.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 817eef6c29..21165f384f 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -2147,6 +2147,7 @@ (define-public clipnotify (install-file "README.md" doc) #t)))) #:make-flags (list "CC=gcc") + ;; the package provides no test suite: #:tests? #f)) (inputs `(("libx11" ,libx11) -- 2.25.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-clipmenu-Improve-the-package-definition.patch >From 391ad6deec073b7e01984fd81a44a5cac52afc5b Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 21 Mar 2020 17:33:39 +0100 Subject: [PATCH 3/3] 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. --- gnu/packages/xdisorg.scm | 52 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 21165f384f..f7c4668bf8 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -74,6 +74,7 @@ (define-module (gnu packages xdisorg) #: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 @@ (define-public clipmenu (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 @@ (define-public clipmenu (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") + (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") -- 2.25.1 --=-=-=-- ------------=_1584830402-18718-1--