aboutsummaryrefslogtreecommitdiff
;;; 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.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; 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 golang-build)
  #:use-module (gnu packages golang-compression)
  #:use-module (gnu packages golang-crypto)
  #:use-module (gnu packages golang-web)
  #: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 go))

(define-public uucp
  (package
    (name "uucp")
    (version "1.07")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/uucp/uucp-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "0b5nhl9vvif1w3wdipjsk8ckw49jj1w85xw1mmqi3zbcpazia306"))))
    (build-system gnu-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (replace 'configure
           (lambda* (#:key outputs #:allow-other-keys)
             ;; The old 'configure' script doesn't support the arguments
             ;; that we pass by default.
             (setenv "CONFIG_SHELL" (which "sh"))
             (let ((out (assoc-ref outputs "out")))
               (invoke "./configure"
                       (string-append "--prefix=" out)
                       (string-append "--infodir=" out
                                      "/share/info"))))))))
    (home-page "https://www.gnu.org/software/uucp/uucp.html")
    (synopsis "UUCP protocol implementation")
    (description
     "Taylor UUCP is the GNU implementation of UUCP (Unix-to-Unix Copy), a
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")))
               (setenv "GO_LDFLAGS" "-trimpath")
               ;; 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")))))))
    (inputs
     (list go-github-com-davecgh-go-xdr
           go-github-com-dustin-go-humanize
           go-github-com-flynn-noise
           go-github-com-gorhill-cronexpr
           go-github-com-hjson-hjson-go-v4
           go-github-com-klauspost-compress
           go-golang-org-x-crypto
           go-golang-org-x-net
           go-golang-org-x-term
           go-lukechampine-com-blake3))
    (native-inputs
     (list go 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)))
mon.ac?id=888b64038db00c73467a05320c7c7f03070e5621'>build: Remove -L flag when $LIBGCRYPT_LIBDIR is empty.Ludovic Courtès Reported by Alex Vong <alexvong1995@gmail.com>. * config-daemon.ac: Do not add "-L$LIBGCRYPT_LIBDIR" to LIBGCRYPT_LIBS when "$LIBGCRYPT_LIBDIR" is empty. 2018-03-05build: Default to berlin.guixsd.org substitutes on aarch64.Ludovic Courtès Suggested by Efraim Flashner <efraim@flashner.co.il>. * config-daemon.ac: Set 'guix_substitute_urls' to berlin.guixsd.org on aarch64. 2018-03-05build: Always use https substitute URLs.Ludovic Courtès * config-daemon.ac: Remove GUILE_MODULE_AVAILABLE check for (gnutls). 2018-02-27build: Really build 'guix offload' when possible.Ludovic Courtès This fixes a regression introduced in 1d84d7bf6052c0c80bd212d4524876576e9817d4, whereby HAVE_DAEMON_OFFLOAD_HOOK would never be defined. * config-daemon.ac: Do not check for $ac_cv_guix_cbips_support_setvbuf, which no longer exists. 2018-02-26build: Require Guile >= 2.0.13.Ludovic Courtès * README, configure.ac, doc/guix.texi (Requirements): Increase minimum Guile version from 2.0.9 to 2.0.13. * config-daemon.ac: Remove use of 'GUIX_CHECK_UNBUFFERED_CBIP'. * m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): Remove. * guix/build/download.scm (current-http-proxy): Remove. * guix/build/syscalls.scm (%libc-errno-pointer, errno): Remove. (syscall->procedure): Use #:return-errno unconditionally. * guix/hash.scm (open-sha256-input-port)[unbuffered]: Remove outdated comment. * guix/http-client.scm (when-guile<=2.0.5-or-otherwise-broken): Remove. <top level>: Remove 'when-guile<=2.0.5-or-otherwise-broken' block. * guix/scripts/substitute.scm (fetch): Remove 'guile-version>?' conditional. * tests/hash.scm (supports-unbuffered-cbip?): Remove. <top level>: Remove 'test-skip' call. 2018-01-07daemon: Make libbz2 an optional dependency.Ludovic Courtès * config-daemon.ac: Don't bail out when libbz2 is missing. Define 'HAVE_LIBBZ2' Automake conditional. * nix/libstore/build.cc: Wrap relevant bits in '#if HAVE_BZLIB_H'. * nix/libstore/globals.cc (Settings::Settings): 'logCompression' defaults to COMPRESSION_GZIP when HAVE_BZLIB_H is false. * nix/libstore/globals.hh (CompressionType): Make 'COMPRESSION_BZIP2' conditional on HAVE_BZLIB_H. * nix/local.mk (guix_register_LDADD, guix_daemon_LDADD): Add -lbz2 only when HAVE_LIBBZ2. * nix/nix-daemon/guix-daemon.cc (parse_opt): Ignore "bzip2" when not HAVE_BZLIB_H. 2018-01-07daemon: Add gzip log compression.Ludovic Courtès * nix/nix-daemon/guix-daemon.cc (GUIX_OPT_LOG_COMPRESSION): New macro. (options): Mark "disable-log-compression" as hidden and add "log-compression". (parse_opt): Handle GUIX_OPT_LOG_COMPRESSION. * nix/libstore/build.cc (DerivationGoal): Add 'gzLogFile'. (openLogFile): Initialize it when 'logCompression' is COMPRESSION_GZIP. (closeLogFile, handleChildOutput): Honor 'gzLogFile'. * nix/libstore/globals.hh (Settings)[compressLog]: Remove. [logCompression]: New field. (CompressionType): New enum. * nix/libstore/globals.cc (Settings::Settings): Initialize it. (update): Remove '_get' call for 'compressLog'. * nix/local.mk (guix_daemon_LDADD, guix_register_LDADD): Add -lz. * guix/store.scm (log-file): Handle '.gz' log files. * tests/guix-daemon.sh: Add test with '--log-compression=gzip'. * doc/guix.texi (Invoking guix-daemon): Adjust accordingly. * config-daemon.ac: Check for libz and zlib.h. 2017-02-06config-daemon.ac: detect host ARSergei Trofimovich The problem is seen when we try to use explicit host: ./configure --prefix=/usr --localstatedir=/var/lib --host=x86_64-pc-linux-gnu make V=1 Before the change: ar cru libstore.a nix/libstore/libstore_a-gc.o After the change: x86_64-pc-linux-gnu-ar cru libstore.a * config-daemon.ac: use AM_PROG_AR to detect host AR Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru> Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2016-11-25offload: Use Guile-SSH instead of GNU lsh.Ludovic Courtès * guix/scripts/offload.scm (<build-machine>)[ssh-options]: Remove. [host-key, host-key-type]: New fields. (%lsh-command, %lshg-command, user-lsh-private-key): Remove. (user-openssh-private-key, private-key-from-file*): New procedures. (host-key->type+key, open-ssh-session): New procedures. (remote-pipe): Remove 'mode' parameter. Rewrite in terms of 'open-ssh-session' etc. Update users. (send-files)[missing-files]: Rewrite using the bidirectional channel port. Remove call to 'call-with-compressed-output-port'. (retrieve-files): Remove call to 'call-with-decompressed-port'. (machine-load): Remove exit status logic. * doc/guix.texi (Requirements): Mention Guile-SSH. (Daemon Offload Setup): Document 'host-key' and 'private-key'. Show the default value on each @item line. * m4/guix.m4 (GUIX_CHECK_GUILE_SSH): New macro. * config-daemon.ac: Use 'GUIX_CHECK_GUILE_SSH'. Set 'HAVE_DAEMON_OFFLOAD_HOOK' as a function of that. 2016-11-16daemon: Add "builtin:download" derivation builder.Ludovic Courtès This ensures that 1) the derivation doesn't change when Guix changes; 2) the derivation closure doesn't contain Guix and its dependencies; 3) we don't have to rely on ugly chroot hacks. Adapted from Nix commit 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131. * nix/libstore/build.cc (DerivationGoal::runChild): Add special case for 'isBuiltin(drv)'. Disable chroot when 'isBuiltin(drv)'. * nix/libstore/builtins.cc, nix/libstore/builtins.hh, nix/scripts/download.in, guix/scripts/perform-download.scm: New files. * guix/ui.scm (show-guix-help)[internal?]: Add 'perform-download'. * nix/local.mk (libstore_a_SOURCES): Add builtins.cc. (libstore_headers): Add builtins.hh. (nodist_pkglibexec_SCRIPTS): Add 'scripts/download'. * config-daemon.ac: Emit 'scripts/download'. * Makefile.am (MODULES): Add 'guix/scripts/perform-download.scm'. * tests/derivations.scm ("unknown built-in builder") ("'download' built-in builder") ("'download' built-in builder, invalid hash") ("'download' built-in builder, not found") ("'download' built-in builder, not fixed-output"): New tests. Co-authored-by: Eelco Dolstra <eelco.dolstra@logicblox.com> 2016-07-16build: Substitute URLs now default to "mirror.hydra.gnu.org" alone.Ludovic Courtès * config-daemon.ac: Remove "hydra.gnu.org" from 'guix_substitute_urls'. * guix/store.scm (%default-substitute-urls): Remove "hydra.gnu.org". 2016-03-19build: Protect against misconfiguration of localstatedir.Ludovic Courtès Suggested by Jookia <166291@gmail.com>. * m4/guix.m4 (GUIX_CURRENT_LOCALSTATEDIR, GUIX_CHECK_LOCALSTATEDIR): New macros. * config-daemon.ac: Use 'GUIX_CHECK_LOCALSTATEDIR'. * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Add --localstatedir. * doc/guix.texi (Requirements): Mention --localstatedir. (The Store): Mention LOCALSTATEDIR as such. 2016-03-16build: Default to "https://mirror.hydra.gnu.org/" for substitutes.Ludovic Courtès * config-daemon.ac: Check for (gnutls) and define 'GUIX_SUBSTITUTE_URLS'. * nix/nix-daemon/guix-daemon.cc (main): Use GUIX_SUBSTITUTE_URLS. * guix/store.scm (%default-substitute-urls): Use 'https' when (gnutls) is available. * doc/guix.texi (Binary Installation): Mention mirrors (Invoking guix-daemon): Mention mirror.hydra.gnu.org. (Substitutes): Mention mirrors. (Invoking guix archive): Show https URLs. 2015-12-09build: Always check for gzip/bzip2/xz.Ludovic Courtès This allows (guix config) to contain valid values of %GZIP et al. even when configured with --disable-daemon. * config-daemon.ac: Move 'AC_PATH_PROG' invocations for gzip & co. to... * configure.ac: ... here. 2015-10-09build: Fix libgcrypt detection on FHS systems.Ludovic Courtès Reported by Christopher Allan Webber <cwebber@dustycloud.org>. * m4/guix.m4 (GUIX_LIBGCRYPT_LIBDIR): Add "grep -e -L" to the pipeline to account for cases where the output of "libgcrypt-config --libs" lacks a -L flag. * configure.ac: When 'GUIX_LIBGCRYPT_LIBDIR' returns the empty string, set LIBGCRYPT_LIBDIR to "no". * config-daemon.ac: Add missing space.