From 8edbd3de4166fc08c622a9c69a10acc0059f17df Mon Sep 17 00:00:00 2001 From: Soumyadeep Ghosh Date: Wed, 10 Jul 2024 01:22:45 +0530 Subject: [PATCH] snap: update for `core24` --- .github/workflows/snap.yaml | 4 +-- build-aux/snapcraft.yaml | 60 +++++++++++++++++++++++++++++++++++++ snap/snapcraft.yaml | 37 +++++++++++++++-------- 3 files changed, 85 insertions(+), 16 deletions(-) create mode 100644 build-aux/snapcraft.yaml diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index bbe4c3c..ecda316 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -16,14 +16,12 @@ jobs: steps: - name: Checkout Git repository uses: actions/checkout@v4 - - name: Use source from current branch - run: | - sed -i 's/source:.*/source: ./g' snap/snapcraft.yaml - name: Build Test Mousam Snap uses: snapcore/action-build@v1 id: snapcraft-build with: snapcraft-args: "-v" + path: "build-aux/snapcraft.yaml" - uses: actions/upload-artifact@v4 with: name: mousam-snap diff --git a/build-aux/snapcraft.yaml b/build-aux/snapcraft.yaml new file mode 100644 index 0000000..794fee1 --- /dev/null +++ b/build-aux/snapcraft.yaml @@ -0,0 +1,60 @@ +name: mousam +adopt-info: mousam +grade: stable +confinement: strict +base: core24 +platforms: + amd64: + arm64: + +parts: + python-deps: + source: . + plugin: python + python-packages: + - requests==2.30.0 + prime: + - -usr/bin/activate* + - -usr/bin/Activate* + - -usr/bin/pip* + - -usr/bin/python* + - -include + - -lib + - -lib64 + - -share + - -pyvenv.cfg + organize: + lib/python3.12/site-packages: usr/lib/python3/dist-packages + bin: usr/bin + + mousam: + source: https://github.com/amit9838/mousam.git + source-depth: 1 + #source-tag: used when there will be a new release with these fixes + plugin: meson + meson-parameters: [ --prefix=/snap/mousam/current/usr ] + override-build: | + craftctl default + sed -e '1c#!/usr/bin/env python3' -i ${CRAFT_PART_INSTALL}/snap/mousam/current/usr/bin/mousam + parse-info: [ usr/share/appdata/io.github.amit9838.mousam.appdata.xml ] + organize: + snap/mousam/current: . + prime: + - -snap/mousam + +slots: + mousam: + interface: dbus + bus: session + name: io.github.amit9838.mousam + +apps: + mousam: + command: usr/bin/mousam + common-id: io.github.amit9838.mousam + desktop: usr/share/applications/io.github.amit9838.mousam.desktop + extensions: [ gnome ] + environment: + PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$PYTHONPATH + plugs: + - network diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 82be3de..794fee1 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,33 +1,44 @@ name: mousam adopt-info: mousam - grade: stable confinement: strict - -base: core22 -architectures: - - build-on: amd64 - - build-on: arm64 - - build-on: armhf +base: core24 +platforms: + amd64: + arm64: parts: + python-deps: + source: . + plugin: python + python-packages: + - requests==2.30.0 + prime: + - -usr/bin/activate* + - -usr/bin/Activate* + - -usr/bin/pip* + - -usr/bin/python* + - -include + - -lib + - -lib64 + - -share + - -pyvenv.cfg + organize: + lib/python3.12/site-packages: usr/lib/python3/dist-packages + bin: usr/bin + mousam: source: https://github.com/amit9838/mousam.git source-depth: 1 #source-tag: used when there will be a new release with these fixes plugin: meson meson-parameters: [ --prefix=/snap/mousam/current/usr ] - override-pull: | - craftctl default - pip install --prefix=$CRAFT_PART_INSTALL/usr requests==2.30.0 override-build: | craftctl default sed -e '1c#!/usr/bin/env python3' -i ${CRAFT_PART_INSTALL}/snap/mousam/current/usr/bin/mousam parse-info: [ usr/share/appdata/io.github.amit9838.mousam.appdata.xml ] organize: snap/mousam/current: . - usr/local: usr - usr/lib/python3: usr/lib/python3.10 prime: - -snap/mousam @@ -44,6 +55,6 @@ apps: desktop: usr/share/applications/io.github.amit9838.mousam.desktop extensions: [ gnome ] environment: - PYTHONPATH: $SNAP/usr/lib/python3.10/dist-packages:$PYTHONPATH + PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$PYTHONPATH plugs: - network