diff mbox series

[bug#70020,1/1] * gnu: Add debian-devscripts.

Message ID b6d8a95e03a346c44df5ba9cdfdf175c0c82131b.1711485320.git.steve@futurile.net
State New
Headers show
Series [bug#70020,1/1] * gnu: Add debian-devscripts. | expand

Commit Message

Steve George March 26, 2024, 8:41 p.m. UTC
* gnu/packages/debian.scm (debian-devscripts): New variable.

Change-Id: Iff64afdb1f730f3d941617bc428a57d09c0381b2
---
 gnu/packages/debian.scm | 66 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)


base-commit: 40f53e8fb5b867e3a1e8fa798328423718282aac

Comments

Jelle Licht March 31, 2024, 9:08 p.m. UTC | #1
Hi Steve,

Steve George <steve@futurile.net> writes:

> * gnu/packages/debian.scm (debian-devscripts): New variable.
>
> Change-Id: Iff64afdb1f730f3d941617bc428a57d09c0381b2
> ---
>  gnu/packages/debian.scm | 66 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>
> diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
> index 1715b963a93..ecec816d872 100644
> --- a/gnu/packages/debian.scm
> +++ b/gnu/packages/debian.scm
> @@ -27,6 +27,7 @@ (define-module (gnu packages debian)
>    #:use-module (guix packages)
>    #:use-module (guix build-system copy)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system perl)
>    #:use-module (guix build-system trivial)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages backup)
> @@ -34,6 +35,7 @@ (define-module (gnu packages debian)
>    #:use-module (gnu packages bash)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages crypto)
> +  #:use-module (gnu packages databases)
>    #:use-module (gnu packages dbm)
>    #:use-module (gnu packages gettext)
>    #:use-module (gnu packages gnupg)
> @@ -43,6 +45,8 @@ (define-module (gnu packages debian)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages python)
> +  #:use-module (gnu packages web)
>    #:use-module (gnu packages wget)
>    #:use-module (srfi srfi-26))
>  
> @@ -211,6 +215,68 @@ (define-public ubuntu-keyring
>      (license (list license:public-domain ; the keys
>                     license:gpl2+)))) ; see debian/copyright
>  
> +(define-public debian-devscripts
> +  (package
> +    (name "debian-devscripts")
> +    (version "2.23.7")
> +    (source
> +      (origin
> +        (method git-fetch)
> +        (uri (git-reference
> +              (url "https://salsa.debian.org/debian/devscripts.git")
> +              (commit (string-append "v" version))))
> +        (file-name (git-file-name name version))
> +       (sha256
> +         (base32
> +           "031467rclglk1hdx8z2vzx5z88vpy0sk73qi8ni0sai3jx62ji75"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +      (list
> +        #:tests? #f ; tests assume various Debian specific capabilities
> +        #:phases
> +            #~(modify-phases %standard-phases
> +                (delete 'configure)
> +                (delete 'build)
> +                (replace 'install
> +                  (lambda* (#:key outputs #:allow-other-keys)
> +                    (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
> +                          (devscripts-lib (string-append (assoc-ref outputs "out")
> +                                                "/lib/perl5/site_perl/Devscripts")))

> +                      (with-directory-excursion "scripts"
> +                        (substitute* "bts.pl" (("/bin/bash") (which "bash")))
> +                        (substitute* "bts.pl" (("/bin/rm") (which "rm")))
> +                        (substitute* "bts.pl" (("/bin/cat") (which "cat")))
> +                        ;; Avoid having to provide Debian's sensible-browser package
> +                        (substitute* "bts.pl"
> +                            (("my \\$browser;") "my $browser = $ENV{'BROWSER'};"))
> +                        (substitute* "bts.pl"
> +                            (("'sensible-browser',") "$browser,"))
This could be separate phase, such as:
(add-after 'unpack 'patch-programs ...)


> +                        (rename-file "bts.pl" "bts")
> +                        (install-file "bts" bin))

It seems this "only" installs bts, compared to the (huge) list of helper
scripts I see listed in the repo README.

IMHO not a blocker, but it should probably be reflected in either a
comment or the package synopsis, name or description. Perhaps an
acceptable compromise is to spin this off into just a 'bts' package?


> +                      (with-directory-excursion "lib/Devscripts/"
> +                        (for-each (lambda (f) (install-file f devscripts-lib))
> +                                  (find-files "./")))))))))

This seems to not install any bash completions or manpages.  IWBN to
also install those, of at least make a comment w.r.t. them not being
installed at this time.


> +    (native-inputs (list perl perl-libwww perl-uri pkg-config python))
> +    (propagated-inputs
> +      (list dpkg
> +            perl-authen-sasl
> +            perl-db-file
> +            perl-encode
> +            perl-file-homedir
> +            perl-file-which
> +            perl-ipc-run
> +            perl-json
> +            perl-libwww
> +            perl-list-compare
> +            perl-lwp-protocol-https
> +            perl-moo
> +            perl-uri))

Would it be possible to wrap relevant scripts, in a similar manner to
bioperl-minimal, and make most of these normal inputs instead of
propagated-inputs?

dpkg seems like something that could be patched to directly refer to a
version directly in the store.

> +    (home-page "https://tracker.debian.org/pkg/devscripts")
> +    (synopsis "Scripts to make the life of a Debian Package maintainer easier")
> +    (description "Scripts that assist Debian packagers.  Guix developers
> +may find the bts command useful for interacting with GNU's debbugs server.")

The description should contain full sentences. When you refer to bts,
I'd use @code{bts} Texinfo markup as well.

> +    (license license:gpl2)))

I did not check by going though all source files, but AFAICS, it's
gplv2+. Or does the gplv2 refer to the devscripts files and bts.pl? In
that case, a clarifying comment would be a welcome addition here.

>  (define-public debootstrap
>    (package
>      (name "debootstrap")
>
> base-commit: 40f53e8fb5b867e3a1e8fa798328423718282aac
> -- 
> 2.41.0

Thanks,
Jelle
Steve George April 1, 2024, 8:52 p.m. UTC | #2
Hi Jelle - thanks for taking a look at this. I need some help with one of your requests, if you are able.

Stuck on:

I looked at bioperl-minimal and how it's creating a list of transitive inputs. I thought I had it but I'm stuck trying to 'unquote' in a Gexp context (I think that's the problem). Do you know any way to fix this? I guess the other option is to convert to the old type quoted list that bioperl-minimal is using. 

Fixed:

1. Split phases
2. Set-up so additional scripts can be added later - decided not to for now
2. Install man pages (mostly - can't figure out how it's creating the bts man page)
3. Install completions (bts)
4. Rework the synopsis / description
5. Add comment about other scripts

Not changed:

* Left the name as-is, because I think some people will find 'bts' through the 'debian devscripts' name. But, changed the synopsis / description to clarify that it's not the massive list of scripts Debian has.
* Need to double check the license from your comment, and add a Texinfo markup.

Steve George (1):
  * gnu: Add debian-devscripts.

 gnu/packages/debian.scm | 104 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)


base-commit: 40f53e8fb5b867e3a1e8fa798328423718282aac
diff mbox series

Patch

diff --git a/gnu/packages/debian.scm b/gnu/packages/debian.scm
index 1715b963a93..ecec816d872 100644
--- a/gnu/packages/debian.scm
+++ b/gnu/packages/debian.scm
@@ -27,6 +27,7 @@  (define-module (gnu packages debian)
   #:use-module (guix packages)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
@@ -34,6 +35,7 @@  (define-module (gnu packages debian)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages dbm)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gnupg)
@@ -43,6 +45,8 @@  (define-module (gnu packages debian)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages wget)
   #:use-module (srfi srfi-26))
 
@@ -211,6 +215,68 @@  (define-public ubuntu-keyring
     (license (list license:public-domain ; the keys
                    license:gpl2+)))) ; see debian/copyright
 
+(define-public debian-devscripts
+  (package
+    (name "debian-devscripts")
+    (version "2.23.7")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://salsa.debian.org/debian/devscripts.git")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+       (sha256
+         (base32
+           "031467rclglk1hdx8z2vzx5z88vpy0sk73qi8ni0sai3jx62ji75"))))
+    (build-system gnu-build-system)
+    (arguments
+      (list
+        #:tests? #f ; tests assume various Debian specific capabilities
+        #:phases
+            #~(modify-phases %standard-phases
+                (delete 'configure)
+                (delete 'build)
+                (replace 'install
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+                          (devscripts-lib (string-append (assoc-ref outputs "out")
+                                                "/lib/perl5/site_perl/Devscripts")))
+                      (with-directory-excursion "scripts"
+                        (substitute* "bts.pl" (("/bin/bash") (which "bash")))
+                        (substitute* "bts.pl" (("/bin/rm") (which "rm")))
+                        (substitute* "bts.pl" (("/bin/cat") (which "cat")))
+                        ;; Avoid having to provide Debian's sensible-browser package
+                        (substitute* "bts.pl"
+                            (("my \\$browser;") "my $browser = $ENV{'BROWSER'};"))
+                        (substitute* "bts.pl"
+                            (("'sensible-browser',") "$browser,"))
+                        (rename-file "bts.pl" "bts")
+                        (install-file "bts" bin))
+                      (with-directory-excursion "lib/Devscripts/"
+                        (for-each (lambda (f) (install-file f devscripts-lib))
+                                  (find-files "./")))))))))
+    (native-inputs (list perl perl-libwww perl-uri pkg-config python))
+    (propagated-inputs
+      (list dpkg
+            perl-authen-sasl
+            perl-db-file
+            perl-encode
+            perl-file-homedir
+            perl-file-which
+            perl-ipc-run
+            perl-json
+            perl-libwww
+            perl-list-compare
+            perl-lwp-protocol-https
+            perl-moo
+            perl-uri))
+    (home-page "https://tracker.debian.org/pkg/devscripts")
+    (synopsis "Scripts to make the life of a Debian Package maintainer easier")
+    (description "Scripts that assist Debian packagers.  Guix developers
+may find the bts command useful for interacting with GNU's debbugs server.")
+    (license license:gpl2)))
+
 (define-public debootstrap
   (package
     (name "debootstrap")