-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcom.prusa3d.PrusaSlicer.yml
executable file
·423 lines (375 loc) · 15.3 KB
/
com.prusa3d.PrusaSlicer.yml
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
app-id: com.prusa3d.PrusaSlicer
runtime: org.gnome.Platform
runtime-version: "47"
sdk: org.gnome.Sdk
command: entrypoint
desktop-file-name-suffix: ""
separate-locales: true
finish-args:
- --share=ipc
- --socket=x11
- --share=network
- --device=all
- --filesystem=home
- --filesystem=xdg-run/gvfs # make GnomeVFS accessible
- --filesystem=/run/media
- --filesystem=/media
# Allow PrusaSlicer to own its session bus.
- --own-name=com.prusa3d.prusaslicer.*
- --system-talk-name=org.freedesktop.UDisks2
- --talk-name=org.freedesktop.DBus.Introspectable.*
- --talk-name=com.prusa3d.prusaslicer.InstanceCheck.*
# set dark theme
- --env=PRUSA_SLICER_DARK_THEME=false
build-options:
strip: true
cflags: ""
cflags-override: true
cxxflags: ""
cxxflags-override: true
cppflags: ""
cppflags-override: true
ldflags: ""
ldflags-override: true
modules:
# xprop, xlib is needed to manipulate the X11 window and set _GTK_THEME_VARIANT dark on X11
# and paint the window dark when PRUSA_SLICER_DARK_THEME is true
# see: entrypoint & set-dark-theme-variant.py (originated from spotify client flatpak)
- name: xprop
sources:
- type: archive
url: https://xorg.freedesktop.org/archive/individual/app/xprop-1.2.5.tar.gz
sha256: b7bf6b6be6cf23e7966a153fc84d5901c14f01ee952fbd9d930aa48e2385d670
- name: python-setuptools_scm
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/57/38/930b1241372a9f266a7df2b184fb9d4f497c2cef2e016b014f82f541fe7c/setuptools_scm-6.0.1.tar.gz
sha256: d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92
- name: python-xlib
buildsystem: simple
build-commands:
- pip3 install --no-deps --no-build-isolation --verbose --prefix=${FLATPAK_DEST} .
sources:
- type: archive
url: https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz
sha256: 55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32
- name: glu
config-opts:
- --disable-static
sources:
- type: archive
url: https://mesa.freedesktop.org/archive/glu/glu-9.0.2.tar.xz
sha256: 6e7280ff585c6a1d9dfcdf2fca489251634b3377bfc33c29e4002466a38d02d4
cleanup:
- /include
- /lib/*.a
- /lib/*.la
- /lib/pkgconfig
# https://docs.flatpak.org/en/latest/module-sources.html
- name: cmake
buildsystem: simple
build-commands:
- mkdir -p /app/cmake
- tar -xf cmake.tar.gz --strip-components=1 -C /app/cmake
sources:
- type: file
url: https://cmake.org/files/v3.27/cmake-3.27.0-linux-x86_64.tar.gz
sha256: 89c7e74d29f442e4734954310e09dd12d13636991f2d90d0ed1bececb8bf9b9c
dest-filename: cmake.tar.gz
only-arches:
- x86_64
- type: file
url: https://cmake.org/files/v3.27/cmake-3.27.0-linux-aarch64.tar.gz
sha256: 97c2f8cf9e063a7acf9f15ed472d87c511bf5cb62d3e42b9c90524fb0c2e4748
dest-filename: cmake.tar.gz
only-arches:
- aarch64
cleanup:
- "*"
- name: PrusaSlicerDeps
buildsystem: simple
build-commands:
# start build
- |
set -e
mkdir -p deps/build && cd deps/build
/app/cmake/bin/cmake ../ \
-DDEP_WX_GTK3=1 \
-DDEP_DOWNLOAD_DIR=/run/build/PrusaSlicerDeps/external-packages \
-DDESTDIR=/app/deps
/app/cmake/bin/cmake --build .
cleanup:
- '*'
sources:
# PrusaSlicer dependencies source
- type: git
url: https://github.com/prusa3d/PrusaSlicer
tag: version_2.9.0
# Cereal
- type: file
url: https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.0.zip
dest: external-packages/Cereal
sha256: 71642cb54658e98c8f07a0f0d08bf9766f1c3771496936f6014169d3726d9657
# EXPAT
- type: file
url: https://github.com/libexpat/libexpat/archive/refs/tags/R_2_4_3.zip
dest: external-packages/EXPAT
sha256: 8851e199d763dc785277d6d414ed3e70ff683915158b51b8d8781df0e3af950a
# OCCT
- type: file
url: https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_1.zip
dest: external-packages/OCCT
sha256: b7cf65430d6f099adc9df1749473235de7941120b5b5dd356067d12d0909b1d3
# NLopt
- type: file
url: https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz
dest: external-packages/NLopt
sha256: c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
# Eigen
- type: file
url: https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip
dest: external-packages/Eigen
sha256: e09b89aae054e9778ee3f606192ee76d645eec82c402c01c648b1fe46b6b9857
# JPEG
- type: file
url: https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.0.1.zip
dest: external-packages/JPEG
sha256: d6d99e693366bc03897677650e8b2dfa76b5d6c54e2c9e70c03f0af821b0a52f
# ZLIB
- type: file
url: https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip
dest: external-packages/ZLIB
sha256: f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3
# heatshrink
- type: file
url: https://github.com/atomicobject/heatshrink/archive/refs/tags/v0.4.1.zip
dest: external-packages/heatshrink
sha256: 2e2db2366bdf36cb450f0b3229467cbc6ea81a8c690723e4227b0b46f92584fe
# PNG
- type: file
url: https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
dest: external-packages/PNG
sha256: 3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
# Boost
- type: file
url: https://github.com/boostorg/boost/releases/download/boost-1.83.0/boost-1.83.0.zip
dest: external-packages/Boost
sha256: 9effa3d7f9d92b8e33e2b41d82f4358f97ff7c588d5918720339f2b254d914c6
# MPFR
- type: file
url: https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2
dest: external-packages/MPFR
sha256: b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0
# OpenEXR
- type: file
url: https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
dest: external-packages/OpenEXR
sha256: 0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
# Blosc
- type: file
url: https://github.com/Blosc/c-blosc/archive/8724c06e3da90f10986a253814af18ca081d8de0.zip
dest: external-packages/Blosc
sha256: 53986fd04210b3d94124b7967c857f9766353e576a69595a9393999e0712c035
# Catch2
- type: file
url: https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.10.zip
dest: external-packages/Catch2
sha256: 121e7488912c2ce887bfe4699ebfb983d0f2e0d68bcd60434cdfd6bb0cf78b43
# CGAL
- type: file
url: https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
dest: external-packages/CGAL
sha256: d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
# GMP
- type: file
url: https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2
dest: external-packages/GMP
sha256: eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
# TBB
- type: file
url: https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip
dest: external-packages/TBB
sha256: 83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
# GLEW
- type: file
url: https://sourceforge.net/projects/glew/files/glew/2.2.0/glew-2.2.0.zip
dest: external-packages/GLEW
sha256: a9046a913774395a095edcc0b0ac2d81c3aacca61787b39839b941e9be14e0d4
# wxWidgets
- type: file
url: https://github.com/prusa3d/wxWidgets/archive/323a465e577e03f330e2e6a4c78e564d125340cb.zip
dest: external-packages/wxWidgets
sha256: b538e4ad3cc93117932f4ded70c476d6650f9c70a9d4055a08f3693864c47465
# OpenCSG
- type: file
url: https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip
dest: external-packages/OpenCSG
sha256: 51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5
# NanoSVG
- type: file
url: https://github.com/fltk/nanosvg/archive/abcd277ea45e9098bed752cf9c6875b533c0892f.zip
dest: external-packages/NanoSVG
sha256: e859938fbaee4b351bd8a8b3d3c7a75b40c36885ce00b73faa1ce0b98aa0ad34
# OpenVDB
- type: file
url: https://github.com/prusa3d/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
dest: external-packages/OpenVDB
sha256: f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
# OpenSSL
- type: file
url: https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz
dest: external-packages/OpenSSL
sha256: e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
# CURL
- type: file
url: https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
dest: external-packages/CURL
sha256: a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a
# Qhull
- type: file
url: https://github.com/qhull/qhull/archive/refs/tags/v8.1-alpha3.zip
dest: external-packages/Qhull
sha256: 7bd9b5ffae01e69c2ead52f9a9b688af6c65f9a1da05da0a170fa20d81404c06
# LibBGCode
- type: file
url: https://github.com/prusa3d/libbgcode/archive/d33a277a3ce2c0a7f9ba325caac6d730e0f7a412.zip
dest: external-packages/LibBGCode
sha256: 0db3b0852df8d3ae32a4283884bc4ad6f1dd4d3c748ed679491f70b1e1d1acd5
- type: file # Patched TBB cmake to make build without lto flag
dest: deps/+TBB
path: patches/TBB/GNU.cmake
# Apply TTB patches to fix build failure. More info: https://github.com/prusa3d/PrusaSlicer/issues/8922
- type: patch
path: patches/0001-apply-TBB-patch.patch
# Build fail during generation of OCCT overview documentation, disable it fix problem
- type: patch
path: patches/0001-don-t-build-occt-doc.patch
- name: PrusaSlicer
buildsystem: simple
build-commands:
- |
set -e
mkdir -p build && cd build
/app/cmake/bin/cmake ../ \
-GNinja \
-DCMAKE_INSTALL_PREFIX=/app \
-DCMAKE_INSTALL_LIBDIR=/app/lib \
-DCMAKE_PREFIX_PATH=/app/deps/usr/local \
-DSLIC3R_PCH=OFF \
-DSLIC3R_FHS=ON \
-DSLIC3R_ASAN=OFF \
-DSLIC3R_GTK=3 \
-DSLIC3R_STATIC=ON \
-DSLIC3R_BUILD_TESTS=ON \
-DSLIC3R_DESKTOP_INTEGRATION=OFF \
-DCMAKE_BUILD_TYPE=Release
/app/cmake/bin/cmake --build .
ctest --verbose
/app/cmake/bin/cmake --build . --target install > /dev/null
post-install:
- |
mkdir -p /app/share/runtime/locale
for i in $(ls /app/share/PrusaSlicer/localization)
do
lang=${i%[_@]*}
mkdir -p /app/share/runtime/locale/${lang}
mv /app/share/PrusaSlicer/localization/${i} /app/share/runtime/locale/${lang}
ln -rs /app/share/runtime/locale/${lang}/${i} /app/share/PrusaSlicer/localization/${i}
done
- |
install -Dm644 com.prusa3d.PrusaSlicer.metainfo.xml /app/share/metainfo/com.prusa3d.PrusaSlicer.metainfo.xml
install -Dm644 com.prusa3d.PrusaSlicer.svg /app/share/icons/hicolor/scalable/apps/com.prusa3d.PrusaSlicer.svg
install -Dm644 com.prusa3d.PrusaSlicer.png /app/share/icons/hicolor/256x256/apps/com.prusa3d.PrusaSlicer.png
install -Dm644 com.prusa3d.PrusaSlicer.desktop /app/share/applications/com.prusa3d.PrusaSlicer.desktop
install -Dm644 com.prusa3d.PrusaSlicer.GCodeViewer.svg /app/share/icons/hicolor/scalable/apps/com.prusa3d.PrusaSlicer.GCodeViewer.svg
install -Dm644 com.prusa3d.PrusaSlicer.GCodeViewer.png /app/share/icons/hicolor/256x256/apps/com.prusa3d.PrusaSlicer.GCodeViewer.png
install -Dm644 com.prusa3d.PrusaSlicer.GCodeViewer.desktop /app/share/applications/com.prusa3d.PrusaSlicer.GCodeViewer.desktop
install set-dark-theme-variant.py /app/bin
install entrypoint /app/bin
install umount /app/bin
- |
mkdir -p /app/share/mime/packages/
install -m644 -p -t /app/share/mime/packages com.prusa3d.PrusaSlicer.mime.xml
install -Dm644 com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.svg \
/app/share/icons/hicolor/scalable/mimetypes/com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.svg
install -Dm644 com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.png \
/app/share/icons/hicolor/128x128/mimetypes/com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.png
install -Dm644 com.prusa3d.PrusaSlicer.text-x-gcode.svg \
/app/share/icons/hicolor/scalable/mimetypes/com.prusa3d.PrusaSlicer.text-x-gcode.svg
install -Dm644 com.prusa3d.PrusaSlicer.text-x-gcode.png \
/app/share/icons/hicolor/128x128/mimetypes/com.prusa3d.PrusaSlicer.text-x-gcode.png
update-mime-database /app/share/mime
sources:
- type: git
url: https://github.com/prusa3d/PrusaSlicer
tag: version_2.9.0
- type: patch # Fix download from printables. More info: https://github.com/prusa3d/PrusaSlicer/pull/12785
path: patches/0001-don-t-call-show_downloader_registration_dialog-if-SL.patch
# Pre-Build
- type: shell
commands:
# Set PrusaSlicer version for build and reference Flathub.org for better bug seperation.
- sed -i 's/+UNKNOWN/+flathub.org/g' version.inc
- |
cp src/platform/unix/PrusaSlicer.desktop ./com.prusa3d.PrusaSlicer.desktop
cp src/platform/unix/PrusaGcodeviewer.desktop ./com.prusa3d.PrusaSlicer.GCodeViewer.desktop
- |
sed -i 's/^\(MimeType=.*\)/\1x-scheme-handler\/prusaslicer;/g' com.prusa3d.PrusaSlicer.desktop
- |
sed -i 's/Exec=prusa-slicer %F/Exec=entrypoint --single-instance-on-url %u/g' com.prusa3d.PrusaSlicer.desktop
sed -i 's/Exec=prusa-slicer/Exec=entrypoint/g' com.prusa3d.PrusaSlicer.GCodeViewer.desktop
cat <<EOT >> com.prusa3d.PrusaSlicer.desktop
Actions=GCodeViewer;
[Desktop Action GCodeViewer]
Exec=entrypoint --gcodeviewer %F
Name=G-Code Viewer
Name[de]=G-Code Vorschau
Icon=com.prusa3d.PrusaSlicer.GCodeViewer
EOT
- |
sed -i 's/Icon=PrusaSlicer-gcodeviewer/Icon=com.prusa3d.PrusaSlicer.GCodeViewer/g' com.prusa3d.PrusaSlicer.GCodeViewer.desktop
sed -i 's/Icon=PrusaSlicer-gcodeviewer/Icon=com.prusa3d.PrusaSlicer.GCodeViewer/g' com.prusa3d.PrusaSlicer.desktop
sed -i 's/Icon=PrusaSlicer/Icon=com.prusa3d.PrusaSlicer/g' com.prusa3d.PrusaSlicer.desktop
- type: file
path: com.prusa3d.PrusaSlicer.metainfo.xml
# script to set dark theme variant
- type: file
path: set-dark-theme-variant.py
# start-up script
# README: workaround for the following issues, also enables dark theme variant:
# SEE: https://github.com/flathub/com.prusa3d.PrusaSlicer/issues/27
# SEE: https://github.com/flathub/com.prusa3d.PrusaSlicer/issues/3
# SEE: https://github.com/prusa3d/PrusaSlicer/issues/2365
- type: file
path: entrypoint
# umount wrapper used to redirect umount calls to udisk2
- type: file
path: umount
# TODO: remove mime when PR created and is merged upstream
# Adding MIME type for 3mf
- type: file
path: com.prusa3d.PrusaSlicer.mime.xml
# icon for 3mf mime type
- type: file
path: icons/com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.svg
- type: file
path: icons/com.prusa3d.PrusaSlicer.application-vnd-ms-3mfdocument.png
# icon for gcode mime type
- type: file
path: icons/com.prusa3d.PrusaSlicer.text-x-gcode.svg
- type: file
path: icons/com.prusa3d.PrusaSlicer.text-x-gcode.png
# app icons
# The icon should be SVG, or a PNG with a size greater or equal to 256x256 pixels. It has to be square.
# See: https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/quality-guidelines/#icon-size
- type: file
path: icons/com.prusa3d.PrusaSlicer.svg
- type: file
path: icons/com.prusa3d.PrusaSlicer.png
- type: file
path: icons/com.prusa3d.PrusaSlicer.GCodeViewer.svg
- type: file
path: icons/com.prusa3d.PrusaSlicer.GCodeViewer.png