| 1 |
name: qelectrotech |
| 2 |
title: QElectroTech |
| 3 |
base: core20 |
| 4 |
adopt-info: qelectrotech |
| 5 |
license: GPL-2.0 |
| 6 |
summary: Electrical diagram editor |
| 7 |
description: | |
| 8 |
QElectroTech, or QET in short, is a libre and open source desktop application |
| 9 |
to create diagrams and schematics. |
| 10 |
|
| 11 |
grade: stable |
| 12 |
confinement: strict |
| 13 |
compression: lzo |
| 14 |
|
| 15 |
architectures: |
| 16 |
- build-on: amd64 |
| 17 |
run-on: amd64 |
| 18 |
|
| 19 |
layout: |
| 20 |
/usr/local/share/qelectrotech: |
| 21 |
symlink: $SNAP/usr/local/share/qelectrotech |
| 22 |
/usr/share/libdrm/amdgpu.ids: |
| 23 |
symlink: $SNAP/kf5/usr/share/libdrm/amdgpu.ids |
| 24 |
|
| 25 |
apps: |
| 26 |
qelectrotech: |
| 27 |
command: usr/local/bin/qelectrotech |
| 28 |
command-chain: |
| 29 |
- bin/qelectrotech-launch |
| 30 |
desktop: usr/local/share/applications/qelectrotech.desktop |
| 31 |
extensions: [kde-neon] |
| 32 |
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control] |
| 33 |
environment: &env |
| 34 |
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6 |
| 35 |
HOME: $SNAP_USER_COMMON |
| 36 |
PYTHONPATH: $SNAP:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3.8:$SNAP/usr/lib/python3.8/lib-dynload |
| 37 |
|
| 38 |
qet-tb-generator: |
| 39 |
command: bin/qet_tb_generator |
| 40 |
command-chain: |
| 41 |
- bin/qelectrotech-launch |
| 42 |
extensions: [kde-neon] |
| 43 |
plugs: *plugs |
| 44 |
environment: *env |
| 45 |
|
| 46 |
dxf-to-qet: |
| 47 |
command: bin/DXFtoQET |
| 48 |
extensions: [kde-neon] |
| 49 |
plugs: *plugs |
| 50 |
environment: *env |
| 51 |
|
| 52 |
parts: |
| 53 |
launchers: |
| 54 |
plugin: dump |
| 55 |
source: build-aux/snap/local/launchers |
| 56 |
organize: |
| 57 |
'*': bin/ |
| 58 |
|
| 59 |
qet-tb-generator: |
| 60 |
plugin: python |
| 61 |
source: https://github.com/raulroda/qet_tb_generator-plugin.git |
| 62 |
python-packages: [PySimpleGUI] |
| 63 |
stage-packages: |
| 64 |
- python3-lxml |
| 65 |
- python3-tk |
| 66 |
- libtk8.6 |
| 67 |
|
| 68 |
kde-sdk-setup: |
| 69 |
plugin: nil |
| 70 |
build-snaps: |
| 71 |
- kde-frameworks-5-qt-5-15-3-core20-sdk |
| 72 |
build-packages: |
| 73 |
- g++ |
| 74 |
- mesa-common-dev |
| 75 |
- libglvnd-dev |
| 76 |
- rsync |
| 77 |
override-build: | |
| 78 |
rsync -a --ignore-existing /snap/kde-frameworks-5-qt-5-15-3-core20-sdk/current/ / |
| 79 |
|
| 80 |
dxf-to-qet: |
| 81 |
after: [kde-sdk-setup] |
| 82 |
plugin: nil |
| 83 |
source: https://github.com/qelectrotech/DXFtoQET-2020.git |
| 84 |
override-build: | |
| 85 |
qmake "$SNAPCRAFT_PART_SRC/DXFtoQET.pro" |
| 86 |
make -j$(nproc) |
| 87 |
mkdir -p "$SNAPCRAFT_PART_INSTALL/bin" |
| 88 |
cp DXFtoQET "$SNAPCRAFT_PART_INSTALL/bin/" |
| 89 |
|
| 90 |
qelectrotech: |
| 91 |
after: [kde-sdk-setup] |
| 92 |
plugin: nil |
| 93 |
source: . |
| 94 |
stage-packages: [ git, sqlite3, xdg-user-dirs ] |
| 95 |
build-packages: |
| 96 |
- git |
| 97 |
- libsqlite3-dev |
| 98 |
override-build: | |
| 99 |
displayed_version=$(grep "displayedVersion" sources/qet.h | tr -d "\";" | cut -d" " -f5) |
| 100 |
snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)" |
| 101 |
modified_displayed_version="${snap_version}.snap" |
| 102 |
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h |
| 103 |
snapcraftctl set-version "$snap_version" |
| 104 |
qmake "$SNAPCRAFT_PART_SRC/qelectrotech.pro" |
| 105 |
make -j${SNAPCRAFT_PARALLEL_BUILD_COUNT} |
| 106 |
make install INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL" |
| 107 |
override-stage: | |
| 108 |
snapcraftctl stage |
| 109 |
# patch desktop file with correct icon path |
| 110 |
SED_CMD="sed -i -E s|^Icon=(.*)|Icon=\${SNAP}/usr/local/share/icons/hicolor/128x128/apps/\1.png|g" |
| 111 |
$SED_CMD usr/local/share/applications/qelectrotech.desktop |
| 112 |
|
| 113 |
cleanup: |
| 114 |
after: [qelectrotech, dxf-to-qet, qet-tb-generator] |
| 115 |
plugin: nil |
| 116 |
build-snaps: [kde-frameworks-5-qt-5-15-3-core20] |
| 117 |
override-prime: | |
| 118 |
set -eux |
| 119 |
for snap in "kde-frameworks-5-qt-5-15-3-core20"; do # List all content-snaps you're using here |
| 120 |
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \; |
| 121 |
done |
| 122 |
for cruft in bug lintian man; do |
| 123 |
rm -rf $SNAPCRAFT_PRIME/usr/share/$cruft |
| 124 |
done |
| 125 |
find $SNAPCRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete |
| 126 |
find $SNAPCRAFT_PRIME/usr/share -type d -empty -delete |