[fractal] Add snap packaging



commit 7a0294efbc92796c64ee5b00ec9a158b7dc7d9ed
Author: Ken VanDine <ken vandine org>
Date:   Fri Apr 17 15:16:12 2020 +0000

    Add snap packaging

 README.md                     |  23 ++++++++-
 build-aux/snap/snapcraft.yaml | 117 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 139 insertions(+), 1 deletion(-)
---
diff --git a/README.md b/README.md
index 0e033629..53cc22b2 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,12 @@ Fractal Flatpak on Flathub.
 <img src="https://flathub.org/assets/badges/flathub-badge-i-en.png"; width="190px" />
 </a>
 
+Fractal can also be installed as a snap on any distro with snap support enabled
+
+<a href="https://snapcraft.io/fractal";>
+<img src="https://github.com/snapcore/snap-store-badges/raw/master/EN/[EN]-snap-store-white.png"; 
width="182px" />
+</a>
+
 ## Build Instructions
 
 ### Flatpak
@@ -42,10 +48,25 @@ Then you go ahead and build Fractal.
 flatpak-builder --user --install fractal flatpak/org.gnome.Fractal.json
 ```
 
+### Snap
+
+To build as a snap simply install snapcraft
+
+```
+snap install --classic snapcraft
+snapcraft
+```
+
+The snapcraft build will produce a file that ends with .snap that can be easily installed with the snap 
command
+
+```
+snap install --dangerous FILENAME.snap
+```
+
 ### GNU/Linux
 
 If you decide to ignore our recommendation and build on your host system,
-outside of Flatpak, you will need Meson and Ninja (as well as Rust and Cargo).
+outside of Flatpak or snap, you will need Meson and Ninja (as well as Rust and Cargo).
 
 ```sh
 meson . _build --prefix=/usr/local
diff --git a/build-aux/snap/snapcraft.yaml b/build-aux/snap/snapcraft.yaml
new file mode 100644
index 00000000..b158ed74
--- /dev/null
+++ b/build-aux/snap/snapcraft.yaml
@@ -0,0 +1,117 @@
+name: fractal
+adopt-info: fractal
+grade: stable # must be 'stable' to release into candidate/stable channels
+confinement: strict
+base: core18
+architectures:
+  - build-on: amd64
+
+slots:
+  # for GtkApplication registration
+  fractal:
+    interface: dbus
+    bus: session
+    name: org.gnome.Fractal
+
+apps:
+  fractal:
+    extensions: [gnome-3-34]
+    command: fractal
+    common-id: org.gnome.Fractal.desktop
+    desktop: usr/share/applications/org.gnome.Fractal.desktop
+    plugs:
+      - gsettings
+      - network
+      - opengl
+      - password-manager-service
+
+parts:
+  enchant:
+    source: https://github.com/AbiWord/enchant.git
+    plugin: autotools
+    configflags:
+      - --prefix=/usr
+    organize:
+      snap/fractal/current/usr: usr
+    build-packages:
+      - gtk-doc-tools
+      - intltool
+      - gnome-common
+
+  gspell:
+    after: [enchant]
+    source: https://gitlab.gnome.org/GNOME/gspell.git
+    plugin: autotools
+    configflags:
+      - --prefix=/usr
+      - --enable-gtk-doc=no
+      - --enable-tests=no
+      - --enable-vala=no
+      - --enable-introspection=no
+    organize:
+      snap/fractal/current/usr: usr
+    build-packages:
+      - gtk-doc-tools
+      - intltool
+      - gnome-common
+      - gobject-introspection
+      - valac
+
+  fractal:
+    after: [gspell]
+    parse-info: [usr/share/metainfo/org.gnome.Fractal.appdata.xml]
+    source: .
+    source-type: git
+    plugin: meson
+    meson-parameters: [--prefix=/usr]
+    organize:
+      snap/fractal/current/usr: usr
+    build-packages:
+      - curl
+      - libssl-dev
+      - libgstreamer1.0-dev
+      - libgstreamer-plugins-bad1.0-dev
+      - libgstreamer-plugins-base1.0-dev
+      - libgstreamer-plugins-good1.0-dev
+      - libges-1.0-dev
+    stage-packages:
+      - gstreamer1.0-plugins-bad
+      - gstreamer1.0-plugins-base
+      - gstreamer1.0-plugins-good
+      - gstreamer1.0-plugins-ugly
+      - libges-1.0-0
+      - libgstreamer1.0-0
+      - libgstreamer-plugins-bad1.0-0
+      - libgstreamer-plugins-base1.0-0
+      - libgstreamer-plugins-good1.0-0
+      - libusb-1.0-0
+      - libslang2
+      - libgpm2
+    build-environment:
+      - PATH: $HOME/.cargo/bin:$PATH
+      - PKG_CONFIG_PATH: $SNAPCRAFT_STAGE/usr/lib/pkgconfig:$PKG_CONFIG_PATH
+    override-pull: |
+      snapcraftctl pull
+      snapcraftctl set-version $(git describe --tags --abbrev=10)
+    override-build: |
+      curl https://sh.rustup.rs -sSf | sh -s -- -y
+      . $HOME/.cargo/env
+      rustup toolchain install nightly
+      rustup default nightly
+      snapcraftctl build
+    prime:
+      - -usr/lib/*/libpango*
+      - -usr/lib/*/libfribidi*
+      - -usr/lib/*/libharf*
+
+  # Find files provided by the base and platform snap and ensure they aren't
+  # duplicated in this snap
+  cleanup:
+    after: [fractal]
+    plugin: nil
+    build-snaps: [core18, gnome-3-34-1804]
+    override-prime: |
+      set -eux
+      for snap in "core18" "gnome-3-34-1804"; do
+        cd "/snap/$snap/current" && find . -type f,l -name *.so.* -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
+      done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]