summary refs log tree commit diff
path: root/gnu/packages/tor.scm
diff options
context:
space:
mode:
authorEric Bavier <bavier@posteo.net>2023-02-13 22:24:36 -0600
committerEric Bavier <bavier@posteo.net>2023-02-14 10:33:04 -0600
commita22b62b98e051cced363e7a363aa3847210aec50 (patch)
tree89adea6ecb137f08da50bcae7166410fe48b0acd /gnu/packages/tor.scm
parent4501a50bbdb35b4e0b5adf57c11a511af31f76f5 (diff)
downloadguix-a22b62b98e051cced363e7a363aa3847210aec50.tar.gz
gnu: onionshare: Update to 2.6.
* gnu/packages/patches/onionshare-cli-async-mode.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/tor.scm (onionshare): Update to 2.6.
[source]: Use patch.
[inputs]: Add xdg-utils.  Move xvfb-run, used for tests, to ...
[native-inputs]: here.
[arguments]: Run tests.  Add "absolutize" phase for xdg-open.
Diffstat (limited to 'gnu/packages/tor.scm')
-rw-r--r--gnu/packages/tor.scm25
1 files changed, 13 insertions, 12 deletions
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index 6e5b3c0f60..9e26753857 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2017, 2018, 2019, 2021 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2017, 2018, 2019, 2021, 2023 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018, 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
@@ -46,6 +46,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pcre)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -256,7 +257,7 @@ networks.")
 (define-public onionshare-cli
   (package
     (name "onionshare-cli")
-    (version "2.5")
+    (version "2.6")
     (source
      (origin
        (method git-fetch)
@@ -265,7 +266,8 @@ networks.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "16m5ll0v0qjbirwwzbzxg53kq4ry1n3ay5x0h8zkij73v3x0q864"))))
+        (base32 "1bhrp019a0923h7dnfxhgvgvdp81blvnsbnvzy34hp827abxf3ic"))
+       (patches (search-patches "onionshare-cli-async-mode.patch"))))
     (build-system python-build-system)
     (native-inputs
      (list python-pytest))
@@ -329,6 +331,11 @@ OnionShare.")
      (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
@@ -353,15 +360,9 @@ OnionShare.")
                   (setenv "QT_QPA_PLATFORM" "offscreen")
                   (setenv "HOME" "/tmp")
                   (apply invoke "xvfb-run" "pytest" "-vv"
-                         (find-files "tests" "^test_gui.*\\.py$")))))))
-       ;; Most tests fail: "2 failed, 8 warnings, 44 errors in 6.06s", due to
-       ;; error "RuntimeError: Please destroy the Application singleton before
-       ;; creating a new Application instance." (see:
-       ;; https://github.com/onionshare/onionshare/issues/1603).
-       ((#:tests? _ #f)
-        #f)))
+                         (find-files "tests" "^test_gui.*\\.py$")))))))))
     (native-inputs
-     (list python-pytest))
+     (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
@@ -372,7 +373,7 @@ OnionShare.")
                 python-shiboken-2
                 python-pyside-2
                 python-qrcode
-                xvfb-run)))
+                xdg-utils)))
     (description "OnionShare lets you securely and anonymously share files,
 host websites, and chat with friends using the Tor network.")))