[PATCH 0/7] Add nncp

  • Done
  • quality assurance status badge
Details
2 participants
  • Arun Isaac
  • Sarah Morgensen
Owner
unassigned
Submitted by
Arun Isaac
Severity
normal
A
A
Arun Isaac wrote on 9 Jul 2021 18:12
(address . guix-patches@gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161203.11468-1-arunisaac@systemreboot.net
Hi,

This patchset adds nncp and dependencies.

Cheers!

Arun Isaac (7):
gnu: Add go-github-com-davecgh-go-xdr.
gnu: Add go-github-com-dustin-go-humanize.
gnu: Add go-lukechampine-com-blake3.
gnu: Add go-golang-org-x-term.
gnu: Add go-github-com-flynn-noise.
gnu: Add go-github-com-klauspost-compress.
gnu: Add nncp.

gnu/packages/golang.scm | 167 +++++++++++++++++++++++++++++++++++++++-
gnu/packages/uucp.scm | 99 ++++++++++++++++++++++++
2 files changed, 265 insertions(+), 1 deletion(-)

--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 2/7] gnu: Add go-github-com-dustin-go-humanize.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-2-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-github-com-dustin-go-humanize): New variable.
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cbce7bec41..972989c84f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8249,3 +8249,27 @@ Go.")
the External Data Representation (XDR) standard protocol as specified in RFC
4506 (obsoletes RFC 1832 and RFC 1014) in pure Go.")
(license license:isc)))
+
+(define-public go-github-com-dustin-go-humanize
+ (package
+ (name "go-github-com-dustin-go-humanize")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dustin/go-humanize")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1kqf1kavdyvjk7f8kx62pnm7fbypn9z1vbf8v2qdh3y7z7a0cbl3"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/dustin/go-humanize"))
+ (home-page "https://github.com/dustin/go-humanize")
+ (synopsis "Humane unit formatter")
+ (description "@code{go-humanize} provides formatters for units to human
+friendly sizes. It converts boring ugly numbers to human-friendly strings and
+back.")
+ (license license:expat)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 1/7] gnu: Add go-github-com-davecgh-go-xdr.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-1-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-github-com-davecgh-go-xdr): New variable.
---
gnu/packages/golang.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a830afa022..cbce7bec41 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -15,7 +15,7 @@
;;; Copyright © 2018, 2019, 2020 Katherine Cox-Buday <cox.katherine.e@gmail.com>
;;; Copyright © 2019 Giovanni Biscuolo <g@xelera.eu>
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2019, 2020, 2021 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
;;; Copyright © 2020 Jakub K?dzio?ka <kuba@kadziolka.net>
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.com>
@@ -8224,3 +8224,28 @@ simplifications, and enforces style rules.")
"This package provides a library for fast, structured, leveled logging in
Go.")
(license license:expat)))
+
+(define-public go-github-com-davecgh-go-xdr
+ (package
+ (name "go-github-com-davecgh-go-xdr")
+ (version "0.0.0-20161123171359-e6a2ba005892")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/davecgh/go-xdr")
+ (commit (go-version->git-ref version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0vifrz4iil4r7k8sz5iqlfbh80ysgs5abp2simgyhsbrkxrrsrrd"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/davecgh/go-xdr/xdr2"
+ #:unpack-path "github.com/davecgh/go-xdr"))
+ (home-page "https://github.com/davecgh/go-xdr")
+ (synopsis "Pure Go implementation of the XDR standard")
+ (description "@code{go-xdr} implements the data representation portion of
+the External Data Representation (XDR) standard protocol as specified in RFC
+4506 (obsoletes RFC 1832 and RFC 1014) in pure Go.")
+ (license license:isc)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 3/7] gnu: Add go-lukechampine-com-blake3.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-3-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-lukechampine-com-blake3): New variable.
---
gnu/packages/golang.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 972989c84f..8eb93b9456 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8273,3 +8273,30 @@ the External Data Representation (XDR) standard protocol as specified in RFC
friendly sizes. It converts boring ugly numbers to human-friendly strings and
back.")
(license license:expat)))
+
+(define-public go-lukechampine-com-blake3
+ (package
+ (name "go-lukechampine-com-blake3")
+ (version "1.1.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/lukechampine/blake3")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1yxdwp8dpnnq2wbwsxlkbq570i99sc6781y39czjxi9jh9z5nw55"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "lukechampine.com/blake3"))
+ (propagated-inputs
+ `(("go-github-com-klauspost-cpuid" ,go-github-com-klauspost-cpuid)))
+ (home-page "https://pkg.go.dev/lukechampine.com/blake3")
+ (synopsis "Implementation of the BLAKE3 cryptographic hash function")
+ (description "@code{blake3} implements the BLAKE3 cryptographic hash
+function. In addition to the pure-Go implementation, this package also
+contains AVX-512 and AVX2 routines (generated by avo) that greatly increase
+performance for large inputs and outputs.")
+ (license license:expat)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 6/7] gnu: Add go-github-com-klauspost-compress.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-6-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-github-com-klauspost-compress): New variable.
---
gnu/packages/golang.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 5a7f27bc91..ef54e15afc 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -67,6 +67,7 @@
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages pulseaudio)
+ #:use-module (gnu packages syncthing)
#:use-module (gnu packages terminals)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
@@ -8352,3 +8353,39 @@ is a low-level framework for building crypto protocols. Noise protocols
support mutual and optional authentication, identity hiding, forward secrecy,
zero round-trip encryption, and other advanced features.")
(license license:bsd-3)))
+
+(define-public go-github-com-klauspost-compress
+ (package
+ (name "go-github-com-klauspost-compress")
+ (version "1.13.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/klauspost/compress")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0ydnf9rizlhm8rilh14674qqx272sbwbkjx06xn9pqvy6mmn2r3r"))))
+ (build-system go-build-system)
+ (arguments
+ `(#:import-path "github.com/klauspost/compress"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'reset-gzip-timestamps 'fix-permissions
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Provide write permissions on gzip files so that
+ ;; reset-gzip-timestamps has sufficient permissions.
+ (for-each (lambda (file)
+ (chmod file #o644))
+ (find-files (assoc-ref outputs "out")
+ (lambda (file stat)
+ (and (eq? 'regular (stat:type stat))
+ (string-suffix? ".gz" file))))))))))
+ (propagated-inputs
+ `(("go-github-com-golang-snappy" ,go-github-com-golang-snappy)))
+ (home-page "https://github.com/klauspost/compress")
+ (synopsis "Go compression library")
+ (description "@code{compress} provides various compression algorithms.")
+ (license license:bsd-3)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 4/7] gnu: Add go-golang-org-x-term.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-4-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-golang-org-x-term): New variable.
---
gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 8eb93b9456..673d206713 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8300,3 +8300,27 @@ function. In addition to the pure-Go implementation, this package also
contains AVX-512 and AVX2 routines (generated by avo) that greatly increase
performance for large inputs and outputs.")
(license license:expat)))
+
+(define-public go-golang-org-x-term
+ (package
+ (name "go-golang-org-x-term")
+ (version "0.0.0-20210615171337-6886f2dfbf5b")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://go.googlesource.com/term")
+ (commit (go-version->git-ref version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0661w7dp2ak1k4ii90v6chw2x8a6g4sc5j0ba58qlplaj4k5l0xs"))))
+ (build-system go-build-system)
+ (arguments '(#:import-path "golang.org/x/term"))
+ (propagated-inputs
+ `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
+ (home-page "https://pkg.go.dev/golang.org/x/term")
+ (synopsis "Go terminal/console support")
+ (description "@code{term} provides support functions for dealing with
+terminals, as commonly found on Unix systems.")
+ (license license:bsd-3)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 5/7] gnu: Add go-github-com-flynn-noise.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-5-arunisaac@systemreboot.net
* gnu/packages/golang.scm (go-github-com-flynn-noise): New variable.
---
gnu/packages/golang.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 673d206713..5a7f27bc91 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -8324,3 +8324,31 @@ performance for large inputs and outputs.")
(description "@code{term} provides support functions for dealing with
terminals, as commonly found on Unix systems.")
(license license:bsd-3)))
+
+(define-public go-github-com-flynn-noise
+ (package
+ (name "go-github-com-flynn-noise")
+ (version "1.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/flynn/noise")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1j6phxyqx06wcqxjpin696fkp85s76qcp3i2f7fv6q2fb6618f6y"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/flynn/noise"))
+ (propagated-inputs
+ `(("go-gopkg-in-check-v1" ,go-gopkg-in-check-v1)
+ ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
+ (home-page "https://github.com/flynn/noise")
+ (synopsis "Go implementation of the Noise protocol framework")
+ (description "@code{noise} implements the Noise protocol framework. Noise
+is a low-level framework for building crypto protocols. Noise protocols
+support mutual and optional authentication, identity hiding, forward secrecy,
+zero round-trip encryption, and other advanced features.")
+ (license license:bsd-3)))
--
2.32.0
A
A
Arun Isaac wrote on 9 Jul 2021 18:19
[PATCH 7/7] gnu: Add nncp.
(address . 49494@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20210709161940.12759-7-arunisaac@systemreboot.net
* gnu/packages/uucp.scm (nncp): New variable.
---
gnu/packages/uucp.scm | 99 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+)

Toggle diff (122 lines)
diff --git a/gnu/packages/uucp.scm b/gnu/packages/uucp.scm
index 1bb4fdb975..2d4d1ae8d0 100644
--- a/gnu/packages/uucp.scm
+++ b/gnu/packages/uucp.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -17,6 +18,8 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages uucp)
+ #:use-module (gnu packages golang)
+ #:use-module (gnu packages texinfo)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
@@ -54,3 +57,99 @@
set of utilities for remotely transferring files, email and net news
between computers.")
(license gpl2+)))
+
+(define-public nncp
+ (package
+ (name "nncp")
+ (version "7.2.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://www.nncpgo.org/download/nncp-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "0xsh5zc6i8nbcsi06r65lpp26hz2zb4vh0pzbkivdd69hrxvknvh"))
+ (modules '((ice-9 ftw)
+ (guix build utils)))
+ (snippet
+ '(begin
+ ;; Unbundle dependencies.
+ ;; TODO: go.cypherpunks.ru was down at the time of
+ ;; packaging. Unbundle go.cypherpunks dependencies as well once it
+ ;; comes back online.
+ (for-each (lambda (file)
+ (unless (member file (list "." ".." "go.cypherpunks.ru"))
+ (delete-file-recursively (string-append "src/vendor/" file))))
+ (scandir "src/vendor"))
+ ;; Delete built documentation.
+ (delete-file "doc/nncp.info")
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; tests fail
+ #:modules ((guix build gnu-build-system)
+ ((guix build go-build-system) #:prefix go:)
+ (guix build union)
+ (guix build utils))
+ #:imported-modules (,@%gnu-build-system-modules
+ (guix build union)
+ (guix build go-build-system))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'unpack 'setup-go-environment
+ (assoc-ref go:%standard-phases 'setup-go-environment))
+ (add-after 'unpack 'go-unpack
+ (lambda* (#:key source #:allow-other-keys)
+ ;; Copy source to GOPATH.
+ (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
+ ;; Move bundled dependencies to GOPATH.
+ (for-each (lambda (dependency)
+ (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
+ dependency)
+ (string-append "../src/go.cypherpunks.ru/"
+ dependency)))
+ (list "balloon" "recfile"))
+ ;; Delete empty bundled dependencies directory.
+ (delete-file-recursively "src/vendor")))
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Set output directories.
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "BINDIR" (string-append out "/bin"))
+ (setenv "INFODIR" (string-append out "/share/info"))
+ (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
+ ;; Remove module flags.
+ (substitute* (list "bin/default.do" "test.do")
+ ((" -mod=vendor") "")
+ ((" -m") "")))))))
+ (inputs
+ `(("go" ,go)))
+ (native-inputs
+ `(("texinfo" ,texinfo)))
+ (propagated-inputs
+ `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
+ ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
+ ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
+ ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
+ ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
+ ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
+ ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
+ ("go-golang-org-x-net" ,go-golang-org-x-net)
+ ("go-golang-org-x-term" ,go-golang-org-x-term)
+ ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
+ (home-page "http://www.nncpgo.org/")
+ (synopsis "Store and forward utilities")
+ (description "NNCP (Node to Node copy) is a collection of utilities
+simplifying secure store-and-forward files, mail and command exchanging.
+These utilities are intended to help build up small size (dozens of nodes)
+ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
+networks for fire-and-forget secure reliable files, file requests, Internet
+mail and commands transmission. All packets are integrity checked, end-to-end
+encrypted, explicitly authenticated by known participants public keys. Onion
+encryption is applied to relayed packets. Each node acts both as a client and
+server, can use push and poll behaviour model. Multicasting areas, offline
+sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
+storages, air-gapped computers and online TCP daemon with full-duplex
+resumable data transmission exists are all supported.")
+ (license gpl3)))
--
2.32.0
S
S
Sarah Morgensen wrote on 23 Jul 2021 01:38
Re: bug#49494: [PATCH 0/7] Add nncp
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 49494@debbugs.gnu.org)
86zgudrka9.fsf_-_@mgsn.dev
Hi,

Thanks for your patches.

Arun Isaac <arunisaac@systemreboot.net> writes:

Toggle quote (52 lines)
> * gnu/packages/golang.scm (go-github-com-klauspost-compress): New variable.
> ---
> gnu/packages/golang.scm | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
> index 5a7f27bc91..ef54e15afc 100644
> --- a/gnu/packages/golang.scm
> +++ b/gnu/packages/golang.scm
> @@ -67,6 +67,7 @@
> #:use-module (gnu packages perl)
> #:use-module (gnu packages pkg-config)
> #:use-module (gnu packages pulseaudio)
> + #:use-module (gnu packages syncthing)
> #:use-module (gnu packages terminals)
> #:use-module (gnu packages textutils)
> #:use-module (gnu packages tls)
> @@ -8352,3 +8353,39 @@ is a low-level framework for building crypto protocols. Noise protocols
> support mutual and optional authentication, identity hiding, forward secrecy,
> zero round-trip encryption, and other advanced features.")
> (license license:bsd-3)))
> +
> +(define-public go-github-com-klauspost-compress
> + (package
> + (name "go-github-com-klauspost-compress")
> + (version "1.13.1")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/klauspost/compress")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "0ydnf9rizlhm8rilh14674qqx272sbwbkjx06xn9pqvy6mmn2r3r"))))
> + (build-system go-build-system)
> + (arguments
> + `(#:import-path "github.com/klauspost/compress"
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'reset-gzip-timestamps 'fix-permissions
> + (lambda* (#:key outputs #:allow-other-keys)
> + ;; Provide write permissions on gzip files so that
> + ;; reset-gzip-timestamps has sufficient permissions.
> + (for-each (lambda (file)
> + (chmod file #o644))
> + (find-files (assoc-ref outputs "out")
> + (lambda (file stat)
> + (and (eq? 'regular (stat:type stat))
> + (string-suffix? ".gz" file))))))))))

You can simplify this with the Guix built-in MAKE-FILE-WRITABLE and
taking advantage of the facts that FIND-FILES can take a regex as PRED
and does not follow symlinks or return directories by default:

(for-each make-file-writable
(find-files (assoc-ref outputs "out") ".*\\.t?gz$"))


Toggle quote (6 lines)
> + (propagated-inputs
> + `(("go-github-com-golang-snappy" ,go-github-com-golang-snappy)))
> + (home-page "https://github.com/klauspost/compress")
> + (synopsis "Go compression library")
> + (description "@code{compress} provides various compression algorithms.")
> + (license license:bsd-3)))
S
S
Sarah Morgensen wrote on 23 Jul 2021 03:22
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 49494@debbugs.gnu.org)
86wnphrfhr.fsf_-_@mgsn.dev
Hi,

I have a few suggestions for this one as well.

Arun Isaac <arunisaac@systemreboot.net> writes:

Toggle quote (61 lines)
> * gnu/packages/uucp.scm (nncp): New variable.
> ---
> gnu/packages/uucp.scm | 99 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 99 insertions(+)
>
> diff --git a/gnu/packages/uucp.scm b/gnu/packages/uucp.scm
> index 1bb4fdb975..2d4d1ae8d0 100644
> --- a/gnu/packages/uucp.scm
> +++ b/gnu/packages/uucp.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -17,6 +18,8 @@
> ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
>
> (define-module (gnu packages uucp)
> + #:use-module (gnu packages golang)
> + #:use-module (gnu packages texinfo)
> #:use-module (guix licenses)
> #:use-module (guix packages)
> #:use-module (guix download)
> @@ -54,3 +57,99 @@
> set of utilities for remotely transferring files, email and net news
> between computers.")
> (license gpl2+)))
> +
> +(define-public nncp
> + (package
> + (name "nncp")
> + (version "7.2.0")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append "http://www.nncpgo.org/download/nncp-"
> + version ".tar.xz"))
> + (sha256
> + (base32
> + "0xsh5zc6i8nbcsi06r65lpp26hz2zb4vh0pzbkivdd69hrxvknvh"))
> + (modules '((ice-9 ftw)
> + (guix build utils)))
> + (snippet
> + '(begin
> + ;; Unbundle dependencies.
> + ;; TODO: go.cypherpunks.ru was down at the time of
> + ;; packaging. Unbundle go.cypherpunks dependencies as well once it
> + ;; comes back online.
> + (for-each (lambda (file)
> + (unless (member file (list "." ".." "go.cypherpunks.ru"))
> + (delete-file-recursively (string-append "src/vendor/" file))))
> + (scandir "src/vendor"))
> + ;; Delete built documentation.
> + (delete-file "doc/nncp.info")
> + #t))))
> + (build-system gnu-build-system)
> + (arguments
> + `(#:tests? #f ; tests fail

It is not a good idea to just disable tests without knowing why they
fail (and leaving a comment explaining why).

Toggle quote (3 lines)
> + #:modules ((guix build gnu-build-system)
> + ((guix build go-build-system) #:prefix go:)
> + (guix build union)
^ this module isn't necessary

Toggle quote (5 lines)
> + (guix build utils))
> + #:imported-modules (,@%gnu-build-system-modules
> + (guix build union)
> + (guix build go-build-system))

This can probably just be
#:imported-modules ,%go-build-system-modules

Toggle quote (25 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'unpack 'setup-go-environment
> + (assoc-ref go:%standard-phases 'setup-go-environment))
> + (add-after 'unpack 'go-unpack
> + (lambda* (#:key source #:allow-other-keys)
> + ;; Copy source to GOPATH.
> + (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
> + ;; Move bundled dependencies to GOPATH.
> + (for-each (lambda (dependency)
> + (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
> + dependency)
> + (string-append "../src/go.cypherpunks.ru/"
> + dependency)))
> + (list "balloon" "recfile"))
> + ;; Delete empty bundled dependencies directory.
> + (delete-file-recursively "src/vendor")))
> + (replace 'configure
> + (lambda* (#:key outputs #:allow-other-keys)
> + ;; Set output directories.
> + (let ((out (assoc-ref outputs "out")))
> + (setenv "BINDIR" (string-append out "/bin"))
> + (setenv "INFODIR" (string-append out "/share/info"))
> + (setenv "DOCDIR" (string-append out "/share/doc/nncp")))

Consider perhaps:
(setenv "DOCDIR" (string-append out "/share/doc/nncp"
,(package-version this-package)))

Does CFGPATH need to be set?

Toggle quote (5 lines)
> + ;; Remove module flags.
> + (substitute* (list "bin/default.do" "test.do")
> + ((" -mod=vendor") "")
> + ((" -m") "")))))))

I took a quick look at the source and it looks like you'll also need:

(substitute* '("src/toss_test.go" "src/pipe.go")
(("/bin/sh") (which "sh")))
(substitute* "src/toss_test.go"
(("; cat") (string-append "; " (which "cat"))))

Which also makes the tests succeed.

Toggle quote (16 lines)
> + (inputs
> + `(("go" ,go)))
> + (native-inputs
> + `(("texinfo" ,texinfo)))
> + (propagated-inputs
> + `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
> + ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
> + ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
> + ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
> + ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
> + ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
> + ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
> + ("go-golang-org-x-net" ,go-golang-org-x-net)
> + ("go-golang-org-x-term" ,go-golang-org-x-term)
> + ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))

Since this is an end-user package, these can be regular inputs.

I also notice that nncp can use `sendmail`; should `sendmail` be an
input as well?

Toggle quote (16 lines)
> + (home-page "http://www.nncpgo.org/")
> + (synopsis "Store and forward utilities")
> + (description "NNCP (Node to Node copy) is a collection of utilities
> +simplifying secure store-and-forward files, mail and command exchanging.
> +These utilities are intended to help build up small size (dozens of nodes)
> +ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
> +networks for fire-and-forget secure reliable files, file requests, Internet
> +mail and commands transmission. All packets are integrity checked, end-to-end
> +encrypted, explicitly authenticated by known participants public keys. Onion
> +encryption is applied to relayed packets. Each node acts both as a client and
> +server, can use push and poll behaviour model. Multicasting areas, offline
> +sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
> +storages, air-gapped computers and online TCP daemon with full-duplex
> +resumable data transmission exists are all supported.")
> + (license gpl3)))

This package is also retaining references to the Go compiler package;
re-adding this phase from go-build-system fixes that:

(add-after 'install 'remove-go-references
(assoc-ref go:%standard-phases 'remove-go-references))

--
Sarah
A
A
Arun Isaac wrote on 1 Aug 2021 22:16
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49494@debbugs.gnu.org)
87o8agapkl.fsf@systemreboot.net
Hi Sarah,

I have pushed patches 1-6 to master after implementing your suggestion
for patch 6 (klauspost-compress). I'm sending a WIP v2 of patch 7 (nncp)
in a following email. The tests are failing despite implementing your
suggestion. Any help in that regard would be much appreciated.

Toggle quote (5 lines)
>> +(define-public nncp
>> + (package
>> + (name "nncp")
>> + (version "7.2.0")

In patch v2, I have updated to the latest version 7.5.0.

Toggle quote (7 lines)
>> + (build-system gnu-build-system)
>> + (arguments
>> + `(#:tests? #f ; tests fail
>
> It is not a good idea to just disable tests without knowing why they
> fail (and leaving a comment explaining why).

True, I agree.

Toggle quote (6 lines)
>> + #:modules ((guix build gnu-build-system)
>> + ((guix build go-build-system) #:prefix go:)
>> + (guix build union)
> ^ this module isn't necessary
>

[...]

Toggle quote (8 lines)
>> + (guix build utils))
>> + #:imported-modules (,@%gnu-build-system-modules
>> + (guix build union)
>> + (guix build go-build-system))
>
> This can probably just be
> #:imported-modules ,%go-build-system-modules

Good catch! Implemented both suggestions.

Toggle quote (8 lines)
>> + (setenv "BINDIR" (string-append out "/bin"))
>> + (setenv "INFODIR" (string-append out "/share/info"))
>> + (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
>
> Consider perhaps:
> (setenv "DOCDIR" (string-append out "/share/doc/nncp"
> ,(package-version this-package)))

I've removed the version number from DOCDIR since that's what most
packages are doing. Even the configure phase of the gnu-build-system
does not put the version number in docdir. Only the
install-license-files of the gnu-build-system puts the version number
in, and that's probably a bug.

Toggle quote (2 lines)
> Does CFGPATH need to be set?

I have now set CFGPATH TO /etc/nncp.hjson.

Toggle quote (9 lines)
> I took a quick look at the source and it looks like you'll also need:
>
> (substitute* '("src/toss_test.go" "src/pipe.go")
> (("/bin/sh") (which "sh")))
> (substitute* "src/toss_test.go"
> (("; cat") (string-append "; " (which "cat"))))
>
> Which also makes the tests succeed.

Good catch, but tests still don't succeed (at least on my machine).

Toggle quote (3 lines)
>> + (inputs
>> + `(("go" ,go)))

I have moved go to native-inputs.

Toggle quote (16 lines)
>> + (native-inputs
>> + `(("texinfo" ,texinfo)))
>> + (propagated-inputs
>> + `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
>> + ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
>> + ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
>> + ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
>> + ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
>> + ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
>> + ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
>> + ("go-golang-org-x-net" ,go-golang-org-x-net)
>> + ("go-golang-org-x-term" ,go-golang-org-x-term)
>> + ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
>
> Since this is an end-user package, these can be regular inputs.

Done!

Toggle quote (3 lines)
> I also notice that nncp can use `sendmail`; should `sendmail` be an
> input as well?

I think sendmail need not be an input. There are many sendmail
compatible implementations and we can leave it up to the user to install
one in their profile and configure nncp accordingly.

Toggle quote (6 lines)
> This package is also retaining references to the Go compiler package;
> re-adding this phase from go-build-system fixes that:
>
> (add-after 'install 'remove-go-references
> (assoc-ref go:%standard-phases 'remove-go-references))

Done!

Thanks,
Arun
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmEHAQobHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuz5K8H/1/gJaj9LHz+a8Zvf4rC
oen7t8tFp+ov1kPn0BibeGYrXGihhRR7x3q2QPQUx05k41pvtCo4fsNCRN1RyNnT
2iSvlcZh8EUBJSBG25IHJAPoutf2/yg6AQzIkQeVR9giOcsaSaX3pxEYac7bysOe
8g8C0kMQiReFONA0RqsrYGX21VuSQIuCXASnspJlaBJWFTM1LbCh3BA0xd3QCfrc
aREgqsVlcOz01jW1JG63q7+B/lw4w/e9EXgoLEMlW0rSTJvkgXYS1jl6ZoJywv+p
3H57CFCYp0o8F4fKXnJ0zDXMlhq0aogHdKnYLBLsZM3lAtaysamVbPfls2eW4HUA
9Vs=
=0gk9
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 1 Aug 2021 22:19
[PATCH v2] gnu: Add nncp.
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)
20210801201942.27295-1-arunisaac@systemreboot.net
* gnu/packages/uucp.scm (nncp): New variable.
---
gnu/packages/uucp.scm | 110 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 109 insertions(+), 1 deletion(-)

Toggle diff (136 lines)
diff --git a/gnu/packages/uucp.scm b/gnu/packages/uucp.scm
index 1bb4fdb975..efc6665111 100644
--- a/gnu/packages/uucp.scm
+++ b/gnu/packages/uucp.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -17,10 +18,13 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages uucp)
+ #:use-module (gnu packages golang)
+ #:use-module (gnu packages texinfo)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
- #:use-module (guix build-system gnu))
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system go))
(define-public uucp
(package
@@ -54,3 +58,107 @@
set of utilities for remotely transferring files, email and net news
between computers.")
(license gpl2+)))
+
+(define-public nncp
+ (package
+ (name "nncp")
+ (version "7.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://www.nncpgo.org/download/nncp-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1r1zgj7gpkdmdm3wf31m0xi8y313kzd4dbyp4r4y8khnp32jvn8l"))
+ (modules '((ice-9 ftw)
+ (guix build utils)))
+ (snippet
+ '(begin
+ ;; Unbundle dependencies.
+ ;; TODO: go.cypherpunks.ru was down at the time of
+ ;; packaging. Unbundle go.cypherpunks dependencies as well once it
+ ;; comes back online.
+ (for-each (lambda (file)
+ (unless (member file (list "." ".." "go.cypherpunks.ru"))
+ (delete-file-recursively (string-append "src/vendor/" file))))
+ (scandir "src/vendor"))
+ ;; Delete built documentation.
+ (delete-file "doc/nncp.info")
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ ((guix build go-build-system) #:prefix go:)
+ (guix build utils))
+ #:imported-modules ,%go-build-system-modules
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'unpack 'setup-go-environment
+ (assoc-ref go:%standard-phases 'setup-go-environment))
+ (add-after 'unpack 'go-unpack
+ (lambda* (#:key source #:allow-other-keys)
+ ;; Copy source to GOPATH.
+ (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
+ ;; Move bundled dependencies to GOPATH.
+ (for-each (lambda (dependency)
+ (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
+ dependency)
+ (string-append "../src/go.cypherpunks.ru/"
+ dependency)))
+ (list "balloon" "recfile"))
+ ;; Delete empty bundled dependencies directory.
+ (delete-file-recursively "src/vendor")))
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Set configuration path.
+ (setenv "CFGPATH" "/etc/nncp.hjson")
+ ;; Set output directories.
+ (setenv "BINDIR" (string-append out "/bin"))
+ (setenv "INFODIR" (string-append out "/share/info"))
+ (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
+ ;; Set absolute store paths to sh and cat.
+ (substitute* (list "src/pipe.go" "src/toss_test.go")
+ (("/bin/sh") (which "sh")))
+ (substitute* "src/toss_test.go"
+ (("; cat") (string-append "; " (which "cat"))))
+ ;; Remove module flags.
+ (substitute* (list "bin/default.do" "bin/hjson-cli.do" "test.do")
+ ((" -mod=vendor") "")
+ ((" -m") ""))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "contrib/do" "-c" "test"))))
+ (add-after 'install 'remove-go-references
+ (assoc-ref go:%standard-phases 'remove-go-references)))))
+ (inputs
+ `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
+ ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
+ ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
+ ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
+ ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
+ ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
+ ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
+ ("go-golang-org-x-net" ,go-golang-org-x-net)
+ ("go-golang-org-x-term" ,go-golang-org-x-term)
+ ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
+ (native-inputs
+ `(("go" ,go)
+ ("texinfo" ,texinfo)))
+ (home-page "http://www.nncpgo.org/")
+ (synopsis "Store and forward utilities")
+ (description "NNCP (Node to Node copy) is a collection of utilities
+simplifying secure store-and-forward files, mail and command exchanging.
+These utilities are intended to help build up small size (dozens of nodes)
+ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
+networks for fire-and-forget secure reliable files, file requests, Internet
+mail and commands transmission. All packets are integrity checked, end-to-end
+encrypted, explicitly authenticated by known participants public keys. Onion
+encryption is applied to relayed packets. Each node acts both as a client and
+server, can use push and poll behaviour model. Multicasting areas, offline
+sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
+storages, air-gapped computers and online TCP daemon with full-duplex
+resumable data transmission exists are all supported.")
+ (license gpl3)))
--
2.32.0
S
S
Sarah Morgensen wrote on 2 Aug 2021 07:54
Re: bug#49494: [PATCH 0/7] Add nncp
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 49494@debbugs.gnu.org)
861r7c5r3v.fsf_-_@mgsn.dev
Hi,

Arun Isaac <arunisaac@systemreboot.net> writes:

Toggle quote (7 lines)
> Hi Sarah,
>
> I have pushed patches 1-6 to master after implementing your suggestion
> for patch 6 (klauspost-compress). I'm sending a WIP v2 of patch 7 (nncp)
> in a following email. The tests are failing despite implementing your
> suggestion. Any help in that regard would be much appreciated.

Your patch applies on master (fba107e), builds, and passes tests for me;
I'm on x86-64. What's your platform?

[...]

Toggle quote (6 lines)
> I've removed the version number from DOCDIR since that's what most
> packages are doing. Even the configure phase of the gnu-build-system
> does not put the version number in docdir. Only the
> install-license-files of the gnu-build-system puts the version number
> in, and that's probably a bug.

Hmm, something to investigate.

Toggle quote (5 lines)
>
>> Does CFGPATH need to be set?
>
> I have now set CFGPATH TO /etc/nncp.hjson.

When I run any of the executables, I get:

main.go:73: Error during initialization: stat /usr/local/etc/nncp.hjson:
no such file or directory

[...]

Toggle quote (7 lines)
>> I also notice that nncp can use `sendmail`; should `sendmail` be an
>> input as well?
>
> I think sendmail need not be an input. There are many sendmail
> compatible implementations and we can leave it up to the user to install
> one in their profile and configure nncp accordingly.

Makes sense.

Toggle quote (3 lines)
> Thanks,
> Arun

Glad to be of help :)

--
Sarah
A
A
Arun Isaac wrote on 2 Aug 2021 19:10
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49494@debbugs.gnu.org)
87im0nai37.fsf@systemreboot.net
Hi Sarah,

Toggle quote (3 lines)
> Your patch applies on master (fba107e), builds, and passes tests for me;
> I'm on x86-64. What's your platform?

I'm on x86_64 too. I tried on master eb46c6c5c8. I have attached the
complete build log. The tests seem to have timed out after 10
minutes. Could it be something to do with memory usage? I have 4 GB of
RAM.

Toggle quote (8 lines)
>> I've removed the version number from DOCDIR since that's what most
>> packages are doing. Even the configure phase of the gnu-build-system
>> does not put the version number in docdir. Only the
>> install-license-files of the gnu-build-system puts the version number
>> in, and that's probably a bug.
>
> Hmm, something to investigate.

Yes, a patch would be welcome. :-)

Toggle quote (9 lines)
>>> Does CFGPATH need to be set?
>>
>> I have now set CFGPATH TO /etc/nncp.hjson.
>
> When I run any of the executables, I get:
>
> main.go:73: Error during initialization: stat /usr/local/etc/nncp.hjson:
> no such file or directory

I couldn't reproduce this error message. Which command are you running?
But, I do see that the output of say `nncp-xfer` lists
/usr/local/etc/nncp.hjson as the default configuration path. I will
investigate.

Thanks!
Arun
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmEIJu0bHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuz7lsIAJZBGB2TNnmkqfcxJ+BX
BsYkBNNZaBe9lF+GTx8wqA8iiOzaX8RWkxqGUHdg3X5th0RPuJn7bn7ZNVeKboF5
PtrzMr/mENUPZ9m2A1KJlAK2XHgjgEzF3vfeHluWqlHu3MgsIA1Y+o2oHVMnHcZD
P/dJZqbtQptw6shdzUZhnfkJTHJsNqcejz34VhZZxYXvq8V0BAwKqPBJGRyfwjuV
xZQmwfptYvpKBz6Zx1iA2SwKCFFZol+vkBPWFpKbPr2tpJotBtRaEzeCgdS7JckW
oFdPy0Spso2KYSlbxjT8BnqkKLmvJedwvx8HKvfdH+7SFfHUSQjhlCqex7lTYWyP
ywU=
=8tYY
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 2 Aug 2021 20:33
Re: [bug#49494] [PATCH 0/7] Add nncp
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49494@debbugs.gnu.org)
87v94nzogj.fsf@systemreboot.net
Hi Sarah,

Toggle quote (8 lines)
>> Your patch applies on master (fba107e), builds, and passes tests for me;
>> I'm on x86-64. What's your platform?
>
> I'm on x86_64 too. I tried on master eb46c6c5c8. I have attached the
> complete build log. The tests seem to have timed out after 10
> minutes. Could it be something to do with memory usage? I have 4 GB of
> RAM.

I set up a tmpfs file system at /tmp. And, curiously, now the package
builds successfully. No idea why this is happening, though.

Toggle quote (14 lines)
>>>> Does CFGPATH need to be set?
>>>
>>> I have now set CFGPATH TO /etc/nncp.hjson.
>>
>> When I run any of the executables, I get:
>>
>> main.go:73: Error during initialization: stat /usr/local/etc/nncp.hjson:
>> no such file or directory
>
> I couldn't reproduce this error message. Which command are you running?
> But, I do see that the output of say `nncp-xfer` lists
> /usr/local/etc/nncp.hjson as the default configuration path. I will
> investigate.

That leaves only the CFGPATH issue. I'll figure it out and send a v3
patch.

Regards,
Arun
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmEIOmwbHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuzGYMH/iuo4aeFZjN6kEa5O93G
5azrYAxwFJRiGxHOnmPZ9aqhvzHZwKDBDy7wgpQLdc2FoLMlaa2/vfeyi87lNzZ3
T61tHV7wm/jhk3bzoOXnmY1WMBsccVIgp4SSGhcTr6BvGZ6FHhTJG32l2YSe4E0V
xx4fwXahpB/U5Wv4Weou3ORDDMI+aS6KGJRB6hZgaBe3VM0Haq9nWiSQ42DaCCqE
gycDB0GNt2luuOyWoO4pdXig9OnHmCUzvMWFcn/glX6g91OQJ0/ce1thQCG41r5w
SEUo3Bh6Vsmgfd+1UzHDqviewXuxUWYUiK7M7nF2OZzqCHQEw3GsD71In6ZA3I+Q
8lw=
=4GES
-----END PGP SIGNATURE-----

S
S
Sarah Morgensen wrote on 2 Aug 2021 20:40
Re: bug#49494: [PATCH 0/7] Add nncp
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 49494@debbugs.gnu.org)
86y29j4rlz.fsf_-_@mgsn.dev
Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> writes:

Toggle quote (13 lines)
> Hi Sarah,
>
>>> Your patch applies on master (fba107e), builds, and passes tests for me;
>>> I'm on x86-64. What's your platform?
>>
>> I'm on x86_64 too. I tried on master eb46c6c5c8. I have attached the
>> complete build log. The tests seem to have timed out after 10
>> minutes. Could it be something to do with memory usage? I have 4 GB of
>> RAM.
>
> I set up a tmpfs file system at /tmp. And, curiously, now the package
> builds successfully. No idea why this is happening, though.

I actually just figured this out as well. You're on a rotational disk,
aren't you? Since nncp makes heavy use of the spool file (which I think
it mocks in /tmp for testing), I think that's why your tests are taking
so long and timing out. Tests complete for me on a SSD in ~40s. (All the
error messages are red herrings; they're expected errors.) If this is
the case, it might be worth it to increase the test timeout for those
who use --no-substitutes.

Toggle quote (15 lines)
>
>>>>> Does CFGPATH need to be set?
>>>>
>>>> I have now set CFGPATH TO /etc/nncp.hjson.
>>>
>>> When I run any of the executables, I get:
>>>
>>> main.go:73: Error during initialization: stat /usr/local/etc/nncp.hjson:
>>> no such file or directory
>>
>> I couldn't reproduce this error message. Which command are you running?
>> But, I do see that the output of say `nncp-xfer` lists
>> /usr/local/etc/nncp.hjson as the default configuration path. I will
>> investigate.

Apologies, I got the error with `nncp-stat` and `nncp-check`.

Toggle quote (7 lines)
>
> That leaves only the CFGPATH issue. I'll figure it out and send a v3
> patch.
>
> Regards,
> Arun

--
Sarah
A
A
Arun Isaac wrote on 3 Aug 2021 22:12
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49494@debbugs.gnu.org)
87a6ly70dx.fsf@systemreboot.net
Hi Sarah,

Toggle quote (6 lines)
>> I set up a tmpfs file system at /tmp. And, curiously, now the package
>> builds successfully. No idea why this is happening, though.
>
> I actually just figured this out as well. You're on a rotational disk,
> aren't you?

Yep.

Toggle quote (7 lines)
> Since nncp makes heavy use of the spool file (which I think
> it mocks in /tmp for testing), I think that's why your tests are taking
> so long and timing out. Tests complete for me on a SSD in ~40s. (All the
> error messages are red herrings; they're expected errors.) If this is
> the case, it might be worth it to increase the test timeout for those
> who use --no-substitutes.

Indeed, that makes sense! I have now disabled the timeout. Without a
tmpfs, the tests take ~47 minutes on my rotational disk, but they do
complete successfully.

Toggle quote (9 lines)
>>>>>> Does CFGPATH need to be set?
>>>>>
>>>>> I have now set CFGPATH TO /etc/nncp.hjson.
>>>>
>>>> When I run any of the executables, I get:
>>>>
>>>> main.go:73: Error during initialization: stat /usr/local/etc/nncp.hjson:
>>>> no such file or directory

I fixed this as well. `go list` wasn't finding the correct module path,
and thus the correct cfgpath variable was not being set.

I'm sending a v3 of the patch. Let me know if everything looks good, and
I'll push. Thanks for the comprehensive review! :-) The package looks
much better now.

Regards,
Arun
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmEJo0obHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuz+/wIAIKvi4eal6b6jzjlFSJf
WhLYXGQWWr9ZfqCwbJNvRJGlPh3oATstwWvJIH8RFyoQrKsk8ZS1MbRLkUzxLKYI
WbinOzrK3KF37k0YJrsv6Jb7Gz12GD+loSVli/B9AoIwZw9HvGignJsQcrH9IOZ5
k6LuaV43gOhfg8LZEf3Vc2bdtdKMx1hPNb1EcoMQRQ5I/Q7jzM6joKbpHAMfsvxO
USvWVz6ix43GRF3dHHFHt5AK9PlvOaBVz5AwgtFJZEMDYm1rZY/k7xBvnylyipQ9
lwO+Jcf/96CP1mIaF48gELMXuXz/Nqu4+Pv4NO4tv4Di2MCIdLYE2Wocwse9RMjI
Wi8=
=YjY9
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 3 Aug 2021 22:16
[PATCH v3] gnu: Add nncp.
(address . 49494@debbugs.gnu.org)
20210803201617.19077-1-arunisaac@systemreboot.net
* gnu/packages/uucp.scm (nncp): New variable.
---
gnu/packages/uucp.scm | 118 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 117 insertions(+), 1 deletion(-)

Toggle diff (144 lines)
diff --git a/gnu/packages/uucp.scm b/gnu/packages/uucp.scm
index 1bb4fdb975..120417dea1 100644
--- a/gnu/packages/uucp.scm
+++ b/gnu/packages/uucp.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -17,10 +18,13 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages uucp)
+ #:use-module (gnu packages golang)
+ #:use-module (gnu packages texinfo)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
- #:use-module (guix build-system gnu))
+ #:use-module (guix build-system gnu)
+ #:use-module (guix build-system go))
(define-public uucp
(package
@@ -54,3 +58,115 @@
set of utilities for remotely transferring files, email and net news
between computers.")
(license gpl2+)))
+
+(define-public nncp
+ (package
+ (name "nncp")
+ (version "7.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://www.nncpgo.org/download/nncp-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1r1zgj7gpkdmdm3wf31m0xi8y313kzd4dbyp4r4y8khnp32jvn8l"))
+ (modules '((ice-9 ftw)
+ (guix build utils)))
+ (snippet
+ '(begin
+ ;; Unbundle dependencies.
+ ;; TODO: go.cypherpunks.ru was down at the time of
+ ;; packaging. Unbundle go.cypherpunks dependencies as well once it
+ ;; comes back online.
+ (for-each (lambda (file)
+ (unless (member file (list "." ".." "go.cypherpunks.ru"))
+ (delete-file-recursively (string-append "src/vendor/" file))))
+ (scandir "src/vendor"))
+ ;; Delete built documentation.
+ (delete-file "doc/nncp.info")
+ #t))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ ((guix build go-build-system) #:prefix go:)
+ (guix build utils))
+ #:imported-modules ,%go-build-system-modules
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'unpack 'setup-go-environment
+ (assoc-ref go:%standard-phases 'setup-go-environment))
+ (add-after 'unpack 'go-unpack
+ (lambda* (#:key source #:allow-other-keys)
+ ;; Copy source to GOPATH.
+ (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
+ ;; Move bundled dependencies to GOPATH.
+ (for-each (lambda (dependency)
+ (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
+ dependency)
+ (string-append "../src/go.cypherpunks.ru/"
+ dependency)))
+ (list "balloon" "recfile"))
+ ;; Delete empty bundled dependencies directory.
+ (delete-file-recursively "src/vendor")))
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; Set configuration path.
+ (setenv "CFGPATH" "/etc/nncp.hjson")
+ ;; Set output directories.
+ (setenv "BINDIR" (string-append out "/bin"))
+ (setenv "INFODIR" (string-append out "/share/info"))
+ (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
+ ;; Set absolute store paths to sh and cat.
+ (substitute* (list "src/pipe.go" "src/toss_test.go")
+ (("/bin/sh") (which "sh")))
+ (substitute* "src/toss_test.go"
+ (("; cat") (string-append "; " (which "cat"))))
+ ;; Remove module flags.
+ (substitute* (list "bin/default.do" "bin/hjson-cli.do" "test.do")
+ ((" -mod=vendor") "")
+ ((" -m") ""))
+ ;; Use the correct module path. `go list` does not report the
+ ;; correct module path since we have moved the source files.
+ (substitute* "bin/default.do"
+ (("^mod=[^\n]*" all) "mod=go.cypherpunks.ru/nncp/v7"))
+ ;; Disable timeout in tests. Tests can take longer than the
+ ;; default timeout on spinning disks.
+ (substitute* "test.do"
+ (("test") "test -timeout 0"))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "contrib/do" "-c" "test"))))
+ (add-after 'install 'remove-go-references
+ (assoc-ref go:%standard-phases 'remove-go-references)))))
+ (inputs
+ `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
+ ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
+ ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
+ ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
+ ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
+ ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
+ ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
+ ("go-golang-org-x-net" ,go-golang-org-x-net)
+ ("go-golang-org-x-term" ,go-golang-org-x-term)
+ ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
+ (native-inputs
+ `(("go" ,go)
+ ("texinfo" ,texinfo)))
+ (home-page "http://www.nncpgo.org/")
+ (synopsis "Store and forward utilities")
+ (description "NNCP (Node to Node copy) is a collection of utilities
+simplifying secure store-and-forward files, mail and command exchanging.
+These utilities are intended to help build up small size (dozens of nodes)
+ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
+networks for fire-and-forget secure reliable files, file requests, Internet
+mail and commands transmission. All packets are integrity checked, end-to-end
+encrypted, explicitly authenticated by known participants public keys. Onion
+encryption is applied to relayed packets. Each node acts both as a client and
+server, can use push and poll behaviour model. Multicasting areas, offline
+sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
+storages, air-gapped computers and online TCP daemon with full-duplex
+resumable data transmission exists are all supported.")
+ (license gpl3)))
--
2.32.0
S
S
Sarah Morgensen wrote on 3 Aug 2021 23:40
Re: bug#49494: [PATCH 0/7] Add nncp
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 49494@debbugs.gnu.org)
86y29i2om1.fsf_-_@mgsn.dev
Hi,

Arun Isaac <arunisaac@systemreboot.net> writes:

Toggle quote (148 lines)
> * gnu/packages/uucp.scm (nncp): New variable.
> ---
> gnu/packages/uucp.scm | 118 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 117 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/uucp.scm b/gnu/packages/uucp.scm
> index 1bb4fdb975..120417dea1 100644
> --- a/gnu/packages/uucp.scm
> +++ b/gnu/packages/uucp.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
> +;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -17,10 +18,13 @@
> ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
>
> (define-module (gnu packages uucp)
> + #:use-module (gnu packages golang)
> + #:use-module (gnu packages texinfo)
> #:use-module (guix licenses)
> #:use-module (guix packages)
> #:use-module (guix download)
> - #:use-module (guix build-system gnu))
> + #:use-module (guix build-system gnu)
> + #:use-module (guix build-system go))
>
> (define-public uucp
> (package
> @@ -54,3 +58,115 @@
> set of utilities for remotely transferring files, email and net news
> between computers.")
> (license gpl2+)))
> +
> +(define-public nncp
> + (package
> + (name "nncp")
> + (version "7.5.0")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append "http://www.nncpgo.org/download/nncp-"
> + version ".tar.xz"))
> + (sha256
> + (base32
> + "1r1zgj7gpkdmdm3wf31m0xi8y313kzd4dbyp4r4y8khnp32jvn8l"))
> + (modules '((ice-9 ftw)
> + (guix build utils)))
> + (snippet
> + '(begin
> + ;; Unbundle dependencies.
> + ;; TODO: go.cypherpunks.ru was down at the time of
> + ;; packaging. Unbundle go.cypherpunks dependencies as well once it
> + ;; comes back online.
> + (for-each (lambda (file)
> + (unless (member file (list "." ".." "go.cypherpunks.ru"))
> + (delete-file-recursively (string-append "src/vendor/" file))))
> + (scandir "src/vendor"))
> + ;; Delete built documentation.
> + (delete-file "doc/nncp.info")
> + #t))))
> + (build-system gnu-build-system)
> + (arguments
> + `(#:modules ((guix build gnu-build-system)
> + ((guix build go-build-system) #:prefix go:)
> + (guix build utils))
> + #:imported-modules ,%go-build-system-modules
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'unpack 'setup-go-environment
> + (assoc-ref go:%standard-phases 'setup-go-environment))
> + (add-after 'unpack 'go-unpack
> + (lambda* (#:key source #:allow-other-keys)
> + ;; Copy source to GOPATH.
> + (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
> + ;; Move bundled dependencies to GOPATH.
> + (for-each (lambda (dependency)
> + (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
> + dependency)
> + (string-append "../src/go.cypherpunks.ru/"
> + dependency)))
> + (list "balloon" "recfile"))
> + ;; Delete empty bundled dependencies directory.
> + (delete-file-recursively "src/vendor")))
> + (replace 'configure
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out")))
> + ;; Set configuration path.
> + (setenv "CFGPATH" "/etc/nncp.hjson")
> + ;; Set output directories.
> + (setenv "BINDIR" (string-append out "/bin"))
> + (setenv "INFODIR" (string-append out "/share/info"))
> + (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
> + ;; Set absolute store paths to sh and cat.
> + (substitute* (list "src/pipe.go" "src/toss_test.go")
> + (("/bin/sh") (which "sh")))
> + (substitute* "src/toss_test.go"
> + (("; cat") (string-append "; " (which "cat"))))
> + ;; Remove module flags.
> + (substitute* (list "bin/default.do" "bin/hjson-cli.do" "test.do")
> + ((" -mod=vendor") "")
> + ((" -m") ""))
> + ;; Use the correct module path. `go list` does not report the
> + ;; correct module path since we have moved the source files.
> + (substitute* "bin/default.do"
> + (("^mod=[^\n]*" all) "mod=go.cypherpunks.ru/nncp/v7"))
> + ;; Disable timeout in tests. Tests can take longer than the
> + ;; default timeout on spinning disks.
> + (substitute* "test.do"
> + (("test") "test -timeout 0"))))
> + (replace 'check
> + (lambda* (#:key tests? #:allow-other-keys)
> + (when tests?
> + (invoke "contrib/do" "-c" "test"))))
> + (add-after 'install 'remove-go-references
> + (assoc-ref go:%standard-phases 'remove-go-references)))))
> + (inputs
> + `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
> + ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
> + ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
> + ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
> + ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
> + ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
> + ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
> + ("go-golang-org-x-net" ,go-golang-org-x-net)
> + ("go-golang-org-x-term" ,go-golang-org-x-term)
> + ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
> + (native-inputs
> + `(("go" ,go)
> + ("texinfo" ,texinfo)))
> + (home-page "http://www.nncpgo.org/")
> + (synopsis "Store and forward utilities")
> + (description "NNCP (Node to Node copy) is a collection of utilities
> +simplifying secure store-and-forward files, mail and command exchanging.
> +These utilities are intended to help build up small size (dozens of nodes)
> +ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
> +networks for fire-and-forget secure reliable files, file requests, Internet
> +mail and commands transmission. All packets are integrity checked, end-to-end
> +encrypted, explicitly authenticated by known participants public keys. Onion
> +encryption is applied to relayed packets. Each node acts both as a client and
> +server, can use push and poll behaviour model. Multicasting areas, offline
> +sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
> +storages, air-gapped computers and online TCP daemon with full-duplex
> +resumable data transmission exists are all supported.")
> + (license gpl3)))

This LGTM!

--
Sarah
A
A
Arun Isaac wrote on 4 Aug 2021 08:42
(name . Sarah Morgensen)(address . iskarian@mgsn.dev)(address . 49494-done@debbugs.gnu.org)
874kc57ltq.fsf@systemreboot.net
Pushed to master!
-----BEGIN PGP SIGNATURE-----

iQFPBAEBCAA5FiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAmEKNsEbHGFydW5pc2Fh
Y0BzeXN0ZW1yZWJvb3QubmV0AAoJEC4l7othgCuzqcAH/33L30a7RRs/FlKfYC5H
ckfICvsv0NZ4ZJeH+HRtjZNTYeAqB2wxNJ9x1PRQGC8IxoeShBQSwRItfcf6OcR5
m1ObXKL8pkYsNvYT0XJrmvDUPXcLLyKR6X07lwiyqIM9BL+jaCY3SX33TqMM+A76
KQ7kCNI/pWqWJCfOuvyudHfqERaDopKkZgTvECOtnStT7f+jEfempMB+gKsr14ji
PghK9GE83WTfzBe1kHdWp0uPf767eijPTz2NwYRxjshiCwr+KDjHb6wMC3LYJrk/
cbpXwE2Ei/xvgaolqMxSIRrT4XyMtxnVcFS3+rEDU829v0LxMA5UV5cqLpVefiJ5
ufo=
=uskJ
-----END PGP SIGNATURE-----

Closed
?