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 c7b0f61
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 31 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
72 changes: 44 additions & 28 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ description: |
.
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: 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
parts:
rabbitcommon:
# see: https://snapcraft.io/docs/supported-plugins
Expand All @@ -44,60 +46,74 @@ parts:
source: .
build-packages:
- cmark
- libqt6serialport6-dev
- qt6-webengine-dev
- qt6-webengine-dev-tools
- libcrypt-dev
- libopengl-dev
- libglu1-mesa-dev
- libpulse-mainloop-glib0
- qt6-tools-dev
- qt6-tools-dev-tools
- qt6-base-dev
- qt6-base-dev-tools
- qt6-qpa-plugins
- libqt6svg6-dev
- libqt6serialport6-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
- libqt6serialport6
- 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
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:
- gnome
# 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 c7b0f61

Please sign in to comment.