From 1385aa068f1ef41f67a0cee4eff61bc126346d4e Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 17 Jan 2022 12:56:39 -0800 Subject: Make snapcraft work --- RELEASE.md | 3 ++- desktop/setup.py | 6 +++--- snap/snapcraft.yaml | 28 +++++++++++----------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 86b93e01..4e8da66b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ Before making a release, you must update the version in these places: - [ ] `cli/pyproject.toml` - [ ] `cli/onionshare_cli/resources/version.txt` - [ ] `desktop/pyproject.toml` +- [ ] `desktop/setup.py` - [ ] `desktop/org.onionshare.OnionShare.appdata.xml` - [ ] `docs/source/conf.py` (`version` at the top, and the `versions` list too) - [ ] `snap/snapcraft.yaml` @@ -47,7 +48,7 @@ You also must edit these files: Make sure snapcraft packaging works. In `snap/snapcraft.yaml`: - [ ] The `tor`, `libevent`, and `obfs4` parts should be updated if necessary -- [ ] All python packages should be updated to match `cli/pyproject.toml` and `desktop/pyproject.toml` +- [ ] All python packages in the `onionshare` part should be updated to match `desktop/pyproject.toml` - [ ] Test the snap package, ensure it works Finally: diff --git a/desktop/setup.py b/desktop/setup.py index 3052e25e..24359907 100644 --- a/desktop/setup.py +++ b/desktop/setup.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 +# This file is used to build the Snapcraft and Flatpak packages import setuptools -import os -with open(os.path.join("..", "cli", "onionshare_cli", "resources", "version.txt")) as f: - version = f.read().strip() +# The version must be hard-coded because Snapcraft won't have access to ../cli +version = "2.5" setuptools.setup( name="onionshare", diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 0dcdc3a0..acdc3fd2 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -42,9 +42,14 @@ parts: plugin: python python-version: python3 python-packages: + - setuptools - psutil - - pyside2 == 5.15.2 - qrcode + - pyside2 == 5.15.2 + # Force using setup.py, prevent using setup-freeze.py or poetry + override-build: | + rm setup-freeze.py pyproject.toml poetry.lock || true + snapcraftctl build stage-packages: - libasound2 - libatk1.0-0 @@ -114,19 +119,7 @@ parts: plugin: python python-version: python3 python-packages: - - click - - flask - - flask-socketio == 5.0.1 - - psutil - - pysocks - - requests - - unidecode - - urllib3 - - eventlet - - setuptools - - pynacl - - colorama - - cepa == 1.8.3 + - poetry stage-packages: - build-essential - libssl-dev @@ -139,8 +132,8 @@ parts: after: [tor, obfs4, snowflake-client, meek-client] tor: - source: https://dist.torproject.org/tor-0.4.6.8.tar.gz - source-checksum: sha256/15ce1a37b4cc175b07761e00acdcfa2c08f0d23d6c3ab9c97c464bd38cc5476a + source: https://dist.torproject.org/tor-0.4.6.9.tar.gz + source-checksum: sha256/c7e93380988ce20b82aa19c06cdb2f10302b72cfebec7c15b5b96bcfc94ca9a9 source-type: tar plugin: autotools build-packages: @@ -176,7 +169,8 @@ parts: # Not sure why I have to do this, but it works override-build: | cd meek-client - go build -o /root/parts/meek-client/install/bin ./... + mkdir /root/parts/meek-client/install/bin + go build -o /root/parts/meek-client/install/bin/meek-client ./... source: https://git.torproject.org/pluggable-transports/meek.git source-type: git source-tag: v0.37.0 -- cgit v1.2.3-54-g00ecf