From 8ad8413454923c34bd05faa8c3f8c5b59793a4c4 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 5 Jul 2020 10:19:06 -0700 Subject: [PATCH] Start making snap package pull from source tree instead of git --- .gitignore | 2 +- BUILD.md | 44 ++++++++++++++++++++++++ {snap => install}/qt-installer-script.js | 2 +- snap/README.md | 37 -------------------- snap/snapcraft.yaml | 4 +-- 5 files changed, 47 insertions(+), 42 deletions(-) rename {snap => install}/qt-installer-script.js (97%) delete mode 100644 snap/README.md diff --git a/.gitignore b/.gitignore index ad8aa021..26ee07ad 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ develop-eggs MANIFEST env onionshare-*.tar.gz -snap/onionshare_*.snap +onionshare_*.snap # Installer logs pip-log.txt diff --git a/BUILD.md b/BUILD.md index fad1c8fb..2ea2f1ab 100644 --- a/BUILD.md +++ b/BUILD.md @@ -3,6 +3,8 @@ * [Linux](#linux) * [Use newest software](#use-newest-software) * [Use package managers](#use-package-managers) + * [Flatpak packaging](#flatpak-packaging) + * [Snapcraft packaging](#snapcraft-packaging) * [macOS](#macos) * [Windows](#windows) * [Setting up your dev environment](#setting-up-your-dev-environment) @@ -107,6 +109,48 @@ For ArchLinux: There is a PKBUILD available [here](https://www.archlinux.org/pac If you find that these instructions don't work for your Linux distribution or version, consult the [Linux Distribution Support wiki guide](https://github.com/micahflee/onionshare/wiki/Linux-Distribution-Support), which might contain extra instructions. +### Flatpak packaging + +See: https://github.com/micahflee/org.onionshare.OnionShare + +### Snapcraft packaging + +This folder contains files to build a [snap package](https://snapcraft.io/). First make sure you install `snap` and `snapcraft` (`snap install snapcraft --classic`). + +To build the snap, cd to the `onionshare` folder and run: + +```sh +snapcraft +snap install --devmode ./onionshare_*.snap +``` + +See your installed snaps: + +```sh +snap list +``` + +Run the OnionShare snap: + +```sh +/snap/bin/onionshare # CLI version +/snap/bin/onionshare.onionshare-gui # GUI version +``` + +Delete the OnionShare snap: + +```sh +snap remove onionshare +``` + +#### Making a new release + +In `snapcraft.yaml`: + +- Update `version` +- Update the `onionshare` part to use the correct tag +- Update `Qt5`, `tor`, `libevent`, and `obfs4` dependencies, if necessary + ## macOS Install Xcode from the Mac App Store. Once it's installed, run it for the first time to set it up. Also, run this to make sure command line tools are installed: `xcode-select --install`. And finally, open Xcode, go to Preferences > Locations, and make sure under Command Line Tools you select an installed version from the dropdown. (This is required for installing Qt5.) diff --git a/snap/qt-installer-script.js b/install/qt-installer-script.js similarity index 97% rename from snap/qt-installer-script.js rename to install/qt-installer-script.js index ab7bccb8..e68a6005 100644 --- a/snap/qt-installer-script.js +++ b/install/qt-installer-script.js @@ -1,5 +1,5 @@ // This script is here for convenience. Minify it and copy it into the -// qt5 override-build section of snapcraft.yaml +// qt5 override-build section of snap/snapcraft.yaml function Controller() { installer.installationFinished.connect(proceed) diff --git a/snap/README.md b/snap/README.md deleted file mode 100644 index 074cdb13..00000000 --- a/snap/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Snap package - -This folder contains files to build a [snap package](https://snapcraft.io/). First make sure you install `snap` and `snapcraft` (`snap install snapcraft --classic`). - -To build the snap, cd to the `snap` folder and run: - -```sh -snapcraft -snap install ./onionshare_*.snap -``` - -See your installed snaps: - -```sh -snap list -``` - -Run the OnionShare snap: - -```sh -/snap/bin/onionshare # CLI version -/snap/bin/onionshare-gui # GUI version -``` - -Delete the OnionShare snap: - -```sh -snap remove onionshare -``` - -## Making a new release - -In `snapcraft.yaml`: - -- Update `version` -- Update the `onionshare` part to use the correct tag -- Update `Qt5`, `tor`, `libevent`, and `obfs4` dependencies, if necessary diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 5ce700ed..f42a1f28 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -35,9 +35,7 @@ apps: parts: onionshare: - source: https://github.com/micahflee/onionshare.git - source-type: git - source-branch: 1111_snap + source: . plugin: python python-version: python3 python-packages: