mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
Fix traceback when selecting "Project" menu "Launch the terminal block creation plugin" item: Traceback (most recent call last): File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 33, in <module> sys.exit(load_entry_point('qet-tb-generator==1.3.1', 'console_scripts', 'qet_tb_generator')()) File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load module = import_module(match.group('module')) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/main.py", line 98, in <module> import src.PySimpleGUI as sg File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/PySimpleGUI.py", line 95, in <module> import tkinter as tk ModuleNotFoundError: No module named 'tkinter'
112 lines
3.4 KiB
YAML
112 lines
3.4 KiB
YAML
name: qelectrotech
|
|
title: QElectroTech
|
|
base: core22
|
|
adopt-info: qelectrotech
|
|
license: GPL-2.0
|
|
summary: Electrical diagram editor
|
|
description: |
|
|
QElectroTech, or QET in short, is a libre and open source desktop application
|
|
to create diagrams and schematics.
|
|
|
|
grade: stable
|
|
confinement: strict
|
|
compression: lzo
|
|
|
|
architectures:
|
|
- build-on: amd64
|
|
build-for: amd64
|
|
- build-on: arm64
|
|
build-for: arm64
|
|
|
|
layout:
|
|
/usr/local/share/qelectrotech:
|
|
symlink: $SNAP/usr/local/share/qelectrotech
|
|
|
|
|
|
apps:
|
|
qelectrotech:
|
|
command: usr/local/bin/qelectrotech
|
|
common-id: qelectrotech.desktop
|
|
extensions:
|
|
- kde-neon
|
|
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control, wayland, x11]
|
|
environment: &env
|
|
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
|
|
HOME: $SNAP_USER_COMMON
|
|
PYTHONPATH: $SNAP:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3.10:$SNAP/usr/lib/python3.10/lib-dynload
|
|
|
|
qet-tb-generator:
|
|
command: bin/qet_tb_generator
|
|
extensions:
|
|
- kde-neon
|
|
plugs: *plugs
|
|
environment: *env
|
|
|
|
|
|
parts:
|
|
launchers:
|
|
plugin: dump
|
|
source: build-aux/snap/local/launchers
|
|
organize:
|
|
'*': bin/
|
|
|
|
qet-tb-generator:
|
|
plugin: python
|
|
source: https://github.com/raulroda/qet_tb_generator-plugin.git
|
|
python-packages: [PySimpleGUI]
|
|
stage-packages:
|
|
- python3-lxml
|
|
- python3-tk
|
|
- libtk8.6
|
|
|
|
kde-sdk-setup:
|
|
plugin: nil
|
|
build-snaps:
|
|
- kf5-5-110-qt-5-15-11-core22-sdk
|
|
build-packages:
|
|
- g++
|
|
- mesa-common-dev
|
|
- libglvnd-dev
|
|
- rsync
|
|
override-build: |
|
|
rsync -a --ignore-existing /snap/kf5-5-110-qt-5-15-11-core22-sdk/current/ /
|
|
|
|
|
|
qelectrotech:
|
|
after: [kde-sdk-setup]
|
|
plugin: nil
|
|
source: .
|
|
stage-packages: [ git, sqlite3, xdg-user-dirs ]
|
|
build-packages:
|
|
- git
|
|
- libsqlite3-dev
|
|
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')
|
|
snap_version="${displayed_version}-g$(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
|
|
craftctl set version="$snap_version"
|
|
qmake "$CRAFT_PART_SRC/qelectrotech.pro"
|
|
make -j${CRAFT_PARALLEL_BUILD_COUNT}
|
|
make install INSTALL_ROOT="$CRAFT_PART_INSTALL"
|
|
override-stage: |
|
|
craftctl default
|
|
# patch desktop file with correct icon path
|
|
SED_CMD="sed -i -E s|^Icon=(.*)|Icon=\${SNAP}/usr/local/share/icons/hicolor/128x128/apps/\1.png|g"
|
|
$SED_CMD usr/local/share/applications/org.qelectrotech.qelectrotech.desktop
|
|
|
|
cleanup:
|
|
after: [qelectrotech, qet-tb-generator]
|
|
plugin: nil
|
|
build-snaps: [kf5-5-110-qt-5-15-11-core22]
|
|
override-prime: |
|
|
set -eux
|
|
for snap in "kf5-5-110-qt-5-15-11-core22"; 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/{}" \;
|
|
done
|
|
for cruft in bug lintian man; do
|
|
rm -rf $CRAFT_PRIME/usr/share/$cruft
|
|
done
|
|
find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete
|
|
find $CRAFT_PRIME/usr/share -type d -empty -delete
|