[-- Attachment #1: Type: text/plain, Size: 2343 bytes --] From 22cc953d3e663bb842d5a0b970577a3d54f6fef1 Mon Sep 17 00:00:00 2001 From: methuselah-0 <david.larsson@selfhosted.xyz> Date: Thu, 1 Apr 2021 15:10:45 +0200 Subject: [PATCH] gnu: Add prips. * gnu/packages/admin.scm (prips): New variable. --- gnu/packages/admin.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index df7973395d..f6cb62a568 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org> +;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1019,6 +1020,39 @@ recursive runs on the generated subnets. (also IPv6) @end itemize\n") (license license:bsd-3))) +(define-public prips + (package + (name "prips") + (version "1.1.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://devel.ringlet.net/files/sys/" + name "/" name "-" version ".tar.xz")) + (sha256 + (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) + (build-system gnu-build-system) + (arguments + '(#:make-flags (list "CC=gcc") + #:phases (modify-phases + %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda _ + (let* + ((bin-dir (string-append %output "/bin")) + (bin-file (string-append bin-dir "/prips"))) + (mkdir-p bin-dir) + (copy-file "prips" bin-file) + (chmod bin-file #o700))))))) + (synopsis "Tool that prints the IP addresses in a given range") + (description "Prips can be used to print all of the IP addresses in + a given range. This allows the enhancement of tools only work + on one host at a time (e.g. whois).") + (home-page "https://devel.ringlet.net/sysutils/prips/") + (license license:gpl2))) + (define-public alive (package (name "alive") -- 2.30.2 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-Add-prips.patch --] [-- Type: text/x-diff; name=0001-gnu-Add-prips.patch, Size: 2327 bytes --] From 22cc953d3e663bb842d5a0b970577a3d54f6fef1 Mon Sep 17 00:00:00 2001 From: methuselah-0 <david.larsson@selfhosted.xyz> Date: Thu, 1 Apr 2021 15:10:45 +0200 Subject: [PATCH] gnu: Add prips. * gnu/packages/admin.scm (prips): New variable. --- gnu/packages/admin.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index df7973395d..f6cb62a568 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org> +;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1019,6 +1020,39 @@ recursive runs on the generated subnets. (also IPv6) @end itemize\n") (license license:bsd-3))) +(define-public prips + (package + (name "prips") + (version "1.1.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://devel.ringlet.net/files/sys/" + name "/" name "-" version ".tar.xz")) + (sha256 + (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) + (build-system gnu-build-system) + (arguments + '(#:make-flags (list "CC=gcc") + #:phases (modify-phases + %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda _ + (let* + ((bin-dir (string-append %output "/bin")) + (bin-file (string-append bin-dir "/prips"))) + (mkdir-p bin-dir) + (copy-file "prips" bin-file) + (chmod bin-file #o700))))))) + (synopsis "Tool that prints the IP addresses in a given range") + (description "Prips can be used to print all of the IP addresses in + a given range. This allows the enhancement of tools only work + on one host at a time (e.g. whois).") + (home-page "https://devel.ringlet.net/sysutils/prips/") + (license license:gpl2))) + (define-public alive (package (name "alive") -- 2.30.2
[-- Attachment #1: Type: text/plain, Size: 2487 bytes --] Hi, Some comments on the patch. On Thu, 2021-04-01 at 15:11 +0200, david larsson wrote: > [...] > +(define-public prips > + (package > + (name "prips") > + (version "1.1.1") > + (source > + (origin > + (method url-fetch) > + (uri (string-append "https://devel.ringlet.net/files/sys/" > + name "/" name "-" version ".tar.xz")) > + (sha256 > + (base32 > "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) > + (build-system gnu-build-system) > + (arguments > + '(#:make-flags (list "CC=gcc") As "CC=gcc" is a constant, I would write '("CC=gcc") here, though admittedly this is largely a matter of taste. Another problem: when cross-compiling, "gcc" will be a compiler for the build system, not the host system (assuming I got the terminology right). Instead, write `(#:make-flags (list (string-append "CC" ,(cc-for-target))) ...) (The quasiquote ` is important.) (TODO to self: fix other packages that incorrectly set "CC=gcc" ...) > + #:phases (modify-phases > + %standard-phases %standard-phases shouldn't be on a separate line here. > + (delete 'configure) > + (delete 'check) Prips has some tests, so don't delete this phase. > + (replace 'install > + (lambda _ > + (let* > + ((bin-dir (string-append %output "/bin")) > + (bin-file (string-append bin-dir "/prips"))) The ((bin-dir ...)) should be on the same line as 'let*'. > + (mkdir-p bin-dir) > + (copy-file "prips" bin-file) > + (chmod bin-file #o700))))))) Why are you making bin/prips writable? Shouldn't this be (chmod bin-file #o600) instead? > + (synopsis "Tool that prints the IP addresses in a given range") > + (description "Prips can be used to print all of the IP addresses in > + a given range. This allows the enhancement of tools only work ‘Enhancement’ is rather vague and leaning towards marketing-speak. I do not have an alternative suggestion however. > + on one host at a time (e.g. whois).") > + (home-page "https://devel.ringlet.net/sysutils/prips/") > + (license license:gpl2))) I looked at the source code and it seems prips is actually gpl2+. Greetings, Maxime. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --]
On 2021-04-01 21:44, Maxime Devos wrote: >> + (arguments >> + '(#:make-flags (list "CC=gcc") > > As "CC=gcc" is a constant, I would write '("CC=gcc") here, > though admittedly this is largely a matter of taste. > Another problem: when cross-compiling, "gcc" will be a > compiler for the build system, not the host system (assuming > I got the terminology right). Instead, write > > `(#:make-flags (list (string-append "CC" ,(cc-for-target))) > ...) > > (The quasiquote ` is important.) Fixed. >> + #:phases (modify-phases >> + %standard-phases > > %standard-phases shouldn't be on a separate line here. Fixed. > >> + (delete 'configure) >> + (delete 'check) > > Prips has some tests, so don't delete this phase. I tried to fix but this fails. > >> + (replace 'install >> + (lambda _ >> + (let* >> + ((bin-dir (string-append %output "/bin")) >> + (bin-file (string-append bin-dir >> "/prips"))) > > The ((bin-dir ...)) should be on the same line as 'let*'. > >> + (mkdir-p bin-dir) >> + (copy-file "prips" bin-file) >> + (chmod bin-file #o700))))))) > > Why are you making bin/prips writable? Shouldn't this be > (chmod bin-file #o600) instead? I don't know for sure why that happened, but it's fixed to #o600 now. >> + (synopsis "Tool that prints the IP addresses in a given range") >> + (description "Prips can be used to print all of the IP addresses >> in >> + a given range. This allows the enhancement of tools only work > > ‘Enhancement’ is rather vague and leaning towards marketing-speak. > I do not have an alternative suggestion however. This was an exact quote from website or something. >> + (license license:gpl2))) > > I looked at the source code and it seems prips is actually gpl2+. Fixed. > Greetings, > Maxime. Thanks for your review! This is what it looks like now, and failing the check phase: (define-public prips (package (name "prips") (version "1.1.1") (source (origin (method url-fetch) (uri (string-append "https://devel.ringlet.net/files/sys/" name "/" name "-" version ".tar.xz")) (sha256 (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) (build-system gnu-build-system) (arguments `(#:make-flags (list (string-append "CC=" ,(cc-for-target))) #:phases (modify-phases %standard-phases (delete 'configure) ;(delete 'check) (replace 'install (lambda _ (let* ((bin-dir (string-append %output "/bin")) (bin-file (string-append bin-dir "/prips"))) (mkdir-p bin-dir) (copy-file "prips" bin-file) (chmod bin-file #o600))))))) (synopsis "Tool that prints the IP addresses in a given range") (description "Prips can be used to print all of the IP addresses in a given range. This allows the enhancement of tools only work on one host at a time (e.g. whois).") (home-page "https://devel.ringlet.net/sysutils/prips/") (license license:gpl2+))) The logs: --------------- starting phase `check' make: *** No rule to make target 'check'. Stop. Test suite failed, dumping logs. command "make" "check" "-j" "2" "CC=gcc" failed with status 2 Best regards, David ---------------
[-- Attachment #1: Type: text/plain, Size: 176 bytes --] Here's a new patch which has the fixes you mentioned, except I still haven't readded the configure and test phases as I don't know how to make them work. Best regards, David [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-Add-prips.patch --] [-- Type: text/x-diff; charset=us-ascii; name=0001-gnu-Add-prips.patch, Size: 2334 bytes --] From 87377a4918ab8c5fda939d0696e725425e32fee3 Mon Sep 17 00:00:00 2001 From: methuselah-0 <david.larsson@selfhosted.xyz> Date: Mon, 5 Apr 2021 19:36:27 +0200 Subject: [PATCH] gnu: Add prips. gnu/packages/admin.scm (prips): New variable. --- gnu/packages/admin.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index df7973395d..fd5a661738 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org> +;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1019,6 +1020,38 @@ recursive runs on the generated subnets. (also IPv6) @end itemize\n") (license license:bsd-3))) +(define-public prips + (package + (name "prips") + (version "1.1.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://devel.ringlet.net/files/sys/" + name "/" name "-" version ".tar.xz")) + (sha256 + (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list (string-append "CC=" ,(cc-for-target))) + #:phases (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda _ + (let* + ((bin-dir (string-append %output "/bin")) + (bin-file (string-append bin-dir "/prips"))) + (mkdir-p bin-dir) + (copy-file "prips" bin-file) + (chmod bin-file #o600))))))) + (synopsis "Tool that prints the IP addresses in a given range") + (description "Prips can be used to print all of the IP addresses in + a given range. This allows the enhancement of tools only work + on one host at a time (e.g. whois).") + (home-page "https://devel.ringlet.net/sysutils/prips/") + (license license:gpl2+))) + (define-public alive (package (name "alive") -- 2.30.2
[-- Attachment #1: Type: text/plain, Size: 998 bytes --] [...] > +(define-public prips > + (package > + (name "prips") > + (version "1.1.1") > + (source > + (origin > + (method url-fetch) > + (uri (string-append "https://devel.ringlet.net/files/sys/" > + name "/" name "-" version ".tar.xz")) > + (sha256 > + (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) > + (build-system gnu-build-system) Add ‘(native-inputs `(("perl-test-harness" ,perl-test-harness)))’ such that the makefile can find the 'prove' binary. > + (arguments > + `(#:make-flags (list (string-append "CC=" ,(cc-for-target))) Add ‘#:test-target "test"’ here, as the makefile has a 'test' target instead of a 'check' target. > + #:phases (modify-phases %standard-phases > + (delete 'configure) > + (delete 'check) and remove the (delete 'check). The package now builds successfully for me. Greetings, Maxime. [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 260 bytes --]
[-- Attachment #1: Type: text/plain, Size: 639 bytes --] On 2021-04-06 16:04, Maxime Devos wrote: > Add ‘(native-inputs `(("perl-test-harness" ,perl-test-harness)))’ such > that > the makefile can find the 'prove' binary. Fixed. > > Add ‘#:test-target "test"’ here, as the makefile has a 'test' target > instead of a 'check' target. > >> + #:phases (modify-phases %standard-phases >> + (delete 'configure) >> + (delete 'check) > > and remove the (delete 'check). Fixed. > The package now builds successfully for me. For me as well. > Greetings, > Maxime. Thanks for your review and help with improving this package! Best regards, David [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-Add-prips.patch --] [-- Type: text/x-diff; name=0001-gnu-Add-prips.patch, Size: 2394 bytes --] From 85cf7b9d22801d9b3bac8956b358fce4c32dcb4c Mon Sep 17 00:00:00 2001 From: methuselah-0 <david.larsson@selfhosted.xyz> Date: Thu, 8 Apr 2021 21:26:23 +0200 Subject: [PATCH] gnu: Add prips. gnu/packages/admin.scm (prips): New variable. --- gnu/packages/admin.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index df7973395d..15ac8841c6 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at> ;;; Copyright © 2021 qblade <qblade@protonmail.com> ;;; Copyright © 2021 Hyunseok Kim <lasnesne@lagunposprasihopre.org> +;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1019,6 +1020,39 @@ recursive runs on the generated subnets. (also IPv6) @end itemize\n") (license license:bsd-3))) +(define-public prips + (package + (name "prips") + (version "1.1.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://devel.ringlet.net/files/sys/" + name "/" name "-" version ".tar.xz")) + (sha256 + (base32 "1a33vbl4w603mk6mm5r3vhk87fy3dfk5wdpch0yd3ncbkg3fmvqn")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list (string-append "CC=" ,(cc-for-target))) + #:test-target "test" + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda _ + (let* + ((bin-dir (string-append %output "/bin")) + (bin-file (string-append bin-dir "/prips"))) + (mkdir-p bin-dir) + (copy-file "prips" bin-file) + (chmod bin-file #o600))))))) + (native-inputs `(("perl-test-harness" ,perl-test-harness))) + (synopsis "Tool that prints the IP addresses in a given range") + (description "Prips can be used to print all of the IP addresses in + a given range. This allows the enhancement of tools only work + on one host at a time (e.g. whois).") + (home-page "https://devel.ringlet.net/sysutils/prips/") + (license license:gpl2+))) + (define-public alive (package (name "alive") -- 2.30.2
[-- Attachment #1: Type: text/plain, Size: 931 bytes --] Hi, david larsson <david.larsson@selfhosted.xyz> skribis: > From 85cf7b9d22801d9b3bac8956b358fce4c32dcb4c Mon Sep 17 00:00:00 2001 > From: methuselah-0 <david.larsson@selfhosted.xyz> > Date: Thu, 8 Apr 2021 21:26:23 +0200 > Subject: [PATCH] gnu: Add prips. > > gnu/packages/admin.scm (prips): New variable. [...] > + (replace 'install > + (lambda _ > + (let* > + ((bin-dir (string-append %output "/bin")) > + (bin-file (string-append bin-dir "/prips"))) > + (mkdir-p bin-dir) > + (copy-file "prips" bin-file) > + (chmod bin-file #o600))))))) That installed a non-executable file. I fixed this with the patch below, which also make the style more consistent. Thanks David, and thanks Maxime for the review! Ludo’. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 1166 bytes --] diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index f3e8774b75..512ac320e6 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1070,13 +1070,10 @@ recursive runs on the generated subnets. (also IPv6) #:phases (modify-phases %standard-phases (delete 'configure) (replace 'install - (lambda _ - (let* - ((bin-dir (string-append %output "/bin")) - (bin-file (string-append bin-dir "/prips"))) - (mkdir-p bin-dir) - (copy-file "prips" bin-file) - (chmod bin-file #o600))))))) + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (install-file "prips" + (string-append out "/bin")))))))) (native-inputs `(("perl-test-harness" ,perl-test-harness))) (synopsis "Tool that prints the IP addresses in a given range") (description "Prips can be used to print all of the IP addresses in