;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2021 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2016-2018, 2020-2023 Efraim Flashner ;;; Copyright © 2016, 2017 Nikita ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice ;;; Copyright © 2017, 2018, 2019, 2021, 2023 Eric Bavier ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2018, 2022 Ricardo Wurmus ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2020 André Batista ;;; Copyright © 2021-2023 Danial Behzadi ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2022 Jim Newsome ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it
aboutsummaryrefslogtreecommitdiff
blob: 0866b5a4d848e48f7fad98cba811ae6ec27d0148 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
#
# 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/>.

#
# Test the 'guix archive' command-line utility.
#

guix archive --version

archive="t-archive-$$"
archive_alt="t-archive-alt-$$"
tmpdir="t-archive-dir-$$"
rm -f "$archive" "$archive_alt"
rm -rf "$tmpdir"

trap 'rm -f "$archive" "$archive_alt"; chmod -R +w "$tmpdir"; rm -rf "$tmpdir"' EXIT

guix archive --export guile-bootstrap > "$archive"
guix archive --export guile-bootstrap:out > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export							\
    -e '(@ (gnu packages bootstrap) %bootstrap-guile)' > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export `guix build guile-bootstrap` > "$archive_alt"
cmp "$archive" "$archive_alt"

# Check the exit value upon import.
guix archive --import < "$archive"

guix archive --export something-that-does-not-exist && false

# This one must not be listed as missing.
guix build guile-bootstrap > "$archive"
guix archive --missing < "$archive"
test "`guix archive --missing < "$archive"`" = ""

# Two out of three should be listed as missing.
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" >> "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
guix archive --missing < "$archive" > "$archive_alt"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" > "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
cmp "$archive" "$archive_alt"

# This is not a valid store file name, so an error.
echo something invalid > "$archive"
guix archive --missing < "$archive" && false

# Check '--extract'.
guile -c "(use-modules (guix serialization))
  (call-with-output-file \"$archive\"
    (lambda (port)
      (write-file \"$(guix build guile-bootstrap)\" port)))"
guix archive -x "$tmpdir" < "$archive"
test -x "$tmpdir/bin/guile"
test -d "$tmpdir/lib/guile"

# Check '--list'.
guix archive -t < "$archive" | grep "^D /share/guile"
guix archive -t < "$archive" | grep "^x /bin/guile"
guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm"

echo foo | guix archive --authorize && false

exit 0
//gitlab.torproject.org/tpo/core/torsocks/-/tags"))) ;; All the files explicitly say "version 2 only". (license license:gpl2))) (define-public privoxy (package (name "privoxy") (version "3.0.34") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/ijbswa/Sources/" version "%20%28stable%29/privoxy-" version "-stable-src.tar.gz")) (sha256 (base32 "0b2x7hm34fbqaxb46afpx6bnc3x76d753y2p8rmn2kkgcnhvrk76")))) (build-system gnu-build-system) (arguments '(;; The default 'sysconfdir' is $out/etc; change that to ;; $out/etc/privoxy. #:configure-flags (list (string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc/privoxy") "--localstatedir=/var" "--with-brotli" "--with-openssl") #:tests? #f ; no test suite #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-default-logging (lambda _ (with-fluids ((%default-port-encoding "ISO-8859-1")) ;; Do not create /var/run nor /var/log/privoxy/logfile. (substitute* "GNUmakefile.in" (("(logfile \\|\\| exit )1" _ match) (string-append match "0")) (("(\\$\\(DESTDIR\\)\\$\\(SHARE_DEST\\)) \\\\" _ match) match) ((".*\\$\\(LOG_DEST\\) \\$\\(DESTDIR\\)\\$\\(PID_DEST\\).*") "")) ;; Disable logging in the default configuration to allow for ;; non-root users using it as is. (substitute* "config" (("^logdir") "#logdir") (("^logfile") "#logfile")))))))) (inputs (list brotli openssl pcre w3m zlib)) (native-inputs (list autoconf automake)) (home-page "https://www.privoxy.org") (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy") (description "Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks.") (license license:gpl2+))) (define-public onionshare-cli (package (name "onionshare-cli") (version "2.6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/onionshare/onionshare") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1bhrp019a0923h7dnfxhgvgvdp81blvnsbnvzy34hp827abxf3ic")) (patches (search-patches "onionshare-cli-async-mode.patch")))) (build-system python-build-system) (native-inputs (list python-pytest)) (inputs ;; TODO: obfs4proxy (list python-click python-colorama python-eventlet python-flask python-flask-httpauth python-flask-socketio python-pynacl python-psutil python-pycryptodome python-pysocks python-requests python-stem python-unidecode python-urllib3 tor)) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'bake-tor (lambda* (#:key inputs #:allow-other-keys) (substitute* (list "cli/onionshare_cli/common.py" "desktop/onionshare/gui_common.py") (("shutil\\.which\\(\\\"tor\\\"\\)") (format #f "~s" (search-input-file inputs "bin/tor")))) (substitute* "cli/tests/test_cli_common.py" (("/usr/share/tor") (search-input-directory inputs "share/tor"))))) (add-before 'build 'change-directory (lambda _ (chdir "cli"))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? (setenv "HOME" "/tmp") ;; Greendns is not needed for testing, and if eventlet tries to ;; load it, an OSError is thrown when getprotobyname is called. ;; Thankfully there is an environment variable to disable the ;; greendns import, so use it: (setenv "EVENTLET_NO_GREENDNS" "yes") (invoke "pytest" "-v" "./tests"))))))) (home-page "https://onionshare.org/") (synopsis "Securely and anonymously share files") (description "OnionShare lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. This package contains @code{onionshare-cli}, a command-line interface to OnionShare.") ;; Bundled, minified jquery and socket.io are expat licensed. (license (list license:gpl3+ license:expat)))) (define-public onionshare (package (inherit onionshare-cli) (name "onionshare") (arguments (substitute-keyword-arguments (package-arguments onionshare-cli) ((#:phases phases) #~(modify-phases #$phases (add-after 'unpack 'absolutize (lambda* (#:key inputs #:allow-other-keys) (substitute* "desktop/onionshare/tab/mode/history.py" (("Popen\\(\\[\"xdg-open\"") (string-append "Popen([\"" (which "xdg-open") "\""))))) (replace 'change-directory (lambda _ (chdir "desktop/"))) (add-after 'install 'install-data (lambda _ (install-file "org.onionshare.OnionShare.svg" (string-append #$output "/share/icons/hicolor/scalable/apps")) (install-file "org.onionshare.OnionShare.desktop" (string-append #$output "/share/applications")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? ;; Remove multiline load-path adjustment, so that ;; onionshare-cli modules are loaded from input (substitute* "tests/conftest.py" (("\"cli\",") "\"/nonexistent\"")) ;; Avoid `getprotobyname` issues: (setenv "EVENTLET_NO_GREENDNS" "yes") ;; Make Qt render "offscreen": (setenv "QT_QPA_PLATFORM" "offscreen") (setenv "HOME" "/tmp") (apply invoke "xvfb-run" "pytest" "-vv" (find-files "tests" "^test_gui.*\\.py$"))))))))) (native-inputs (list python-pytest xvfb-run)) (inputs ;; The desktop client uses onionshare-cli like a python module. But ;; propagating onionshare-cli's inputs is not great, since a user would ;; not expect to have those installed when using onionshare-cli as a ;; standalone utility. So add onionshare-cli's inputs here. (modify-inputs (package-inputs onionshare-cli) (prepend onionshare-cli ;TODO: package obfs4proxy python-shiboken-2 python-pyside-2 python-qrcode xdg-utils))) (description "OnionShare lets you securely and anonymously share files, host websites, and chat with friends using the Tor network."))) (define-public nyx (package (name "nyx") (version "2.1.0") (source (origin (method url-fetch) (uri (pypi-uri name version)) (sha256 (base32 "02rrlllz2ci6i6cs3iddyfns7ang9a54jrlygd2jw1f9s6418ll8")))) (build-system python-build-system) (inputs (list python-stem)) (arguments `(#:phases (modify-phases %standard-phases (add-after 'install 'install-man-page (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (man (string-append out "/share/man"))) (install-file "nyx.1" (string-append man "/man1")) #t))) (add-after 'install 'install-sample-configuration (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (doc (string-append out "/share/doc/" ,name "-" ,version))) (install-file "web/nyxrc.sample" doc) #t)))) ;; XXX The tests seem to require more of a real terminal than the build ;; environment provides: ;; _curses.error: setupterm: could not find terminal ;; With TERM=linux, the tests try to move the cursor and still fail: ;; _curses.error: cbreak() returned ERR #:tests? #f)) (home-page "https://nyx.torproject.org/") (synopsis "Tor relay status monitor") (description "Nyx monitors the performance of relays participating in the @uref{https://www.torproject.org/, Tor anonymity network}. It displays this information visually and in real time, using a curses-based terminal interface. This makes Nyx well-suited for remote shell connections and servers without a graphical display. It's like @command{top} for Tor, providing detailed statistics and status reports on: @enumerate @item connections (with IP address, hostname, fingerprint, and consensus data), @item bandwidth, processor, and memory usage, @item the relay's current configuration, @item logged events, @item and much more. @end enumerate Potential client and exit connections are scrubbed of sensitive information.") (license license:gpl3+))) (define-public tractor (package (name "tractor") (version "4.1.1") (source (origin (method url-fetch) (uri (pypi-uri "traxtor" version)) (sha256 (base32 "1542g6alycwlmvndxcijzn4d5lgycmxxb78gqd8qwgm9kw0fnr3q")))) (build-system pyproject-build-system) (native-inputs (list (list glib "bin"))) ; for glib-compile-schemas. (inputs (list python-fire python-psutil python-pygobject python-requests python-stem python-termcolor)) (arguments (list #:tests? #f ; no test suite. #:phases #~(modify-phases %standard-phases (add-after 'install 'install-man-page (lambda _ (let ((man1 (string-append #$output "/share/man/man1"))) (install-file "tractor/man/tractor.1" man1)))) (add-after 'install 'install-bash-completion (lambda _ (mkdir "bash-completion") (rename-file "tractor/tractor-completion" "bash-completion/tractor") (let ((bash-completion (string-append #$output "/share/bash-completion/completions"))) (install-file "bash-completion/tractor" bash-completion)))) (add-after 'install 'install-gschema (lambda _ (let ((schemas (string-append #$output "/share/glib-2.0/schemas"))) (install-file "tractor/tractor.gschema.xml" schemas))))))) (home-page "https://framagit.org/tractor") (synopsis "Setup an onion routing proxy") (description "This package uses Python stem library to provide a connection through the onion proxy and sets up proxy in user session, so you don't have to mess up with TOR on your system anymore.") (license license:gpl3+)))