Skip to content

Commit

Permalink
Modify snap
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Dec 4, 2024
1 parent 1b0df20 commit 30caefc
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 42 deletions.
4 changes: 3 additions & 1 deletion App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/App/SerialPortAssistant.ico
COMPONENT Application)

if(UNIX AND NOT ANDROID)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/share/org.Rabbit.SerialPortAssistant.desktop
configure_file(${CMAKE_SOURCE_DIR}/share/org.Rabbit.SerialPortAssistant.desktop.in
${CMAKE_BINARY_DIR}/org.Rabbit.SerialPortAssistant.desktop @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/org.Rabbit.SerialPortAssistant.desktop
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications"
COMPONENT Application)
INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/share/SerialPortAssistant.sh
Expand Down
10 changes: 7 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ install:
- cd cmake-%CMAKE_VERSION%-windows-i386
- set PATH="%CD%/bin";%PATH%

# - cd %OTHER_SOURCE%
# - set VCPKG_DIR=%OTHER_SOURCE%\vcpkg
# - if not exist %VCPKG_DIR% (git clone "https://github.com/microsoft/vcpkg.git" && cd "%VCPKG_DIR%" && git checkout -b 995451296a8237ff0ea4213b9deda73bb3f5229a 995451296a8237ff0ea4213b9deda73bb3f5229a && bootstrap-vcpkg.bat)
- cd %OTHER_SOURCE%
- set VCPKG_ROOT=%OTHER_SOURCE%\vcpkg
- if not exist %VCPKG_ROOT% (git clone "https://github.com/microsoft/vcpkg.git" && cd "%VCPKG_ROOT%" && git checkout -b 995451296a8237ff0ea4213b9deda73bb3f5229a 995451296a8237ff0ea4213b9deda73bb3f5229a && bootstrap-vcpkg.bat)

before_build:

Expand All @@ -77,6 +77,10 @@ build_script:
-DRABBIT_ENABLE_INSTALL_DEPENDENT=ON ^
-DRABBIT_ENABLE_INSTALL_QT=ON ^
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=OFF ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
-DVCPKG_MANIFEST_DIR="%APPVEYOR_BUILD_FOLDER%/vcpkg/manifests" ^
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^
-DVCPKG_APPLOCAL_DEPS=ON ^
-DQT_DIR=%QT_ROOT%/lib/cmake/qt5 ^
-DQt5_DIR=%QT_ROOT%/lib/cmake/qt5
- cmake --build . --config Release
Expand Down
5 changes: 2 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ Section: main
Priority: optional
Maintainer: Kang Lin <kl222@126.com>
Build-Depends: cmake, debhelper (>=13~), debhelper-compat (=13), fakeroot,
libssl-dev, rabbitcommon-dev (>=2.2.6),
libssl-dev, libcmark-dev, rabbitcommon-dev (>=2.2.6),
qt6-tools-dev, qt6-tools-dev-tools, qt6-base-dev, qt6-base-dev-tools,
qt6-l10n-tools, qt6-translations-l10n, qt6-scxml-dev,
qt6-webengine-dev, qt6-webengine-dev-tools, libqt6serialport6-dev
qt6-l10n-tools, qt6-translations-l10n, qt6-scxml-dev, libqt6serialport6-dev
Standards-Version: 4.6.2
Homepage: https://github.com/KangLin/SerialPortAssistant
Vcs-Git: https://github.com/KangLin/SerialPortAssistant.git
Expand Down
3 changes: 1 addition & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ override_dh_auto_configure:
${PARAS}

override_dh_auto_build:
cmake --build $(BUILD_DIR) --config Release \
--parallel $(if "`cat /proc/cpuinfo |grep 'processor' |wc -l`", `cat /proc/cpuinfo |grep 'processor' |wc -l`, 1)
cmake --build $(BUILD_DIR) --config Release --parallel $(nproc)

override_dh_auto_install:
cmake --install $(BUILD_DIR) --config Release \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
# https://specifications.freedesktop.org/desktop-entry-spec/latest/
[Desktop Entry]
Type=Application
Name=Serial Port Assistant
GenericName=Serial Port Assistant
Comment=Serial Port Assistant
Name[zh_CN]=串口助手
GenericName[zh_CN]=串口助手
Comment[zh_CN]=串口助手

Icon=org.Rabbit.SerialPortAssistant
Exec=/opt/SerialPortAssistant/bin/SerialPortAssistant.sh
Exec=SerialPortAssistant
Path=@CMAKE_INSTALL_PREFIX@/bin
Terminal=false
StartupNotify=true

Expand All @@ -20,3 +16,15 @@ Categories=Utility;Development;Debugger
# https://www.freedesktop.org/wiki/Specifications/mime-apps-spec/
# https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
MimeType=application/octet-stream;text/plain;

Name=Serial Port Assistant
GenericName=Serial Port Assistant
Comment=Serial Port Assistant

Name[zh_CN]=串口助手
GenericName[zh_CN]=串口助手
Comment[zh_CN]=串口助手

Name[zh_TW]=串口助手
GenericName[zh_TW]=串口助手
Comment[zh_TW]=串口助手
37 changes: 11 additions & 26 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,17 @@ parts:
- -*

serialportassistant:
after: [rabbitcommon]
# see: https://snapcraft.io/docs/supported-plugins
# See 'snapcraft plugins'
plugin: cmake # See: https://snapcraft.io/docs/cmake-plugin
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: .
after:
- rabbitcommon
build-packages:
- libcmark-dev
- cmark
- libssl-dev
- libcrypt-dev
- qttools5-dev
- qtbase5-dev
- libqt5scxml5-dev
- libqt5serialport5-dev
- qtwebengine5-dev
- qtwebengine5-dev-tools
- qtwebengine5-private-dev
- libqt5svg5-dev
stage-packages:
- libcmark0.30.2
- libopengl0
Expand All @@ -78,27 +66,24 @@ parts:
- libglu1-mesa
- libssl3
- libcrypt1
- libqt5scxml5
- libqt5serialport5
- libqt5webengine5
- libqt5webenginewidgets5
- libqt5svg5
- libqt5xml5
- libc6
- libgcc-s1
- libstdc++6
- zlib1g
cmake-parameters:
# See: https://snapcraft.io/docs/parts-environment-variables
- -DRabbitCommon_DIR=$CRAFT_STAGE/RabbitCommon/
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/opt/SerialPortAssistant
# See: https://snapcraft.io/docs/overrides
override-stage: |
cd $CRAFT_PART_INSTALL/opt/SerialPortAssistant/bin
if [ ! -f serialportassistant ]; then
ln -s SerialPortAssistant serialportassistant
fi
# 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
sed -i 's|Path=/opt/SerialPortAssistant/bin|Path=\$\{SNAP\}/opt/SerialPortAssistant/bin|' $CRAFT_PART_INSTALL/opt/SerialPortAssistant/share/applications/org.Rabbit.SerialPortAssistant.desktop
snapcraftctl stage
# organize:
# usr/share/qt5/resources: opt/SerialPortAssistant/bin
# usr/share/qt5/translations: opt/SerialPortAssistant/bin
prime:
- -usr/bin/cmark
- -opt/SerialPortAssistant/bin/cmark
Expand Down

0 comments on commit 30caefc

Please sign in to comment.