Skip to content

Commit

Permalink
SNAP: Modify snap/snapcraft.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Sep 6, 2024
1 parent 75a89e0 commit b53ceaa
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
VCPKG_TARGET_TRIPLET: x64-android
ANDROID_ABI: x86_64

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-latest

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- qt_version: 5.12.12

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/tree/main
# See: https://github.com/actions/runner-images/
runs-on: macos-13

env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
run:
shell: cmd

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: windows-latest

env:
Expand Down Expand Up @@ -56,8 +58,7 @@ jobs:
mingw-w64-x86_64-nsis ^
mingw-w64-x86_64-gcc ^
mingw-w64-x86_64-qt5 ^
mingw-w64-x86_64-qtwebkit ^
mingw-w64-x86_64-qt5-serialport ^
mingw-w64-x86_64-cmark ^
mingw-w64-x86_64-zlib ^
mingw-w64-x86_64-openssl ^
git base-devel
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
CMAKE_GENERATOR_PLATFORM: Win32
VCPKG_MANIFEST_DIR: "\\vcpkg\\manifests"

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: windows-latest

env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
matrix:
BUILD_TYPE: [Release]

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-latest

env:
Expand Down
127 changes: 76 additions & 51 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# How Snapcraft builds snaps: https://snapcraft.io/docs/how-snapcraft-builds
# Snapcraft.yaml schema: https://snapcraft.io/docs/snapcraft-yaml-schema
# Debug snaps with snap try: https://snapcraft.io/docs/snap-try
# Debugging snaps: https://snapcraft.io/docs/debug-snaps
name: serialportassistant
base: core24 # the base snap is the execution environment for this snap
base: core22 # 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
license: GPL-3.0+
contact: [email protected]
donation:
- https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png
issues: https://github.com/KangLin/SerialPortAssistant/issues
summary: Serial Port Assistant # 79 char long summary
description: |
Serial port assistant
.
Expand All @@ -15,14 +23,20 @@ description: |
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
grade: stable # must be 'stable' to release into candidate/stable channels
# Confinement levels: https://snapcraft.io/docs/classic-confinement#heading--levels
# Classic confinement: https://snapcraft.io/docs/classic-confinement
confinement: strict # use 'strict' once you have the right plugs and slots

# lifecycle: https://snapcraft.io/docs/parts-lifecycle
# Iterating over a build: https://snapcraft.io/docs/iterating-over-a-build
# Part directives: https://snapcraft.io/docs/snapcraft-yaml-schema#part-directives
parts:
rabbitcommon:
# see: https://snapcraft.io/docs/supported-plugins
plugin: dump
# See 'snapcraft plugins'
plugin: dump # See: https://snapcraft.io/docs/dump-plugin
source: https://github.com/KangLin/RabbitCommon.git
source-type: git
source-branch: master
Expand All @@ -34,8 +48,9 @@ parts:

serialportassistant:
after: [rabbitcommon]
# see: https://snapcraft.io/docs/supported-plugins
# See 'snapcraft plugins'
plugin: cmake
plugin: cmake # See: https://snapcraft.io/docs/cmake-plugin
cmake-parameters:
# See: https://snapcraft.io/docs/parts-environment-variables
- -DRabbitCommon_DIR=$CRAFT_STAGE/RabbitCommon/
Expand All @@ -44,60 +59,70 @@ parts:
source: .
build-packages:
- cmark
- libqt6serialport6-dev
- qt6-webengine-dev
- qt6-webengine-dev-tools
- libssl-dev
- 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
- qttools5-dev
- qtbase5-dev
- libqt5scxml5-dev
- libqt5serialport5-dev
- qtwebengine5-dev
- qtwebengine5-dev-tools
- libqt5svg5-dev
stage-packages:
- libqt6core6
- libqt6gui6
- libqt6multimedia6
- libqt6network6
- libqt6printsupport6
- libqt6statemachine6
- libqt6webenginewidgets6
- libqt6widgets6
- libqt6xml6
- libqt5scxml5
- libqt5serialport5
- libqt5webengine5
- libqt5webengine-data
- libqt5webenginecore5
- libqt5webenginewidgets5
- libqt5svg5
- libc6
- libgcc-s1
- libstdc++6
- libssl3
- zlib1g
# See: https://snapcraft.io/docs/overrides
# See: https://snapcraft.io/docs/overrides
override-stage: |
cd $CRAFT_PART_INSTALL/opt/SerialPortAssistant/bin
if [ ! -f serialportassistant ]; then
ln -s SerialPortAssistant serialportassistant
fi
sed -i 's|Icon=org\.Rabbit\.SerialPortAssistant|Icon=/opt/SerialPortAssistant/share/pixmaps/SerialPortAssistant\.png|' $CRAFT_PART_INSTALL/opt/SerialPortAssistant/share/applications/org.Rabbit.SerialPortAssistant.desktop
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
- -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
# App directives: https://snapcraft.io/docs/snapcraft-yaml-schema#app-directives
apps:
serialportassistant:
command-chain:
- snap/command-chain/desktop-launch
command: opt/SerialPortAssistant/bin/serialportassistant
# 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:${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}:${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/libproxy
QT_PLUGIN_PATH: ${SNAP}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/qt6/plugins/
PATH: $SNAP/opt/SerialPortAssistant/bin:$PATH
# List extensions, run `snapcraft extensions`
extensions:
- kde-neon
# See: https://snapcraft.io/docs/supported-interfaces
plugs:
- network
- network-bind
- network-status
- serial-port
- desktop
- desktop-legacy
- wayland
- x11
- opengl
- home

0 comments on commit b53ceaa

Please sign in to comment.