-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsnapcraft.yaml
320 lines (305 loc) · 9.79 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: freecad
base: core22
adopt-info: freecad
donation: https://wiki.freecad.org/Donate
issues: https://github.com/FreeCAD/FreeCAD-snap/issues
website: https://freecad.org
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.
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
layout:
/usr/bin/mpirun: # ElmerSolver_mpi
symlink: $SNAP/usr/bin/orterun
/usr/share/openmpi:
symlink: $SNAP/usr/share/openmpi
/etc/openmpi:
bind: $SNAP/etc/openmpi
/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/openmpi:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/openmpi
/usr/bin/orted:
symlink: $SNAP/usr/bin/orted
/usr/share/pmix:
symlink: $SNAP/usr/share/pmix
/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pmix:
symlink: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pmix
/etc/matplotlibrc:
bind-file: $SNAP/etc/matplotlibrc
/usr/share/matplotlib:
symlink: $SNAP/usr/share/matplotlib
/usr/bin/dot: # Graphviz for dependency graph
symlink: $SNAP/usr/bin/dot
/usr/bin/unflatten: # Graphviz for dependency graph
symlink: $SNAP/usr/bin/unflatten
/usr/share/povray-3.7: # Raytracing
symlink: $SNAP/usr/share/povray-3.7
plugs:
# this is not used or needed for anything other than to trigger automatic
# installation of the cups snap via "default-provider: cups"
foo-install-cups:
interface: content
content: foo
default-provider: cups
target: $SNAP_DATA/foo
# Necessary to enable semaphores for numba, OpenMP etc.
shared-memory:
private: true
environment:
LD_LIBRARY_PATH: "$SNAP/usr/lib/:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/:$SNAP/kf5/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/:$SNAP/kf5/usr/lib:/$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack:$LD_LIBRARY_PATH"
LD_PRELOAD: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/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
PYTHONPYCACHEPREFIX: $SNAP_USER_COMMON/.pycache
PYTHONUSERBASE: $SNAP_USER_COMMON/.local
PIP_USER: 1
PYTHONPATH: &pypath $PYTHONUSERBASE/lib/python3.10/site-packages:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3/dist-packages
SNAP_PYTHONPATH: *pypath
QT_QPA_PLATFORM: xcb # Coin3D cannot run on Wayland
POVINI: $SNAP/etc/povray/3.7/povray.ini # Raytracing
apps:
freecad:
command: usr/bin/FreeCAD
extensions: [kde-neon]
common-id: org.freecad.FreeCAD.desktop
desktop: usr/share/applications/org.freecad.FreeCAD.desktop
plugs: &plugs
- home
- opengl
- removable-media
- gsettings
- network
- browser-support
- unity7
- cups
- shared-memory
command-chain:
- snap/command-chain/desktop-launch
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
components:
- main
suites:
- jammy
key-id: 444DABCF3667D0283F894EDDE6D4736255751E5D
url: http://origin.archive.neon.kde.org/user
key-server: keyserver.ubuntu.com
parts:
stub-chown:
plugin: meson
source: $CRAFT_PROJECT_DIR/snap/local/stub-chown
source-type: local
build-packages:
- meson
meson-parameters:
- --prefix=/usr
snap-setup-mod:
plugin: dump
source: $CRAFT_PROJECT_DIR/snap/local/snap-setup-mod
source-type: local
organize:
"*": usr/Mod/SnapSetup/
freecad:
plugin: cmake
source: https://github.com/FreeCAD/FreeCAD.git
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_INSTALL_LIBDIR=lib
- -DCMAKE_BUILD_TYPE=Release
- -DPYTHON_EXECUTABLE=/usr/bin/python3
- -DPYTHON_INCLUDE_DIR=/usr/include/python3.10
- -DPYTHON_LIBRARY=/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libpython3.10.so
- -DFREECAD_USE_PYBIND11=ON
- -DFREECAD_USE_QT_FILEDIALOG=ON
- -DBUILD_FLAT_MESH=ON
- -DCMAKE_FIND_ROOT_PATH=$CRAFT_STAGE\;/snap/kde-qt5-core22-sdk/current\;/snap/kf5-core22-sdk/current/usr
build-snaps:
- freecad-deps-core22/candidate
stage-snaps:
- freecad-deps-core22/candidate
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
- libyaml-cpp-dev
- swig
- python3-dev
- libcoin-dev
- libvtk7-dev
- libpyside2-dev
- libshiboken2-dev
- pybind11-dev
- libfreeimage-dev
- openscad
- python3-pivy
- python3-matplotlib
stage-packages:
- libaec0
- libboost-filesystem1.74.0
- libboost-program-options1.74.0
- libboost-python1.74.0
- libboost-regex1.74.0
- libboost-system1.74.0
- libboost-thread1.74.0
- libboost-date-time1.74.0
- libhdf5-openmpi-103
- libhwloc15
- libilmbase25
- libjxr0
- libmedc11
- libmed11
- libopenexr25
- libopenmpi3
- on amd64: [libpsm-infinipath1]
- libpython3.10
- libpython3.10-minimal
- libpython3.10-stdlib
- libraw20
- libspnav0
- libsz2
- libxerces-c3.2
- libyaml-cpp0.7
- python3-tk # FEM
- python3-yaml # FEM
- python3-numba # FEM (fcFEM)
- python3-scipy # FEM
- python3-numpy
- python3-matplotlib
- python3-six
- python3-packaging # Path
- python3-pyparsing
- python3-setuptools-scm
- python3-collada # DAE import
- python3-cycler
- python3-dateutil
- python3-git
- python3-ply # OpenSCAD
- python3-pivy
- python3-pyside2.qtcore
- python3-pyside2.qtgui
- python3-pyside2.qtsvg
- python3-pyside2.qtwidgets
- python3-pyside2.qtnetwork
- python3-pyside2.qtuitools
- python3-requests
- calculix-ccx # FEM
- libcoin80c
- libfreeimage3
- libtbb2
- libvtk7.1p
- elmerfem-csc # FEM
- openscad # OpenSCAD
override-build: |
SHIBOKEN_BIN_PATH="/workspace/usr/bin/shiboken2"
if [ ! -e $SHIBOKEN_BIN_PATH ]; then
mkdir -p "$(dirname "${SHIBOKEN_BIN_PATH}")"
ln -s /usr/bin/shiboken2 $SHIBOKEN_BIN_PATH
fi
craftctl default
sed -i -E \
"s|^Icon=(.*)|Icon=\${SNAP}/usr/share/icons/hicolor/scalable/apps/org.freecad.FreeCAD.svg|g" \
$CRAFT_PART_INSTALL/usr/share/applications/org.freecad.FreeCAD.desktop
if [ "$CRAFT_ARCH_BUILD_FOR" = amd64 ]; then
ln -sf ../libpsm1/libpsm_infinipath.so.1.16 $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libpsm_infinipath.so.1
fi
cd $CRAFT_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"
craftctl set version="$version"
python-packages:
plugin: python
source: .
source-type: local
build-packages:
- libsuitesparse-dev
stage-packages:
- python3-distutils # pip
- libamd2 # scikit-sparse
- libcamd2 # scikit-sparse
- libccolamd2 # scikit-sparse
- libcholmod3 # scikit-sparse
- libcolamd2 # scikit-sparse
- libsuitesparseconfig5 # scikit-sparse
python-packages:
- ifcopenshell == 0.8.0 # BIM
- opencamlib # CAM
- pip
- scikit-sparse
stage:
- -pyvenv.cfg
- -lib/python3.10/site-packages/scipy*
- -lib/python3.10/site-packages/numpy*
graphviz:
plugin: nil
build-packages:
- graphviz
stage-packages:
- graphviz
override-build: |
dot -c
cp \
/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/graphviz/config* \
${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/graphviz/
cleanup:
after: [stub-chown, freecad, python-packages, snap-setup-mod, graphviz]
plugin: nil
build-snaps: [kf5-core22]
override-prime: |
set -eux
for snap in "kf5-core22"; do # List all content-snaps you're using here
cd "/snap/$snap/current" && \
find . -type f,l \
-not -path "./usr/lib/python3/dist-packages/*" \
-not -name 'libblas.so*' \
-not -name 'liblapack.so*' \
-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' -not -name 'ThirdPartyLibraries.html' -not -name 'LICENSE.html' -delete
find $CRAFT_PRIME/usr/share -type d -empty -delete
find $CRAFT_PRIME/usr/lib -type f,l \
-name 'libQt*.so*' `# remove all Qt libs pulled in from Ubuntu repos` \
-not -name 'libQt5Gamepad.so*' -delete `# for OpenSCAD`
lint:
ignore:
- library