Skip to content

Commit

Permalink
SNAP: Add snap/snapcraft.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Aug 22, 2024
1 parent 6ca2766 commit 75a89e0
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
debian/files
*.snap
*.substvars
debian/.debhelper/
debian/debhelper-build-stamp
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sed -i "s/v[0-9]\+\.[0-9]\+\.[0-9]\+/${VERSION}/g" ${SOURCE_DIR}/README*.md
DEBIAN_VERSION=`echo ${VERSION}|cut -d "v" -f 2`

sed -i "s/ SET(SerialPortAssistant_VERSION .*)/ SET(SerialPortAssistant_VERSION \"${DEBIAN_VERSION}\")/g" ${SOURCE_DIR}/App/CMakeLists.txt

sed -i "s/version:.*'[0-9]\+\.[0-9]\+\.[0-9]\+'/version: '${DEBIAN_VERSION}'/g" ${SOURCE_DIR}/snap/snapcraft.yaml
sed -i "s/serialportassistant_[0-9]\+\.[0-9]\+\.[0-9]\+/serialportassistant_${DEBIAN_VERSION}/g" ${SOURCE_DIR}/README*.md
sed -i "s/serialportassistant (.*)/serialportassistant (${DEBIAN_VERSION})/g" ${SOURCE_DIR}/debian/changelog
sed -i "s/SerialPortAssistant_VERSION:.*/SerialPortAssistant_VERSION: ${DEBIAN_VERSION}/g" ${SOURCE_DIR}/.github/workflows/ubuntu.yml
Expand Down
103 changes: 103 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: serialportassistant
base: core24 # the base snap is the execution environment for this snap
version: '0.5.26' # just for humans, typically '1.2+git' or '1.3.2'
icon: snap/opt/SerialPortAssistant/share/pixmaps/SerialPortAssistant.png
summary: Serial Port Assistant
description: |
Serial port assistant
.
Author: Kang Lin <[email protected]>
.
Donation:
.
https://github.com/KangLin/RabbitCommon/raw/master/Src/Resource/image/Contribute.png
.
https://gitee.com/kl222/RabbitCommon/raw/master/Src/Resource/image/Contribute.png
.
https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
rabbitcommon:
# see: https://snapcraft.io/docs/supported-plugins
plugin: dump
source: https://github.com/KangLin/RabbitCommon.git
source-type: git
source-branch: master
source-depth: 1
organize:
'*': RabbitCommon/
prime:
- -*

serialportassistant:
after: [rabbitcommon]
# See 'snapcraft plugins'
plugin: cmake
cmake-parameters:
# See: https://snapcraft.io/docs/parts-environment-variables
- -DRabbitCommon_DIR=$CRAFT_STAGE/RabbitCommon/
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/opt/SerialPortAssistant
source: .
build-packages:
- cmark
- libqt6serialport6-dev
- qt6-webengine-dev
- qt6-webengine-dev-tools
- libcrypt-dev
- libopengl-dev
- libglu1-mesa-dev
- qt6-tools-dev
- qt6-tools-dev-tools
- qt6-base-dev
- qt6-base-dev-tools
- qt6-qpa-plugins
- libqt6svg6-dev
- qt6-l10n-tools
- qt6-translations-l10n
- qt6-scxml-dev
- qt6-webengine-dev
- qt6-webengine-dev-tools
- libpulse-mainloop-glib0
stage-packages:
- libqt6core6
- libqt6gui6
- libqt6multimedia6
- libqt6network6
- libqt6printsupport6
- libqt6statemachine6
- libqt6webenginewidgets6
- libqt6widgets6
- libqt6xml6
- libc6
- libgcc-s1
- libstdc++6
- libssl3
- zlib1g
# See: https://snapcraft.io/docs/overrides
override-stage: |
snapcraftctl stage
sed -i 's|Exec=/opt/SerialPortAssistant/bin/SerialPortAssistant\.sh|Exec=$SNAP/opt/SerialPortAssistant/bin/SerialPortAssistant\.sh|' $CRAFT_STAGE/opt/SerialPortAssistant/share/applications/org.Rabbit.SerialPortAssistant.desktop
sed -i 's|Icon=org\.Rabbit\.SerialPortAssistant|Icon=/opt/SerialPortAssistant/share/pixmaps/SerialPortAssistant\.png|' $CRAFT_STAGE/opt/SerialPortAssistant/share/applications/org.Rabbit.SerialPortAssistant.desktop
prime:
- usr/lib/**/*.so*
- opt/SerialPortAssistant
- -opt/SerialPortAssistant/bin/cmark
- -opt/SerialPortAssistant/include
- -opt/SerialPortAssistant/lib/cmake
- -opt/SerialPortAssistant/lib/pkgconfig
- -opt/SerialPortAssistant/lib/*.a

# apps:
# serialportassistant:
# command: desktop-launch $SNAP/opt/SerialPortAssistant/bin/SerialPortAssistant.sh
# # See: https://snapcraft.io/docs/desktop-menu-support#heading--desktop-key
# desktop: opt/SerialPortAssistant/share/applications/org.Rabbit.SerialPortAssistant.desktop
# environment:
# LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/opt/SerialPortAssistant/lib/$SNAPCRAFT_ARCH_TRIPLET
# plugs:
# - desktop
# - desktop-legacy

0 comments on commit 75a89e0

Please sign in to comment.