Update snap to Qt6

This commit is contained in:
Laurent Trinques
2026-08-16 08:45:44 +02:00
parent c8ff06459f
commit 99fa186d30
+33 -20
View File
@@ -1,13 +1,12 @@
name: qelectrotech name: qelectrotech
title: QElectroTech title: QElectroTech
base: core22 base: core24
adopt-info: qelectrotech adopt-info: qelectrotech
license: GPL-2.0 license: GPL-2.0
summary: Electrical diagram editor summary: Electrical diagram editor
description: | description: |
QElectroTech, or QET in short, is a libre and open source desktop application QElectroTech, or QET in short, is a libre and open source desktop application
to create diagrams and schematics. to create diagrams and schematics.
grade: stable grade: stable
confinement: strict confinement: strict
compression: lzo compression: lzo
@@ -22,27 +21,25 @@ layout:
/usr/local/share/qelectrotech: /usr/local/share/qelectrotech:
symlink: $SNAP/usr/local/share/qelectrotech symlink: $SNAP/usr/local/share/qelectrotech
apps: apps:
qelectrotech: qelectrotech:
command: usr/local/bin/qelectrotech command: usr/local/bin/qelectrotech
common-id: qelectrotech.desktop common-id: qelectrotech.desktop
extensions: extensions:
- kde-neon - kde-neon-6
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control, wayland, x11] plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control, wayland, x11]
environment: &env environment: &env
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6 TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
HOME: $SNAP_USER_COMMON HOME: $SNAP_USER_COMMON
PYTHONPATH: $SNAP:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3.10:$SNAP/usr/lib/python3.10/lib-dynload PYTHONPATH: $SNAP:$SNAP/lib/python3.12/site-packages:$SNAP/usr/lib/python3.12:$SNAP/usr/lib/python3.12/lib-dynload
qet-tb-generator: qet-tb-generator:
command: bin/qet_tb_generator command: bin/qet_tb_generator
extensions: extensions:
- kde-neon - kde-neon-6
plugs: *plugs plugs: *plugs
environment: *env environment: *env
parts: parts:
launchers: launchers:
plugin: dump plugin: dump
@@ -63,15 +60,16 @@ parts:
kde-sdk-setup: kde-sdk-setup:
plugin: nil plugin: nil
build-snaps: build-snaps:
- kf5-5-110-qt-5-15-11-core22-sdk - kf6-core24-sdk
- kde-qt6-core24-sdk
build-packages: build-packages:
- g++ - g++
- mesa-common-dev - mesa-common-dev
- libglvnd-dev - libglvnd-dev
- rsync - rsync
override-build: | override-build: |
rsync -a --ignore-existing /snap/kf5-5-110-qt-5-15-11-core22-sdk/current/ / rsync -a --ignore-existing /snap/kf6-core24-sdk/current/ /
rsync -a --ignore-existing /snap/kde-qt6-core24-sdk/current/ /
qelectrotech: qelectrotech:
after: [kde-sdk-setup] after: [kde-sdk-setup]
@@ -81,24 +79,39 @@ parts:
- git - git
- sqlite3 - sqlite3
- xdg-user-dirs - xdg-user-dirs
# libxcb-cursor0 was added as a hard dependency of the Qt5 xcb platform # runtime pugixml — nom de paquet à vérifier sur core24/noble,
# plugin in Qt 5.15.x. The kf5-5-110-qt-5-15-11-core22 content snap does # nécessaire car BUILD_PUGIXML=OFF lie contre la lib système
# not bundle it, so dlopen() of libqxcb.so fails on Ubuntu 24.04 hosts - libpugixml1v5
# with "found but could not load" (issue #373). Staging the 22.04 build # libxcb-cursor0 workaround was needed against the Qt5/KF5 core22 content
# of this library satisfies the dep without changing base or Qt version. # snap (issue #373). Not yet re-verified against kf6-core24 — remove this
# if the Qt6 xcb platform plugin loads cleanly without it.
- libxcb-cursor0 - libxcb-cursor0
build-packages: build-packages:
- git - git
- cmake
- ninja-build
- libsqlite3-dev - libsqlite3-dev
- libpugixml-dev
- qt6-tools-dev
- qt6-base-private-dev
- pkgconf
override-build: | override-build: |
displayed_version=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g') displayed_version=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)" snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)"
modified_displayed_version="${snap_version}.snap" modified_displayed_version="${snap_version}.snap"
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h
craftctl set version="$snap_version" craftctl set version="$snap_version"
qmake "$CRAFT_PART_SRC/qelectrotech.pro" cmake -G Ninja -B build -S "$CRAFT_PART_SRC" \
make -j${CRAFT_PARALLEL_BUILD_COUNT} -DCMAKE_INSTALL_PREFIX=/usr \
make install INSTALL_ROOT="$CRAFT_PART_INSTALL" -DCMAKE_BUILD_TYPE=Release \
-DQT_VERSION_MAJOR=6 \
-DBUILD_WITH_KF=ON \
-DBUILD_KF=OFF \
-DPACKAGE_TESTS=OFF \
-DBUILD_PUGIXML=OFF \
-DQET_EXPORT_PROJECT_DB=ON
ninja -C build -j${CRAFT_PARALLEL_BUILD_COUNT}
DESTDIR="$CRAFT_PART_INSTALL" ninja -C build install
override-stage: | override-stage: |
craftctl default craftctl default
# patch desktop file with correct icon path # patch desktop file with correct icon path
@@ -108,10 +121,10 @@ parts:
cleanup: cleanup:
after: [qelectrotech, qet-tb-generator] after: [qelectrotech, qet-tb-generator]
plugin: nil plugin: nil
build-snaps: [kf5-5-110-qt-5-15-11-core22] build-snaps: [kf6-core24]
override-prime: | override-prime: |
set -eux set -eux
for snap in "kf5-5-110-qt-5-15-11-core22"; do # List all content-snaps you're using here for snap in "kf6-core24"; do # List all content-snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" "$CRAFT_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