Compare commits

...

6 Commits

Author SHA1 Message Date
Maximilian Federle
4f1567ec97 projectview: Only append .qet if not snap or flatpak 2022-01-26 17:04:17 +01:00
Maximilian Federle
e152717a05 add workflow for building candidate snap 2022-01-20 10:09:35 +01:00
Maximilian Federle
0f645e9b76 snap: set version manually 2022-01-20 09:53:17 +01:00
Maximilian Federle
821e681520 projectview: Re-enable appending qet suffix if not running as flatpak
It was removed in b121dad for all platforms.
Only disable appending the suffix for the flatpak platform
by testing for the FLATPAK_ID environment variable.
2022-01-20 09:46:19 +01:00
Maximilian Federle
d27bc35022 snap: Remove framework snap prompt
Now that https://github.com/snapcore/snapcraft/pull/3596 has been
released in snapcraft 6.0.1, drop the prompt that tells users to
disconnect the old framework snap.

Also drop --enable-experimental-extensions from CI  because kde-neon
has been declared stable for core20.
2022-01-20 09:45:43 +01:00
Maximilian Federle
61d3adad9b snap: Port to core20 2022-01-20 09:44:33 +01:00
4 changed files with 49 additions and 49 deletions

View File

@@ -0,0 +1,20 @@
name: Publish Candidate Snap
on:
push:
branches:
- "snap/latest/candidate"
workflow_dispatch:
jobs:
publish_amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: candidate

View File

@@ -1,15 +1,5 @@
#!/bin/sh
# a KDE session forces the KDE Plasma platformtheme which is incompatible with QET
# unset the ENV vars in that case to prevent loading of the theme
if [ ! -z "$KDE_FULL_SESSION" ]; then
unset KDE_FULL_SESSION
fi
if echo "$XDG_CURRENT_DESKTOP" | grep -q KDE; then
unset XDG_CURRENT_DESKTOP
fi
# migrate .qet directory from SNAP_USER_DATA to SNAP_USER_COMMON
from="$SNAP_USER_DATA/.qet"
to="$SNAP_USER_COMMON/.qet"
@@ -23,12 +13,4 @@ fi
mkdir -p "$HOME/.qet"
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 "${@}"

View File

@@ -1,7 +1,7 @@
name: qelectrotech
title: QElectroTech
base: core18
adopt-info: qelectrotech
base: core20
version: "0.8.0"
license: GPL-2.0
summary: Electrical diagram editor
description: |
@@ -10,10 +10,7 @@ description: |
grade: stable
confinement: strict
architectures:
- build-on: amd64
run-on: amd64
compression: lzo
layout:
/usr/local/share/qelectrotech:
@@ -30,15 +27,14 @@ apps:
extensions: [kde-neon]
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control]
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
QT_QPA_PLATFORMTHEME: gtk3
QT_AUTO_SCREEN_SCALE_FACTOR: 1
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:
command: bin/qelectrotech-launch $SNAP/bin/qet_tb_generator
command: bin/qet_tb_generator
command-chain:
- bin/qelectrotech-launch
extensions: [kde-neon]
plugs: *plugs
environment: *env
@@ -58,8 +54,8 @@ parts:
qet-tb-generator:
plugin: python
python-version: python3
source: https://github.com/qelectrotech/qet_tb_generator.git
source: https://github.com/raulroda/qet_tb_generator-plugin.git
python-packages: [PySimpleGUI]
stage-packages:
- python3-lxml
- python3-tk
@@ -68,14 +64,14 @@ parts:
kde-sdk-setup:
plugin: nil
build-snaps:
- kde-frameworks-5-core18-sdk
- kde-frameworks-5-qt-5-15-3-core20-sdk
build-packages:
- g++
- mesa-common-dev
- libglvnd-dev
- rsync
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:
after: [kde-sdk-setup]
@@ -91,19 +87,15 @@ parts:
after: [kde-sdk-setup]
plugin: nil
source: .
stage-packages: [ git, sqlite3 ]
stage-packages: [ git, sqlite3, xdg-user-dirs ]
build-packages:
- git
- libsqlite3-dev
override-pull: |
snapcraftctl pull
snap_version=$(git describe --dirty)
modified_displayed_version=$snap_version".snap"
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h
snapcraftctl set-version "$snap_version"
override-build: |
modified_displayed_version="${SNAPCRAFT_PROJECT_VERSION}.snap"
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h
qmake "$SNAPCRAFT_PART_SRC/qelectrotech.pro"
make -j$(nproc)
make -j${SNAPCRAFT_PARALLEL_BUILD_COUNT}
make install INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL"
override-stage: |
snapcraftctl stage
@@ -114,11 +106,14 @@ parts:
cleanup:
after: [qelectrotech, dxf-to-qet, qet-tb-generator]
plugin: nil
build-snaps: [core18, kde-frameworks-5-core18]
build-snaps: [kde-frameworks-5-qt-5-15-3-core20]
override-prime: |
# Remove all files from snap that are already included in the base snap or in
# any connected content snaps
set -eux
for snap in "core18" "kde-frameworks-5-core18"; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
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/{}" "$SNAPCRAFT_PRIME/usr/{}" \;
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

View File

@@ -339,8 +339,11 @@ QString ProjectView::askUserForFilePath(bool assign) {
// if no filepath is provided, return an empty string
if (filepath.isEmpty()) return(filepath);
// // if the name does not end with the .qet extension, append it
// if (!filepath.endsWith(".qet", Qt::CaseInsensitive)) filepath += ".qet";
// if the name does not end with the .qet extension and we're _not_ using xdg-desktop-portal, append it
bool usesPortal =
qEnvironmentVariableIsSet("FLATPAK_ID") ||
qEnvironmentVariableIsSet("SNAP_NAME");
if (!filepath.endsWith(".qet", Qt::CaseInsensitive) && !usesPortal) filepath += ".qet";
if (assign) {
// assign the provided filepath to the currently edited project