all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: Sarah Morgensen <iskarian@mgsn.dev>
Cc: Arun Isaac <arunisaac@systemreboot.net>, 49494@debbugs.gnu.org
Subject: [bug#49494] [PATCH v2] gnu: Add nncp.
Date: Mon,  2 Aug 2021 01:49:42 +0530	[thread overview]
Message-ID: <20210801201942.27295-1-arunisaac@systemreboot.net> (raw)
In-Reply-To: <87o8agapkl.fsf@systemreboot.net>

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





  reply	other threads:[~2021-08-01 20:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 16:12 [bug#49494] [PATCH 0/7] Add nncp Arun Isaac
2021-07-09 16:19 ` [bug#49494] [PATCH 1/7] gnu: Add go-github-com-davecgh-go-xdr Arun Isaac
2021-07-09 16:19   ` [bug#49494] [PATCH 2/7] gnu: Add go-github-com-dustin-go-humanize Arun Isaac
2021-07-09 16:19   ` [bug#49494] [PATCH 3/7] gnu: Add go-lukechampine-com-blake3 Arun Isaac
2021-07-09 16:19   ` [bug#49494] [PATCH 4/7] gnu: Add go-golang-org-x-term Arun Isaac
2021-07-09 16:19   ` [bug#49494] [PATCH 5/7] gnu: Add go-github-com-flynn-noise Arun Isaac
2021-07-09 16:19   ` [bug#49494] [PATCH 6/7] gnu: Add go-github-com-klauspost-compress Arun Isaac
2021-07-22 23:38     ` [bug#49494] [PATCH 0/7] Add nncp Sarah Morgensen
2021-07-09 16:19   ` [bug#49494] [PATCH 7/7] gnu: " Arun Isaac
2021-07-23  1:22     ` [bug#49494] [PATCH 0/7] " Sarah Morgensen
2021-08-01 20:16       ` Arun Isaac
2021-08-01 20:19         ` Arun Isaac [this message]
2021-08-02  5:54         ` Sarah Morgensen
2021-08-02 17:10           ` Arun Isaac
2021-08-02 18:33             ` Arun Isaac
2021-08-02 18:40               ` Sarah Morgensen
2021-08-03 20:12                 ` Arun Isaac
2021-08-03 20:16                 ` [bug#49494] [PATCH v3] gnu: " Arun Isaac
2021-08-03 21:40                   ` [bug#49494] [PATCH 0/7] " Sarah Morgensen
2021-08-04  6:42                     ` bug#49494: " Arun Isaac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210801201942.27295-1-arunisaac@systemreboot.net \
    --to=arunisaac@systemreboot.net \
    --cc=49494@debbugs.gnu.org \
    --cc=iskarian@mgsn.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.