build/linux: Take Snap version: from meson.build

This reduces the burden over the project maintainer.
This commit is contained in:
Bruno Lopes 2025-10-11 09:14:15 -03:00
parent 6e9523f15a
commit 3e8fa656bc
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

View file

@ -32,7 +32,7 @@ NAME=$(awk '/^name:/ { print $2 }' snapcraft.yaml)
TRACK=$(awk -F. '/-Dbuild-id=/ { print $NF }' snapcraft.yaml)
## Get info about GIMP version
GIMP_VERSION=$(awk '/^version:/ { print $2 }' snapcraft.yaml)
GIMP_VERSION=$(awk -F"'" '/version:/ {print $2; exit}' meson.build)
gimp_release=$([ "$(awk '/^grade:/ { print $2 }' snapcraft.yaml)" != 'devel' ] && echo true || echo false)
printf "(INFO): Name: $NAME (track: $TRACK) | Version: $GIMP_VERSION\n"

View file

@ -37,7 +37,7 @@ ls "$(echo /snap/gnome*-sdk/current/usr/lib/$(gcc -print-multiarch)/pkgconfig)"
## Versioning the snap
Aside from setting the version of gimp, we also:
Unlike the flatpak, we do not need to manually set babl, gegl or GIMP tags, just:
* For a **nightly** build, set "devel" on "grade" and
use "experimental" on build-id at gimp part "meson-parameters".

View file

@ -1,6 +1,5 @@
name: gimp
adopt-info: gimp
version: 3.1.5
grade: devel
base: core24
compression: lzo
@ -143,6 +142,9 @@ parts:
- gegl
source: .
source-type: local
override-pull: |
craftctl default
craftctl set version="$(awk -F"'" '/version:/ {print $2; exit}' $CRAFT_PART_SRC/meson.build)"
build-environment: *SNAP_ENVIRON
plugin: meson
meson-parameters: