Make snapcraft work

This commit is contained in:
Micah Lee 2022-01-17 12:56:39 -08:00
parent 9566e34a0b
commit 1385aa068f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 16 additions and 21 deletions

View File

@ -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:

View File

@ -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",

View File

@ -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