-
Notifications
You must be signed in to change notification settings - Fork 9
/
snapcraft.yaml
268 lines (253 loc) · 7.84 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: freecad
base: core20
adopt-info: freecad
summary: An open source parametric 3D CAD modeler
description: |
FreeCAD is a parametric 3D modeler. Parametric modeling
allows you to easily modify your design by going back into
your model history and changing its parameters. FreeCAD is
open source (LGPL license) and completely modular, allowing
for very advanced extension and customization.
FreeCAD is multiplatfom, and reads and writes many open
file formats such as STEP, IGES, STL and others.
Please also consider RealThunder's well-known FreeCAD fork
`freecad-realthunder`: https://snapcraft.io/freecad-realthunder
Commands:
freecad: Run FreeCAD
freecad.cmd: Run FreeCAD command line interface
freecad.pip: Install python packages for user (not system-wide).
E.g. `freecad.pip install py_slvs` for Assembly3.
grade: devel
confinement: strict
compression: lzo
license: LGPL-2.0-or-later
assumes: [snapd2.55] # for cups interface
layout:
/usr/share/libdrm/amdgpu.ids:
symlink: $SNAP/kf5/usr/share/libdrm/amdgpu.ids
/usr/share/openmpi:
symlink: $SNAP/usr/share/openmpi
/etc/openmpi:
bind: $SNAP/etc/openmpi
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/openmpi:
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/openmpi
/usr/bin/orted:
symlink: $SNAP/usr/bin/orted
/usr/share/pmix:
symlink: $SNAP/usr/share/pmix
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pmix:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pmix
/etc/matplotlibrc:
bind-file: $SNAP/etc/matplotlibrc
/usr/share/matplotlib:
symlink: $SNAP/usr/share/matplotlib
/usr/share/qt5:
symlink: $SNAP/kf5/usr/share/qt5
/usr/bin/dot:
symlink: $SNAP/usr/bin/dot
/etc/povray:
symlink: $SNAP/etc/povray
# this is not used or needed for anything other than to trigger automatic
# installation of the cups snap via "default-provider: cups"
plugs:
foo-install-cups:
interface: content
content: foo
default-provider: cups
target: $SNAP_DATA/foo
environment:
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack # numpy
LD_PRELOAD: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libstubchown.so
FREECAD_USER_HOME: $SNAP_USER_COMMON
GIT_EXEC_PATH: $SNAP/usr/lib/git-core
GIT_TEMPLATE_DIR: $SNAP/usr/share/git-core/templates
GIT_CONFIG_NOSYSTEM: 1
ELMER_HOME: $SNAP/usr
QTWEBENGINE_DISABLE_SANDBOX: 1
PYTHONPYCACHEPREFIX: $SNAP_USER_COMMON/.pycache
PYTHONUSERBASE: $SNAP_USER_COMMON/.local
PIP_USER: 1
PYTHONPATH: &pypath $PYTHONUSERBASE/lib/python3.8/site-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages
SNAP_PYTHONPATH: *pypath
QT_QPA_PLATFORM: xcb # Coin3D cannot run on Wayland
apps:
freecad:
command: usr/bin/FreeCAD
extensions: [kde-neon]
common-id: org.freecadweb.FreeCAD.desktop
desktop: usr/share/applications/org.freecadweb.FreeCAD.desktop
plugs: &plugs
- home
- opengl
- removable-media
- gsettings
- network
- browser-support
- unity7
- cups
cmd:
command: usr/bin/FreeCADCmd
extensions: [kde-neon]
plugs: *plugs
pip:
command: bin/pip
plugs: *plugs
package-repositories:
- type: apt
ppa: elmer-csc-ubuntu/elmer-csc-ppa
- type: apt
ppa: openscad/releases
parts:
stub-chown:
plugin: meson
source: snap/local/stub-chown
meson-parameters:
- --prefix=/usr
snap-setup-mod:
plugin: dump
source: snap/local/snap-setup-mod
organize:
"*": usr/Mod/SnapSetup/
freecad:
plugin: cmake
source: https://github.com/FreeCAD/FreeCAD.git
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_INSTALL_LIBDIR=lib
- -DBUILD_QT5=ON
- -DCMAKE_BUILD_TYPE=Release
- -DPYTHON_EXECUTABLE=/usr/bin/python3
- -DPYTHON_INCLUDE_DIR=/usr/include/python3.8
- -DPYTHON_LIBRARY=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpython3.8.so
- -DFREECAD_USE_EXTERNAL_ZIPIOS=ON
- -DFREECAD_USE_PYBIND11=ON
- -DFREECAD_USE_QT_FILEDIALOG=ON
- -DBUILD_FLAT_MESH=ON
build-snaps:
- freecad-deps-core20
stage-snaps:
- freecad-deps-core20
build-packages:
- g++
- git
- libboost-all-dev
- libsimage-dev # optional
- libspnav-dev # optional
- libeigen3-dev
- libgts-bin
- libgts-dev
- libkdtree++-dev
- libmedc-dev
- libopencv-dev
- libproj-dev
- libx11-dev
- libxerces-c-dev
- libzipios++-dev
- swig
- python3-dev
- libcoin-dev
- libvtk7-dev
- libpyside2-dev
- libshiboken2-dev
- pybind11-dev
- libfreeimage-dev
stage-packages:
- libaec0
- libboost-filesystem1.71.0
- libboost-program-options1.71.0
- libboost-python1.71.0
- libboost-regex1.71.0
- libboost-system1.71.0
- libboost-thread1.71.0
- libboost-date-time1.71.0
- libhdf5-openmpi-103
- libhwloc15
- libilmbase24
- libjxr0
- libmedc11
- libmed11
- libopenexr24
- libopenmpi3
- libpython3.8
- libpython3.8-minimal
- libpython3.8-stdlib
- libraw19
- libspnav0
- libsz2
- libxerces-c3.2
- libzipios++0v5
- python3-tk # FEM
- python3-yaml # FEM
- python3-numpy
- python3-matplotlib
- python3-six
- python3-pyparsing
- python3-setuptools-scm
- python3-cycler
- python3-dateutil
- python3-git
- python3-ply # OpenSCAD
- python3-pivy
- python3-markdown # Addon manager
- python3-pyside2.qtcore
- python3-pyside2.qtgui
- python3-pyside2.qtsvg
- python3-pyside2.qtwidgets
- python3-pyside2.qtnetwork
- python3-pyside2.qtwebenginewidgets
- python3-pyside2.qtuitools
- calculix-ccx # FEM
- libcoin80c
- libfreeimage3
- libtbb2
- libvtk7.1p
- elmerfem-csc # FEM
- openscad # OpenSCAD
- povray
override-build: |
kde_sdk_dir="/snap/kde-frameworks-5-91-qt-5-15-3-core20-sdk/current"
mkdir -p /etc/xdg/qtchooser
cp "$kde_sdk_dir/etc/xdg/qtchooser/default.conf" "/etc/xdg/qtchooser/default.conf"
snapcraftctl build
sed -i -E \
"s|^Icon=(.*)|Icon=\${SNAP}/usr/share/icons/hicolor/scalable/apps/org.freecadweb.FreeCAD.svg|g" \
$SNAPCRAFT_PART_INSTALL/usr/share/applications/org.freecadweb.FreeCAD.desktop
cd $SNAPCRAFT_PART_SRC
version_major=$(grep "set(PACKAGE_VERSION_MAJOR" CMakeLists.txt | tr -d '()"' | cut -d" " -f2)
version_minor=$(grep "set(PACKAGE_VERSION_MINOR" CMakeLists.txt | tr -d '()"' | cut -d" " -f2)
git_hash=$(git rev-parse --short=8 HEAD)
version="${version_major}.${version_minor}-g$git_hash"
snapcraftctl set-version "$version"
pip:
plugin: python
python-packages:
- pip
stage-packages:
- python3-distutils
stage:
- -pyvenv.cfg
graphviz:
plugin: nil
build-packages:
- graphviz
stage-packages:
- graphviz
override-build: |
dot -c
cp \
/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/graphviz/config* \
${SNAPCRAFT_PART_INSTALL}/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}/graphviz/
cleanup:
after: [stub-chown, freecad, pip, snap-setup-mod, graphviz]
plugin: nil
build-snaps: [kde-frameworks-5-91-qt-5-15-3-core20]
override-prime: |
set -eux
for snap in "kde-frameworks-5-91-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