~ruther/guix-local

ebcf3311fa3b611984de09b06dec4b45677108e2 — Sharlatan Hellseher 1 year, 3 months ago 4db0aaf
gnu: onionshare-cli: Update to 2.6.3.

* gnu/packages/tor.scm (onionshare-cli): Update to 2.6.3.
[source] <patches>: Remove it.
[build-system]: Switch to pyproject.
[arguments] <phases>: Add 'relax-requirments and 'pre-check; use default
'check.
[inputs]: Remove python-flask-httpauth, python-pycryptodome, and
python-urllib3; add python-cffi, python-flask-compress,
python-gevent, python-gevent-websocket, python-packaging,
python-qrcode, python-setuptools, python-urllib3-next,
python-waitress, and python-werkzeug.
[native-inputs]: Add python-cython-3, python-poetry-core, and
python-wheel.

* gnu/packages/patches/onionshare-cli-async-mode.patch: Delete file.
* gnu/local.mk: Deregister patch.

Change-Id: If0ee795992dc5a91fabcd70b16646eb5cc7aab2c
3 files changed, 38 insertions(+), 43 deletions(-)

M gnu/local.mk
D gnu/packages/patches/onionshare-cli-async-mode.patch
M gnu/packages/tor.scm
M gnu/local.mk => gnu/local.mk +0 -1
@@ 1926,7 1926,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/ocaml-4.09-multiple-definitions.patch	\
  %D%/packages/patches/omake-fix-non-determinism.patch	\
  %D%/packages/patches/oneko-remove-nonfree-characters.patch	\
  %D%/packages/patches/onionshare-cli-async-mode.patch		\
  %D%/packages/patches/online-judge-tools.patch		\
  %D%/packages/patches/onnx-optimizer-system-library.patch	\
  %D%/packages/patches/onnx-1.13.1-use-system-googletest.patch	\

D gnu/packages/patches/onionshare-cli-async-mode.patch => gnu/packages/patches/onionshare-cli-async-mode.patch +0 -25
@@ 1,25 0,0 @@
Specifying the `async_mode` parameter seems to have been a workaround for
packaging on Windows and macOS.  If not given, flask_socketio.SocketIO will
probe for an available asynchronous model, e.g. `eventlet`, and otherwise gets
stuck if `gevent-socketio` is not available.

c.f. https://github.com/onionshare/onionshare/commit/ec7fa4ef16c9e1ba6028ee927c23f76c399a17a6
and  https://github.com/onionshare/onionshare/issues/1510

diff --git a/cli/onionshare_cli/web/web.py b/cli/onionshare_cli/web/web.py
index 64844b5..7e1b095 100644
--- a/cli/onionshare_cli/web/web.py
+++ b/cli/onionshare_cli/web/web.py
@@ -164,10 +164,10 @@ class Web:
         elif self.mode == "chat":
             if self.common.verbose:
                 self.socketio = SocketIO(
-                    async_mode="gevent", logger=True, engineio_logger=True
+                    logger=True, engineio_logger=True
                 )
             else:
-                self.socketio = SocketIO(async_mode="gevent")
+                self.socketio = SocketIO()
             self.socketio.init_app(self.app)
             self.chat_mode = ChatModeWeb(self.common, self)
 

M gnu/packages/tor.scm => gnu/packages/tor.scm +38 -17
@@ 44,6 44,7 @@
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)


@@ 261,7 262,7 @@ networks.")
(define-public onionshare-cli
  (package
    (name "onionshare-cli")
    (version "2.6")
    (version "2.6.3")
    (source
     (origin
       (method git-fetch)


@@ 270,32 271,53 @@ networks.")
             (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)
        (base32 "16yr25llnbgl2iwk458ca0rhrxsmpfx72q4gdg4a52i6g546p3hd"))))
    (build-system pyproject-build-system)
    (native-inputs
     (list python-pytest))
     (list python-cython-3
           python-poetry-core
           python-pytest
           python-wheel))
    (inputs
     ;; TODO: obfs4proxy
     (list python-click
           python-cffi
           python-colorama
           python-eventlet
           python-flask
           python-flask-httpauth
           python-flask-compress
           python-flask-socketio
           python-pynacl
           python-gevent
           python-gevent-websocket
           python-packaging
           python-psutil
           python-pycryptodome
           python-pynacl
           python-pysocks
           python-qrcode
           python-requests
           python-setuptools
           python-stem
           python-unidecode
           python-urllib3
           python-urllib3-next
           python-waitress
           python-werkzeug
           tor))
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'relax-requirements
            (lambda _
              ;; All tests passed, and the CLI is working in runtime, relax
              ;; Poetry way too strict requirements.
              (substitute* "cli/pyproject.toml"
                (("2.3.2") "^3.0.0")     ; flask = "2.3.2"
                (("5.3.4") "5.5.1")      ; flask-socketio = "5.3.4"
                (("23.9.1") "24.11.1")   ; gevent = "^23.9.1"
                (("7.4.2") "8.0.0")      ; qrcode = "^7.4.2"
                (("70.0.0") "67.6.1")    ; setuptools = ">=70.0.0"
                (("1.8.1") "^1.8.1")     ; stem = "1.8.1"
                (("3.0.6") "^3.0.6")     ; werkzeug = "3.0.6"
                (("0.41.2") "0.40.0")))) ; wheel = "^0.41.2"
          (add-after 'unpack 'bake-tor
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* (list "cli/onionshare_cli/common.py"


@@ 307,16 329,15 @@ networks.")
                 (search-input-directory inputs "share/tor")))))
          (add-before 'build 'change-directory
            (lambda _ (chdir "cli")))
          (replace 'check
          (add-before 'check 'pre-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")))))))
                ;; 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")))))))
    (home-page "https://onionshare.org/")
    (synopsis "Securely and anonymously share files")
    (description "OnionShare lets you securely and anonymously share files,