Switch snapcraft from core20 to core22

This commit is contained in:
Micah Lee 2023-09-05 20:42:47 -07:00
parent 7b40bf8d5f
commit 0a290a91c7
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -1,5 +1,5 @@
name: onionshare name: onionshare
base: core20 base: core22
version: "2.6.1" version: "2.6.1"
summary: Securely and anonymously share files, host websites, and chat using Tor summary: Securely and anonymously share files, host websites, and chat using Tor
description: | description: |
@ -20,8 +20,7 @@ architectures:
apps: apps:
onionshare: onionshare:
common-id: org.onionshare.OnionShare common-id: org.onionshare.OnionShare
command: bin/onionshare-launcher command: bin/onionshare
extensions: [gnome-3-38]
plugs: plugs:
- desktop - desktop
- home - home
@ -30,10 +29,12 @@ apps:
- removable-media - removable-media
environment: environment:
LANG: C.UTF-8 LANG: C.UTF-8
PATH: $SNAP/bin:$SNAP/usr/bin:$SNAP/usr/local/bin:$PATH
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib
cli: cli:
common-id: org.onionshare.OnionShareCli common-id: org.onionshare.OnionShareCli
command: bin/onionshare-cli-launcher command: bin/onionshare-cli
plugs: plugs:
- home - home
- network - network
@ -41,42 +42,15 @@ apps:
- removable-media - removable-media
environment: environment:
LANG: C.UTF-8 LANG: C.UTF-8
PATH: $SNAP/bin:$SNAP/usr/bin:$SNAP/usr/local/bin:$PATH
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/local/lib
parts: parts:
launcher:
plugin: nil
override-build: |
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cat > $SNAPCRAFT_PART_INSTALL/bin/launcher-setup << EOF
#!/bin/sh
export PATH=\$SNAP/bin:\$SNAP/usr/bin:\$SNAP/usr/local/bin:\$PATH
export PYTHONPATH=\$SNAP/lib/python3.8/site-packages:\$SNAP/usr/lib/python3/dist-packages
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$SNAP/usr/local/lib
ORIG_IFS=\$IFS
IFS=":"
LIB_BASE=\$(for D in \$LD_LIBRARY_PATH; do echo \$D; done | grep \$SNAP/usr/lib/)
IFS=\$ORIGIN_IFS
export QT_PLUGIN_PATH=\$LIB_BASE/qt5/plugins
EOF
cat > $SNAPCRAFT_PART_INSTALL/bin/onionshare-launcher << EOF
#!/bin/sh
. \$SNAP/bin/launcher-setup
onionshare \$@
EOF
cat > $SNAPCRAFT_PART_INSTALL/bin/onionshare-cli-launcher << EOF
#!/bin/sh
. \$SNAP/bin/launcher-setup
onionshare-cli \$@
EOF
chmod 755 $SNAPCRAFT_PART_INSTALL/bin/launcher-setup
chmod 755 $SNAPCRAFT_PART_INSTALL/bin/onionshare-launcher
chmod 755 $SNAPCRAFT_PART_INSTALL/bin/onionshare-cli-launcher
onionshare-cli: onionshare-cli:
source: ./cli source: ./cli
plugin: nil plugin: nil
override-pull: | override-pull: |
snapcraftctl pull craftctl default
rm pyproject.toml poetry.lock rm pyproject.toml poetry.lock
after: [tor, obfs4, snowflake-client, meek-client] after: [tor, obfs4, snowflake-client, meek-client]
@ -155,8 +129,15 @@ parts:
- libxslt1.1 - libxslt1.1
- libxtst6 - libxtst6
- qtwayland5 - qtwayland5
- libgstreamer1.0-0
- libgstreamer1.0-dev
- libgstreamer-gl1.0-0
- libgstreamer-plugins-base1.0-0
- libmysqlclient21
- libxcb-cursor0
- libxkbfile1
override-pull: | override-pull: |
snapcraftctl pull craftctl default
rm pyproject.toml poetry.lock rm pyproject.toml poetry.lock
cat > requirements.txt << EOF cat > requirements.txt << EOF
# onionshare_cli # onionshare_cli
@ -183,15 +164,15 @@ parts:
packaging packaging
EOF EOF
override-build: | override-build: |
python3 -m venv $SNAPCRAFT_PART_INSTALL python3 -m venv $CRAFT_PART_INSTALL
. $SNAPCRAFT_PART_INSTALL/bin/activate . $CRAFT_PART_INSTALL/bin/activate
pip install -U pip setuptools wheel pip install -U pip setuptools wheel
pip install -U -r requirements.txt pip install -U -r requirements.txt
pip install -U ../../onionshare-cli/src pip install -U ../../onionshare-cli/src
pip install -U . pip install -U .
deactivate deactivate
sed -i 's|'$SNAPCRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $SNAPCRAFT_PART_INSTALL/bin/onionshare sed -i 's|'$CRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $CRAFT_PART_INSTALL/bin/onionshare
sed -i 's|'$SNAPCRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $SNAPCRAFT_PART_INSTALL/bin/onionshare-cli sed -i 's|'$CRAFT_PART_INSTALL'/bin/python3|/usr/bin/env python3|g' $CRAFT_PART_INSTALL/bin/onionshare-cli
after: [onionshare-cli] after: [onionshare-cli]
tor: tor:
@ -200,7 +181,7 @@ parts:
source-type: tar source-type: tar
plugin: autotools plugin: autotools
autotools-configure-parameters: autotools-configure-parameters:
- "--with-libevent-dir=$SNAPCRAFT_PART_INSTALL/../../libevent/install/usr/local" - "--with-libevent-dir=$CRAFT_PART_INSTALL/../../libevent/install/usr/local"
build-packages: build-packages:
- libssl-dev - libssl-dev
- zlib1g-dev - zlib1g-dev