From patchwork Sun Aug 1 20:19:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 31682 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 98F0027BC78; Sun, 1 Aug 2021 21:20:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EF0EA27BC6B for ; Sun, 1 Aug 2021 21:20:10 +0100 (BST) Received: from localhost ([::1]:38708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAHwQ-00080o-2N for patchwork@mira.cbaines.net; Sun, 01 Aug 2021 16:20:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAHwI-0007yS-39 for guix-patches@gnu.org; Sun, 01 Aug 2021 16:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAHwH-0000ba-Qd for guix-patches@gnu.org; Sun, 01 Aug 2021 16:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAHwH-0004SL-NT for guix-patches@gnu.org; Sun, 01 Aug 2021 16:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49494] [PATCH v2] gnu: Add nncp. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 Aug 2021 20:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49494 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: Arun Isaac , 49494@debbugs.gnu.org Received: via spool by 49494-submit@debbugs.gnu.org id=B49494.162784919717114 (code B ref 49494); Sun, 01 Aug 2021 20:20:01 +0000 Received: (at 49494) by debbugs.gnu.org; 1 Aug 2021 20:19:57 +0000 Received: from localhost ([127.0.0.1]:36990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAHw5-0004Rp-Lp for submit@debbugs.gnu.org; Sun, 01 Aug 2021 16:19:57 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:46266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAHw3-0004Re-Ay for 49494@debbugs.gnu.org; Sun, 01 Aug 2021 16:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SnZlX6YPO/SgOAa0gKELme/baXou0c6V7X+19PjCpio=; b=PNwRfvvNFbnJgtwYFmc//jd0Or oe9dSm5TR3dqQcVhPXJ9bMbxLcSIN+BnPTgxd07YsMCeeJOBBBlW6GE513XKUyYQQQHs4Fm0weJzC mGtJsFo2B2Sb8MY0VWhc5bKYMX7R8X3kAAU1QePwd8lkoNod7gtYzvSmSIKPFofhv3PEEUf67zBbm Jzjxzkwyq9Fe2+1xhI8U/zqj+xoCHRf/9P6D0F4Eym/kO6HxBHShr9QQEk7/UB+67yYjDbrKp2UmR mqMYXb4+LW4N/2DixsmWZoeo+zam10Jqjm0+3aDU1cI77P7KeZaquy8AcKlgvRVf/MfLwNTy7qJd3 Z2JW39pA==; Received: from [192.168.2.1] (helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mAHw0-0003CW-Qg; Mon, 02 Aug 2021 01:49:44 +0530 From: Arun Isaac Date: Mon, 2 Aug 2021 01:49:42 +0530 Message-Id: <20210801201942.27295-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <87o8agapkl.fsf@systemreboot.net> References: <87o8agapkl.fsf@systemreboot.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 +;;; Copyright © 2021 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -17,10 +18,13 @@ ;;; along with GNU Guix. If not, see . (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)))