From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: [PATCH 16/16] gnu: Add onionshare. Date: Sun, 11 Sep 2016 21:58:57 +0300 Message-ID: <20160911185857.2123-17-efraim@flashner.co.il> References: <20160911185857.2123-1-efraim@flashner.co.il> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9yO-0003AZ-IF for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj9yL-0008Fg-V5 for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:23 -0400 Received: from flashner.co.il ([178.62.234.194]:52869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9yL-00089Z-Ku for guix-devel@gnu.org; Sun, 11 Sep 2016 14:59:21 -0400 Received: from localhost (85.64.232.168.dynamic.barak-online.net [85.64.232.168]) by flashner.co.il (Postfix) with ESMTPSA id CD97E40389 for ; Sun, 11 Sep 2016 18:59:19 +0000 (UTC) In-Reply-To: <20160911185857.2123-1-efraim@flashner.co.il> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/tor.scm (onionshare): New variable. * gnu/packages/patches/onionshare-fix-install-paths.patch: New variable. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + .../patches/onionshare-fix-install-paths.patch | 39 ++++++++ gnu/packages/tor.scm | 100 +++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 gnu/packages/patches/onionshare-fix-install-paths.patch diff --git a/gnu/local.mk b/gnu/local.mk index 515ca35..1999323 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -701,6 +701,7 @@ dist_patch_DATA = \ %D%/packages/patches/nvi-db4.patch \ %D%/packages/patches/ocaml-CVE-2015-8869.patch \ %D%/packages/patches/ocaml-findlib-make-install.patch \ + %D%/packages/patches/onionshare-fix-install-paths.patch \ %D%/packages/patches/openexr-missing-samples.patch \ %D%/packages/patches/openjpeg-CVE-2015-6581.patch \ %D%/packages/patches/openjpeg-CVE-2016-5157.patch \ diff --git a/gnu/packages/patches/onionshare-fix-install-paths.patch b/gnu/packages/patches/onionshare-fix-install-paths.patch new file mode 100644 index 0000000..721b89f --- /dev/null +++ b/gnu/packages/patches/onionshare-fix-install-paths.patch @@ -0,0 +1,39 @@ +From 7afdd3366711a0c508bfb9323af8f4268ab77c9b Mon Sep 17 00:00:00 2001 +From: Efraim Flashner +Date: Thu, 21 Jul 2016 13:22:45 +0300 +Subject: [PATCH] patch + +--- + setup.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/setup.py b/setup.py +index 8ae56fe..8b245c9 100644 +--- a/setup.py ++++ b/setup.py +@@ -91,15 +91,15 @@ setup( + include_package_data=True, + scripts=['install/scripts/onionshare', 'install/scripts/onionshare-gui'], + data_files=[ +- (os.path.join(sys.prefix, 'share/applications'), ['install/onionshare.desktop']), +- (os.path.join(sys.prefix, 'share/appdata'), ['install/onionshare.appdata.xml']), +- (os.path.join(sys.prefix, 'share/pixmaps'), ['install/onionshare80.xpm']), +- (os.path.join(sys.prefix, 'share/onionshare'), [ ++ ('share/applications', ['install/onionshare.desktop']), ++ ('share/appdata', ['install/onionshare.appdata.xml']), ++ ('share/pixmaps', ['install/onionshare80.xpm']), ++ ('share/onionshare', [ + 'resources/version.txt', + 'resources/wordlist.txt' + ]), +- (os.path.join(sys.prefix, 'share/onionshare/images'), images), +- (os.path.join(sys.prefix, 'share/onionshare/locale'), locale), +- (os.path.join(sys.prefix, 'share/onionshare/html'), html) ++ ('share/onionshare/images', images), ++ ('share/onionshare/locale', locale), ++ ('share/onionshare/html', html) + ] + ) +-- +2.9.1 + diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm index 951b8f6..fe74c3c 100644 --- a/gnu/packages/tor.scm +++ b/gnu/packages/tor.scm @@ -31,6 +31,7 @@ #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages python) + #:use-module (gnu packages qt) #:use-module (gnu packages autotools) #:use-module (gnu packages tls) #:use-module (gnu packages w3m)) @@ -145,3 +146,102 @@ 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 gpl2+))) + +(define-public onionshare + (package + (name "onionshare") + (version "0.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/micahflee/onionshare/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0pc3xbq379415s0i0y6rz02hay20zbvgra1jmg4mgrl9vbdr8zmw")) + (patches (search-patches "onionshare-fix-install-paths.patch")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-install-path + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (onionshare (string-append out "/share/onionshare"))) + (substitute* + "install/pyinstaller.spec" + ;; inform onionshare where the 'resources' files are installed + (("../resources") onionshare)) + (substitute* + "onionshare/strings.py" + ;; correct the locale directory + (("helpers.get_resource_path\\('locale'\\)") + (string-append "'" onionshare "/locale'"))) + (substitute* + "onionshare/helpers.py" + ;; correct the location of version.txt + (("/usr") out) + (("get_resource_path\\('version.txt'\\)") + (string-append "'" onionshare "/version.txt'")) + (("get_resource_path\\('wordlist.txt'\\)") + (string-append "'" onionshare "/wordlist.txt'"))) + (substitute* + "onionshare/web.py" + ;; fix the location of the html files + (("helpers.get_resource_path\\('html/denied.html'\\)") + (string-append "'" onionshare "/html/denied.html'")) + (("helpers.get_resource_path\\('html/404.html'\\)") + (string-append "'" onionshare "/html/404.html'")) + (("helpers.get_resource_path\\('html/index.html'\\)") + (string-append "'" onionshare "/html/index.html'"))) + (substitute* + "onionshare_gui/file_selection.py" + (("helpers.get_resource_path\\('images/drop_files.png'\\)") + (string-append "'" onionshare "/images/drop_files.png'"))) + (substitute* + "onionshare_gui/server_status.py" + (("helpers.get_resource_path\\('images/server_stopped.png'\\)") + (string-append "'" onionshare "/images/server_stopped.png'")) + (("helpers.get_resource_path\\('images/server_working.png'\\)") + (string-append "'" onionshare "/images/server_working.png'")) + (("helpers.get_resource_path\\('images/server_started.png'\\)") + (string-append "'" onionshare "/images/server_started.png'"))) + (substitute* + "onionshare_gui/onionshare_gui.py" + (("helpers.get_resource_path\\('images/logo.png'\\)") + (string-append "'" onionshare "/images/logo.png'"))) + (substitute* + "install/onionshare.desktop" + (("/usr") out)) + #t))) + (delete 'check) + (add-before 'strip 'tests + ;; After all the patching we run the tests after installing. + ;; This is also a known issue: + ;; https://github.com/micahflee/onionshare/issues/284 + (lambda _ (zero? (system* "nosetests" "test"))))) + ;; can't compress the egg because it expects to find all the resources + ;; inside the egg as though it were a folder. + #:configure-flags '("--single-version-externally-managed" "--root=/") + )) + (native-inputs + `(("python-nose" ,python-nose))) + (inputs + `(("python-flask" ,python-flask) + ("python-nautilus" ,python-nautilus) + ("python-sip" ,python-sip) + ("python-stem" ,python-stem) + ("python-pyqt" ,python-pyqt))) + (home-page "https://onionshare.org/") + (synopsis "Securely and anonymously share files") + (description "OnionShare lets you securely and anonymously share files of +any size. It works by starting a web server, making it accessible as a Tor +hidden service, and generating an unguessable URL to access and download the +files. It doesn't require setting up a server on the internet somewhere or +using a third party filesharing service. You host the file on your own computer +and use a Tor hidden service to make it temporarily accessible over the +internet. The other user just needs to use Tor Browser to download the file +from you.") + (license (list license:gpl3+ + license:bsd-3)))) ; onionshare/socks.py -- 2.10.0