forked from LibreCAD/LibreCAD
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsnapcraft.yaml
167 lines (161 loc) · 5.49 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: librecad
version: '2.2.2-alpha'
grade: stable
base: core22
confinement: strict
license: GPL-2.0
summary: "librecad: is a 2D open source CAD"
compression: lzo
description: |
LibreCAD is a cross-platform 2D CAD program written in C++17. It can read DXF/DWG files
and can write DXF/PDF/SVG files. It supports point/line/circle/ellipse/parabola/spline
primitives. The user interface is highly customizable, and has dozens of translations.
Code repository:
https://www.github.com/LibreCAD/LibreCAD
environment:
LD_LIBRARY_PATH: $SNAP/usr/local/lib/:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/:$SNAP/usr/lib64/:$LD_LIBRARY_PATH
apps:
librecad:
command: usr/bin/librecad
plugs:
- home
- desktop
- desktop-legacy
- opengl
- wayland
- unity7
- x11
desktop: usr/share/applications/org.librecad.librecad.desktop
common-id: org.librecad.librecad.desktop
environment:
SNAP_DESKTOP_RUNTIME: $SNAP
QTCHOOSER_NO_GLOBAL_DIR: 1
QT_SELECT: snappy-qt6
HOME: $SNAP_USER_DATA
QTDIR: /snap/kde-qt6-core22-sdk/current/qt6
QT_PLUGIN_PATH: /snap/kde-qt6-core22-sdk/current/qt6/plugins
extensions:
- kde-neon-6
plugs:
desktop:
mount-host-font-cache: false
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes
#kf5-5-113-qt-5-15-11-core22:
#content: kf5-5-113-qt-5-15-11-core22-all
#interface: content
#default-provider: kf5-5-113-qt-5-15-11-core22
#target: $SNAP/kf5
#kf6-core24-sdk:
kf-qt-latest:
interface: content
content: kde-qt6-core22
default-provider: kde-qt6-core22
target: kf6
kf-qt-ext-latest:
interface: content
content: kf6-core22
default-provider: kf6-core22
target: kf6
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
parts:
librecad:
plugin: cmake
#make-parameters: ["FLAVOR=qt6"]
#plugin: cmake
#qmake-parameters:
# - "QMAKE_CFLAGS+=-march=x86_64"
# - "QMAKE_CXXFLAGS+=-march=x86-64"
build-environment:
- QT_SELECT: qt6
source: .
#build-snaps:
# - kde-qt6-core22-sdk
build-packages:
- build-essential
#- qtbase5-dev #qt6-base-dev
#- qttools5-dev #qt6-tools-dev
#- qttools5-dev-tools #qt6-tools-dev-tools
#- librsvg2-bin
#- libqt5waylandclient5-dev #qt6-wayland-dev
- libfreetype6-dev
#- libicu-dev
#- libqt5opengl5-dev #libqt6opengl6-dev
#- libcairo2-dev
#- libpango-1.0-0
#- libpango1.0-dev
- libboost-dev
- libgl1-mesa-dev # avoid openGL fatal error: GL/gl.h: No such file or directory
#- libqt5svg5-dev #libqt6svg6-dev
#- libgtest-dev
#- libcurl4-gnutls-dev
#- libgtk-3-dev
- rsync
- libqt6opengl6-dev
- qt6-base-dev
- qt6-declarative-dev
- qt6-declarative-private-dev
- qt6-multimedia-dev
- qt6-tools-dev
- qt6-tools-dev-tools
- qt6-wayland-dev
- qt6-wayland-dev-tools
- qt6-image-formats-plugins
- qt6-qmltooling-plugins
override-build: |
# craftctl default
#export QT_SELECT=qt6
#pwd
cmake ../../..
make -r -j$(nproc)
#/snap/kde-qt6-core22-sdk/33/usr/bin/qt6/qmake6 -r 'QMAKESPEC=/snap/kde-qt6-core22-sdk/current/usr/lib/x86_64-linux-gnu/qt6/mkspecs QMAKE_CFLAGS+=-isystem $CRAFT_STAGE/usr/include' 'QMAKE_CXXFLAGS+=-isystem $CRAFT_STAGE/usr/include' 'QMAKE_LFLAGS+=-L$CRAFT_STAGE/lib -L$CRAFT_STAGE/usr/lib -L$CRAFT_STAGE/usr/lib/x86_64-linux-gnu'
#/snap/kf6-core22/current/usr/bin/qt6/qmake -r 'QMAKE_CC=clang QMAKE_CXX=clang++ QMAKE_CFLAGS+=-isystem $CRAFT_STAGE/usr/include' 'QMAKE_CXXFLAGS+=-isystem $CRAFT_STAGE/usr/include' 'QMAKE_LFLAGS+=-L$CRAFT_STAGE/lib -L$CRAFT_STAGE/usr/lib -L$CRAFT_STAGE/usr/lib/x86_64-linux-gnu'
#make -r -j$(nproc)
#stage-packages:
#- libfreetype6
#- libqt5gui5 #libqt6gui6
#- libqt5printsupport5 #libqt6printsupport6
stage:
- -usr/share/pkgconfig
override-stage: |
#echo "1"
#echo $PWD
#find .. -type f -name librecad
echo "current folder"
pwd
ls
pushd ..
echo "parent folder"
pwd
ls
popd
export SRC_DIR=../parts/librecad/build/
echo $CRAFT_STAGE
mkdir -p $CRAFT_STAGE/usr/bin
mkdir -p $CRAFT_STAGE/usr/share/icons
mkdir -p $CRAFT_STAGE/usr/share/librecad/resources/qm
mkdir -p $CRAFT_STAGE/usr/share/applications
mkdir -p usr/bin
mkdir -p usr/share/librecad
cp -a $SRC_DIR/librecad $CRAFT_STAGE/usr/bin/
#cp -a $SRC_DIR/ttf2lff $CRAFT_STAGE/usr/bin/
cp -a $SRC_DIR/*.qm $CRAFT_STAGE/usr/share/librecad/resources/qm
rsync -vaut ../librecad/support/* $CRAFT_STAGE/usr/share/librecad/resources/
export DESKTOP_DIR=../parts/librecad/src/desktop
find ../CI -type f -name librecad.svg -exec cp -av '{}' $CRAFT_STAGE/usr/share/icons/ ';'
cp -a $DESKTOP_DIR/*.desktop $CRAFT_STAGE/usr/share/applications/org.librecad.librecad.desktop
sed -i'' -e 's:^\s*Icon=.*$:Icon=/usr/share/icons/librecad.svg:' $CRAFT_STAGE/usr/share/applications/org.librecad.librecad.desktop
cp -a $DESKTOP_DIR/org.librecad.*.xml $CRAFT_STAGE/usr/share/applications/org.librecad.librecad.xml
craftctl default
override-prime: |
rsync -av ../stage/* ./
craftctl default