GNU bug report logs - #49494
[PATCH 0/7] Add nncp

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Fri, 9 Jul 2021 16:13:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49494 in the body.
You can then email your comments to 49494 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arun Isaac <arunisaac <at> systemreboot.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 09 Jul 2021 16:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: guix-patches <at> gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 0/7] Add nncp
Date: Fri,  9 Jul 2021 21:42:02 +0530
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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 2/7] gnu: Add go-github-com-dustin-go-humanize.
Date: Fri,  9 Jul 2021 21:49:35 +0530
* gnu/packages/golang.scm (go-github-com-dustin-go-humanize): New variable.
---
 gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 1/7] gnu: Add go-github-com-davecgh-go-xdr.
Date: Fri,  9 Jul 2021 21:49:34 +0530
* gnu/packages/golang.scm (go-github-com-davecgh-go-xdr): New variable.
---
 gnu/packages/golang.scm | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

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 <at> gmail.com>
 ;;; Copyright © 2019 Giovanni Biscuolo <g <at> xelera.eu>
 ;;; Copyright © 2019, 2020 Alex Griffin <a <at> ajgrf.com>
-;;; Copyright © 2019, 2020 Arun Isaac <arunisaac <at> systemreboot.net>
+;;; Copyright © 2019, 2020, 2021 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2020 Jack Hill <jackhill <at> jackhill.us>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;; Copyright © 2020 Nicolas Goaziou <mail <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:02 GMT) Full text and rfc822 format available.

Message #14 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 3/7] gnu: Add go-lukechampine-com-blake3.
Date: Fri,  9 Jul 2021 21:49:36 +0530
* gnu/packages/golang.scm (go-lukechampine-com-blake3): New variable.
---
 gnu/packages/golang.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:03 GMT) Full text and rfc822 format available.

Message #17 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 6/7] gnu: Add go-github-com-klauspost-compress.
Date: Fri,  9 Jul 2021 21:49:39 +0530
* 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))))))))))
+    (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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:03 GMT) Full text and rfc822 format available.

Message #20 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 4/7] gnu: Add go-golang-org-x-term.
Date: Fri,  9 Jul 2021 21:49:37 +0530
* gnu/packages/golang.scm (go-golang-org-x-term): New variable.
---
 gnu/packages/golang.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:04 GMT) Full text and rfc822 format available.

Message #23 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 5/7] gnu: Add go-github-com-flynn-noise.
Date: Fri,  9 Jul 2021 21:49:38 +0530
* gnu/packages/golang.scm (go-github-com-flynn-noise): New variable.
---
 gnu/packages/golang.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 09 Jul 2021 16:20:04 GMT) Full text and rfc822 format available.

Message #26 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 49494 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 7/7] gnu: Add nncp.
Date: Fri,  9 Jul 2021 21:49:40 +0530
* 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 <at> gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Thu, 22 Jul 2021 23:39:01 GMT) Full text and rfc822 format available.

Message #29 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Thu, 22 Jul 2021 16:38:54 -0700
Hi,

Thanks for your patches.

Arun Isaac <arunisaac <at> systemreboot.net> writes:

> * 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$"))


> +    (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)))




Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Fri, 23 Jul 2021 01:23:01 GMT) Full text and rfc822 format available.

Message #32 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Thu, 22 Jul 2021 18:22:24 -0700
Hi,

I have a few suggestions for this one as well.

Arun Isaac <arunisaac <at> systemreboot.net> writes:

> * 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 <at> gnu.org>
> +;;; Copyright © 2021 Arun Isaac <arunisaac <at> 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). 

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

> +                  (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

> +       #: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?

> +             ;; 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.

> +    (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?

> +    (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




Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Sun, 01 Aug 2021 20:17:02 GMT) Full text and rfc822 format available.

Message #35 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Mon, 02 Aug 2021 01:46:10 +0530
[Message part 1 (text/plain, inline)]
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.

>> +(define-public nncp
>> +  (package
>> +    (name "nncp")
>> +    (version "7.2.0")

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

>> +    (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.

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

[...]

>> +                  (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.

>> +               (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.

> Does CFGPATH need to be set?

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

> 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).

>> +    (inputs
>> +     `(("go" ,go)))

I have moved go to native-inputs.

>> +    (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!

> 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.

> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Sun, 01 Aug 2021 20:20:01 GMT) Full text and rfc822 format available.

Message #38 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 49494 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: Add nncp.
Date: Mon,  2 Aug 2021 01:49:42 +0530
* gnu/packages/uucp.scm (nncp): New variable.
---
 gnu/packages/uucp.scm | 110 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 109 insertions(+), 1 deletion(-)

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 <at> gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Mon, 02 Aug 2021 05:55:02 GMT) Full text and rfc822 format available.

Message #41 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Sun, 01 Aug 2021 22:54:12 -0700
Hi,

Arun Isaac <arunisaac <at> systemreboot.net> writes:

> 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?

[...]

> 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.

>
>> 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 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.

> Thanks,
> Arun

Glad to be of help :)

--
Sarah




Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Mon, 02 Aug 2021 17:11:02 GMT) Full text and rfc822 format available.

Message #44 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Mon, 02 Aug 2021 22:40:04 +0530
[Message part 1 (text/plain, inline)]
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'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. :-)

>>> 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

[nncp-test-failure.gz (application/octet-stream, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Mon, 02 Aug 2021 18:34:01 GMT) Full text and rfc822 format available.

Message #47 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: [bug#49494] [PATCH 0/7] Add nncp
Date: Tue, 03 Aug 2021 00:03:16 +0530
[Message part 1 (text/plain, inline)]
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.

>>>> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Mon, 02 Aug 2021 18:42:01 GMT) Full text and rfc822 format available.

Message #50 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Mon, 02 Aug 2021 11:40:56 -0700
Hi Arun,

Arun Isaac <arunisaac <at> systemreboot.net> writes:

> 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.

>
>>>>> 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`.

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

--
Sarah




Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Tue, 03 Aug 2021 20:14:02 GMT) Full text and rfc822 format available.

Message #53 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Wed, 04 Aug 2021 01:42:58 +0530
[Message part 1 (text/plain, inline)]
Hi Sarah,

>> 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.

> 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.

>>>>>> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Tue, 03 Aug 2021 20:17:02 GMT) Full text and rfc822 format available.

Message #56 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: [PATCH v3] gnu: Add nncp.
Date: Wed,  4 Aug 2021 01:46:17 +0530
* 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 <at> gnu.org>
+;;; Copyright © 2021 Arun Isaac <arunisaac <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#49494; Package guix-patches. (Tue, 03 Aug 2021 21:42:01 GMT) Full text and rfc822 format available.

Message #59 received at 49494 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 49494 <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Tue, 03 Aug 2021 14:40:54 -0700
Hi,

Arun Isaac <arunisaac <at> systemreboot.net> writes:

> * 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 <at> gnu.org>
> +;;; Copyright © 2021 Arun Isaac <arunisaac <at> 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




Reply sent to Arun Isaac <arunisaac <at> systemreboot.net>:
You have taken responsibility. (Wed, 04 Aug 2021 06:43:02 GMT) Full text and rfc822 format available.

Notification sent to Arun Isaac <arunisaac <at> systemreboot.net>:
bug acknowledged by developer. (Wed, 04 Aug 2021 06:43:02 GMT) Full text and rfc822 format available.

Message #64 received at 49494-done <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Sarah Morgensen <iskarian <at> mgsn.dev>
Cc: 49494-done <at> debbugs.gnu.org
Subject: Re: bug#49494: [PATCH 0/7] Add nncp
Date: Wed, 04 Aug 2021 12:12:09 +0530
[Message part 1 (text/plain, inline)]
Pushed to master!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Sep 2021 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.