From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 22 21:22:38 2021 Received: (at 49494) by debbugs.gnu.org; 23 Jul 2021 01:22:38 +0000 Received: from localhost ([127.0.0.1]:41901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6jtX-0003jG-3g for submit@debbugs.gnu.org; Thu, 22 Jul 2021 21:22:38 -0400 Received: from out0.migadu.com ([94.23.1.103]:35338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6jtU-0003j6-Ea for 49494@debbugs.gnu.org; Thu, 22 Jul 2021 21:22:30 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1627003346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Yd4YXiCSQjboyKQ/jkkwbqTeJbsZdi0XLfvvdaqRpY=; b=J9fEE27r0LR4YCgiQIQNY+3CYXLHnMmxoBTd5t1Kbg9jJI4SM+eVPHj2r16zlyEkiBSQeN CW3v9CNMVK7hBnnalKvSQbXfPnRqAe7miObQfCj/5AKWcGmp9rChm8EOA3y20h7HZzJ+zh jqBbnqD9A7JO3PQRCpAzznhsB5FVyfs= From: Sarah Morgensen To: Arun Isaac Subject: Re: bug#49494: [PATCH 0/7] Add nncp References: <20210709161940.12759-1-arunisaac@systemreboot.net> <20210709161940.12759-7-arunisaac@systemreboot.net> Date: Thu, 22 Jul 2021 18:22:24 -0700 In-Reply-To: <20210709161940.12759-7-arunisaac@systemreboot.net> (Arun Isaac's message of "Fri, 9 Jul 2021 21:49:40 +0530") Message-ID: <86wnphrfhr.fsf_-_@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49494 Cc: 49494@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, I have a few suggestions for this one as well. Arun Isaac 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 =C2=A9 2014 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2021 Arun Isaac > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -17,6 +18,8 @@ > ;;; along with GNU Guix. If not, see . >=20=20 > (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 on= ce it > + ;; comes back online. > + (for-each (lambda (file) > + (unless (member file (list "." ".." "go.cypherpun= ks.ru")) > + (delete-file-recursively (string-append "src/ve= ndor/" 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).=20 > + #: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.cyph= erpunks.ru/" > + dependency) > + (string-append "../src/go.cypherpu= nks.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=3Dvendor") "") > + ((" -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-huma= nize) > + ("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-comp= ress) > + ("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 node= s) > +ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant > +networks for fire-and-forget secure reliable files, file requests, Inter= net > +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 clie= nt and > +server, can use push and poll behaviour model. Multicasting areas, offl= ine > +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