snap: Port to core22

- Migration according to https://forum.snapcraft.io/t/micro-howto-migrate-from-core20-to-core22/30188
- Also declare all snaps stable
pull/1280/head
Maximilian Federle 2022-07-11 20:04:46 +02:00 committed by Paul Kahler
parent bc4244e099
commit c65e31bece
1 changed files with 15 additions and 17 deletions

View File

@ -1,5 +1,5 @@
name: solvespace name: solvespace
base: core20 base: core22
summary: Parametric 2d/3d CAD summary: Parametric 2d/3d CAD
adopt-info: solvespace adopt-info: solvespace
description: | description: |
@ -15,6 +15,7 @@ description: |
confinement: strict confinement: strict
license: GPL-3.0 license: GPL-3.0
compression: lzo compression: lzo
grade: stable
layout: layout:
/usr/share/solvespace: /usr/share/solvespace:
@ -24,11 +25,11 @@ apps:
solvespace: solvespace:
command: usr/bin/solvespace command: usr/bin/solvespace
desktop: solvespace.desktop desktop: solvespace.desktop
extensions: [gnome-3-38] extensions: [gnome]
plugs: [opengl, unity7, home, removable-media, gsettings, network] plugs: [opengl, unity7, home, removable-media, gsettings, network]
cli: cli:
command: usr/bin/solvespace-cli command: usr/bin/solvespace-cli
extensions: [gnome-3-38] extensions: [gnome]
plugs: [home, removable-media, network] plugs: [home, removable-media, network]
parts: parts:
@ -37,16 +38,14 @@ parts:
source: ./solvespace-snap-src source: ./solvespace-snap-src
source-type: local source-type: local
override-pull: | override-pull: |
snapcraftctl pull craftctl default
git submodule update --init extlib/libdxfrw extlib/mimalloc extlib/eigen git submodule update --init extlib/libdxfrw extlib/mimalloc extlib/eigen
override-build: | override-build: |
snapcraftctl build craftctl default
project_version=$(grep CMAKE_PROJECT_VERSION:STATIC CMakeCache.txt | cut -d "=" -f2) project_version=$(grep CMAKE_PROJECT_VERSION:STATIC CMakeCache.txt | cut -d "=" -f2)
cd $SNAPCRAFT_PART_SRC cd $CRAFT_PART_SRC
version="$project_version~$(git rev-parse --short=8 HEAD)" version="$project_version~$(git rev-parse --short=8 HEAD)"
snapcraftctl set-version "$version" craftctl set version="$version"
git describe --exact-match HEAD && grade="stable" || grade="devel"
snapcraftctl set-grade "$grade"
cmake-parameters: cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
@ -54,8 +53,6 @@ parts:
- -DSNAP=ON - -DSNAP=ON
- -DENABLE_OPENMP=ON - -DENABLE_OPENMP=ON
- -DENABLE_LTO=ON - -DENABLE_LTO=ON
build-snaps:
- gnome-3-38-2004-sdk
build-packages: build-packages:
- zlib1g-dev - zlib1g-dev
- libpng-dev - libpng-dev
@ -67,6 +64,7 @@ parts:
- libspnav-dev - libspnav-dev
- git - git
- g++ - g++
- libc6-dev
stage-packages: stage-packages:
- libspnav0 - libspnav0
- libsigc++-2.0-0v5 - libsigc++-2.0-0v5
@ -74,14 +72,14 @@ parts:
cleanup: cleanup:
after: [solvespace] after: [solvespace]
plugin: nil plugin: nil
build-snaps: [gnome-3-38-2004] build-snaps: [gnome-42-2204]
override-prime: | override-prime: |
set -eux set -eux
for snap in "gnome-3-38-2004"; do # List all content-snaps you're using here for snap in "gnome-42-2204"; do # List all content-snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \; cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" "$CRAFT_PRIME/usr/{}" \;
done done
for cruft in bug lintian man; do for cruft in bug lintian man; do
rm -rf $SNAPCRAFT_PRIME/usr/share/$cruft rm -rf $CRAFT_PRIME/usr/share/$cruft
done done
find $SNAPCRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete
find $SNAPCRAFT_PRIME/usr/share -type d -empty -delete find $CRAFT_PRIME/usr/share -type d -empty -delete