mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
snap: Port to core20
This commit is contained in:
@@ -1,13 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# a KDE session forces the KDE Plasma platformtheme which is incompatible with QET
|
# check if _only_ the correct framework snap is connected
|
||||||
# unset the ENV vars in that case to prevent loading of the theme
|
framework_name=$(grep "name:" $SNAP/kf5/meta/snap.yaml | cut -d" " -f2)
|
||||||
if [ ! -z "$KDE_FULL_SESSION" ]; then
|
if [ "$framework_name" != "kde-frameworks-5-qt-5-15-3-core20" ]; then
|
||||||
unset KDE_FULL_SESSION
|
downloads_dir=$(xdg-user-dir DOWNLOAD)
|
||||||
fi
|
test ! -d "$downloads_dir" && mkdir -p "$downloads_dir"
|
||||||
|
instructions_file="snap.qelectrotech.update-instructions.html"
|
||||||
if echo "$XDG_CURRENT_DESKTOP" | grep -q KDE; then
|
target="$downloads_dir/$instructions_file"
|
||||||
unset XDG_CURRENT_DESKTOP
|
cp "$SNAP/update-instructions/$instructions_file" "$target"
|
||||||
|
xdg-open "$target"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# migrate .qet directory from SNAP_USER_DATA to SNAP_USER_COMMON
|
# migrate .qet directory from SNAP_USER_DATA to SNAP_USER_COMMON
|
||||||
@@ -23,12 +25,4 @@ fi
|
|||||||
mkdir -p "$HOME/.qet"
|
mkdir -p "$HOME/.qet"
|
||||||
ln -snf "$SNAP/bin/DXFtoQET" "$HOME/.qet/DXFtoQET"
|
ln -snf "$SNAP/bin/DXFtoQET" "$HOME/.qet/DXFtoQET"
|
||||||
|
|
||||||
# start desktop portal. Open & save dialogs might fail if it is not running
|
|
||||||
dbus-send --print-reply \
|
|
||||||
--dest=org.freedesktop.DBus \
|
|
||||||
/org/freedesktop/DBus \
|
|
||||||
org.freedesktop.DBus.StartServiceByName \
|
|
||||||
string:org.freedesktop.portal.Desktop \
|
|
||||||
uint32:0
|
|
||||||
|
|
||||||
exec "${@}"
|
exec "${@}"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
name: qelectrotech
|
name: qelectrotech
|
||||||
title: QElectroTech
|
title: QElectroTech
|
||||||
base: core18
|
base: core20
|
||||||
adopt-info: qelectrotech
|
adopt-info: qelectrotech
|
||||||
license: GPL-2.0
|
license: GPL-2.0
|
||||||
summary: Electrical diagram editor
|
summary: Electrical diagram editor
|
||||||
@@ -10,6 +10,7 @@ description: |
|
|||||||
|
|
||||||
grade: stable
|
grade: stable
|
||||||
confinement: strict
|
confinement: strict
|
||||||
|
compression: lzo
|
||||||
|
|
||||||
architectures:
|
architectures:
|
||||||
- build-on: amd64
|
- build-on: amd64
|
||||||
@@ -30,15 +31,14 @@ apps:
|
|||||||
extensions: [kde-neon]
|
extensions: [kde-neon]
|
||||||
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control]
|
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control]
|
||||||
environment: &env
|
environment: &env
|
||||||
__EGL_VENDOR_LIBRARY_DIRS: $SNAP/kf5/usr/share/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d
|
|
||||||
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
|
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
|
||||||
QT_QPA_PLATFORMTHEME: gtk3
|
|
||||||
QT_AUTO_SCREEN_SCALE_FACTOR: 1
|
|
||||||
HOME: $SNAP_USER_COMMON
|
HOME: $SNAP_USER_COMMON
|
||||||
PYTHONPATH: $SNAP:$SNAP/lib/python3.6/site-packages:$SNAP/usr/lib/python3.6:$SNAP/usr/lib/python3.6/lib-dynload
|
PYTHONPATH: $SNAP:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3.8:$SNAP/usr/lib/python3.8/lib-dynload
|
||||||
|
|
||||||
qet-tb-generator:
|
qet-tb-generator:
|
||||||
command: bin/qelectrotech-launch $SNAP/bin/qet_tb_generator
|
command: bin/qet_tb_generator
|
||||||
|
command-chain:
|
||||||
|
- bin/qelectrotech-launch
|
||||||
extensions: [kde-neon]
|
extensions: [kde-neon]
|
||||||
plugs: *plugs
|
plugs: *plugs
|
||||||
environment: *env
|
environment: *env
|
||||||
@@ -56,10 +56,16 @@ parts:
|
|||||||
organize:
|
organize:
|
||||||
'*': bin/
|
'*': bin/
|
||||||
|
|
||||||
|
update-instructions:
|
||||||
|
plugin: dump
|
||||||
|
source: build-aux/snap/local/update-instructions
|
||||||
|
organize:
|
||||||
|
'*': update-instructions/
|
||||||
|
|
||||||
qet-tb-generator:
|
qet-tb-generator:
|
||||||
plugin: python
|
plugin: python
|
||||||
python-version: python3
|
source: https://github.com/raulroda/qet_tb_generator-plugin.git
|
||||||
source: https://github.com/qelectrotech/qet_tb_generator.git
|
python-packages: [PySimpleGUI]
|
||||||
stage-packages:
|
stage-packages:
|
||||||
- python3-lxml
|
- python3-lxml
|
||||||
- python3-tk
|
- python3-tk
|
||||||
@@ -68,14 +74,14 @@ parts:
|
|||||||
kde-sdk-setup:
|
kde-sdk-setup:
|
||||||
plugin: nil
|
plugin: nil
|
||||||
build-snaps:
|
build-snaps:
|
||||||
- kde-frameworks-5-core18-sdk
|
- kde-frameworks-5-qt-5-15-3-core20-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/kde-frameworks-5-core18-sdk/current/ /
|
rsync -a --ignore-existing /snap/kde-frameworks-5-qt-5-15-3-core20-sdk/current/ /
|
||||||
|
|
||||||
dxf-to-qet:
|
dxf-to-qet:
|
||||||
after: [kde-sdk-setup]
|
after: [kde-sdk-setup]
|
||||||
@@ -91,14 +97,15 @@ parts:
|
|||||||
after: [kde-sdk-setup]
|
after: [kde-sdk-setup]
|
||||||
plugin: nil
|
plugin: nil
|
||||||
source: .
|
source: .
|
||||||
stage-packages: [ git, sqlite3 ]
|
stage-packages: [ git, sqlite3, xdg-user-dirs ]
|
||||||
build-packages:
|
build-packages:
|
||||||
- git
|
- git
|
||||||
- libsqlite3-dev
|
- libsqlite3-dev
|
||||||
override-pull: |
|
override-pull: |
|
||||||
snapcraftctl pull
|
snapcraftctl pull
|
||||||
snap_version=$(git describe --dirty)
|
displayed_version=$(grep "displayedVersion" sources/qet.h | tr -d "\";" | cut -d" " -f5)
|
||||||
modified_displayed_version=$snap_version".snap"
|
snap_version="${displayed_version}~$(git rev-parse --short=8 HEAD)"
|
||||||
|
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
|
||||||
snapcraftctl set-version "$snap_version"
|
snapcraftctl set-version "$snap_version"
|
||||||
override-build: |
|
override-build: |
|
||||||
@@ -114,11 +121,14 @@ parts:
|
|||||||
cleanup:
|
cleanup:
|
||||||
after: [qelectrotech, dxf-to-qet, qet-tb-generator]
|
after: [qelectrotech, dxf-to-qet, qet-tb-generator]
|
||||||
plugin: nil
|
plugin: nil
|
||||||
build-snaps: [core18, kde-frameworks-5-core18]
|
build-snaps: [kde-frameworks-5-qt-5-15-3-core20]
|
||||||
override-prime: |
|
override-prime: |
|
||||||
# Remove all files from snap that are already included in the base snap or in
|
|
||||||
# any connected content snaps
|
|
||||||
set -eux
|
set -eux
|
||||||
for snap in "core18" "kde-frameworks-5-core18"; do # List all content-snaps and base snaps you're using here
|
for snap in "kde-frameworks-5-qt-5-15-3-core20"; do # List all content-snaps you're using here
|
||||||
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
|
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \;
|
||||||
done
|
done
|
||||||
|
for cruft in bug lintian man; do
|
||||||
|
rm -rf $SNAPCRAFT_PRIME/usr/share/$cruft
|
||||||
|
done
|
||||||
|
find $SNAPCRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete
|
||||||
|
find $SNAPCRAFT_PRIME/usr/share -type d -empty -delete
|
||||||
|
|||||||
Reference in New Issue
Block a user