diff options
author | Micah Lee <micah@micahflee.com> | 2022-10-07 15:44:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 15:44:12 -0700 |
commit | 6c6c6bc62d6757bbf5b669386d815907eb369645 (patch) | |
tree | 21d65261dddc684f0bd62fa1135ed3c114826cda /snap | |
parent | 2144bc89fe1cab343921ac604f9ab4e8a5e3381b (diff) | |
download | onionshare-6c6c6bc62d6757bbf5b669386d815907eb369645.tar.gz onionshare-6c6c6bc62d6757bbf5b669386d815907eb369645.zip |
More snapcraft troubleshooting (#1622)
Finally got the snap to successfully run
Diffstat (limited to 'snap')
-rw-r--r-- | snap/snapcraft.yaml | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 790acbe1..ffc56d6e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -19,7 +19,7 @@ architectures: apps: onionshare: common-id: org.onionshare.OnionShare - command: bin/onionshare + command: bin/onionshare-launcher extensions: [gnome-3-38] plugs: - desktop @@ -32,7 +32,7 @@ apps: cli: common-id: org.onionshare.OnionShareCli - command: bin/onionshare-cli + command: bin/onionshare-cli-launcher plugs: - home - network @@ -42,12 +42,45 @@ apps: LANG: C.UTF-8 parts: + # Launcher scripts, in order to set PYTHONPATH + 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: source: ./desktop plugin: python - python-packages: - - qrcode - - pyside2 == 5.15.2.1 + build-environment: + - PATH: /usr/bin:$PATH + - PYTHONPATH: "" stage-packages: - libasound2 - libatk1.0-0 @@ -109,19 +142,28 @@ parts: - libxslt1.1 - libxtst6 - qtwayland5 + - python3-pyside2.qtcore + - python3-pyside2.qtgui + - python3-pyside2.qtwidgets override-build: | + python3 -m pip install qrcode --prefix $SNAPCRAFT_PART_INSTALL python3 setup.py install --prefix $SNAPCRAFT_PART_INSTALL after: [onionshare-cli] onionshare-cli: source: ./cli plugin: python + build-environment: + - PATH: /usr/bin:$PATH + - PYTHONPATH: "" build-packages: - build-essential - libssl-dev - libffi-dev - python3-dev - python3-pip + - rustc + - cargo override-build: | python3 -m pip install poetry python3 -m pip install setuptools @@ -136,8 +178,7 @@ parts: source-type: tar plugin: autotools autotools-configure-parameters: - - "--with-libevent-dir=/build/onionshare/parts/libevent/install/usr/local" - # - "--with-libevent-dir=/root/parts/libevent/install/usr/local" + - "--with-libevent-dir=$SNAPCRAFT_PROJECT_DIR/../parts/libevent/install/usr/local" build-packages: - libssl-dev - zlib1g-dev |