Hi!
prusa-slicer is currently at versionb 2.7.4 in guix which is
ridiculously outdated.
I'm currently working on upgrading it to the latest version 2.9.2 and
I've already made quite some progress, but it looks like I'm stuck right
before the finish line.
prusa-slicer is using cmake and the upstream devs have a habit of
bundling third partly libraries in their source code. In the current
package definition [0], those libraries are kicked out and replaced with
libraries from guix.
I'm repeating that pattern.
Besides that, I took some patches from Gentoo [1] as well. I looked
through them and kicked out the ones which seemed outdated or no longer
necessary.
Prusa also reverted back to an older version of opencascade-occt due to
the newer version allegedly having a bug which hasn't been fixed yet. I
submitted this separately already [2].
There are some fairly self-explanatory substitutions in my new package
definition, but one thing I can't get working is the linking to `hidapi`.
These are the last few log lines of the build process:
```plaintext
[100%] Building CXX object
tests/slic3rutils/CMakeFiles/slic3rutils_tests.dir/secretstore_tests.cpp.o
cd /tmp/guix-build-prusa-slicer-2.9.2.drv-0/build/tests/slic3rutils &&
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/bin/c++
-DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_LOG_DYN_LINK
-DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB
-DCATCH_CONFIG_FAST_COMPILE -DSLIC3R_GUI -DTBB_USE_CAPTURED_EXCEPTION=0
-DTEST_DATA_DIR="R\"(/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/tests/data)\""
-DUNICODE -DUSE_TBB -DWXINTL_NO_GETTEXT_MACRO -D_UNICODE
-DwxNO_UNSAFE_WXSTRING_CONV -DwxUSE_UNICODE
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/build/src/platform
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/tests
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/src/libslic3r/..
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/build/src/libslic3r
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/semver
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/admesh/.
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/localesutils
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/tcbspan
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/miniz
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/agg/.
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/ankerl
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/src/libseqarrange/include
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/src/slic3r-arrange-wrapper/include
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/src/slic3r-arrange/include
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/avrdude/.
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/imgui/.
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/stb_dxt
-I/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/bundled_deps/fast_float
-isystem
/gnu/store/cnk2cxb1ggcbmrg75fyjagxk6l6y4qhi-eigen-3.4.0/include/eigen3
-isystem
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/include/LibBGCode
-isystem
/gnu/store/65h1lg8dmc8z9c1icmnmjs4sp6zw68i3-ilmbase-2.5.7/include/OpenEXR
-isystem
/gnu/store/7ayhrp115lnsmqh5xcy414bxa85pkj6n-nanosvg-0.0.0-0.9da543e/include/nanosvg
-isystem
/gnu/store/bmiy28325s4qv93s6l3kjxdd9f283fy3-dbus-1.15.8/include/dbus-1.0
-isystem
/gnu/store/bmiy28325s4qv93s6l3kjxdd9f283fy3-dbus-1.15.8/lib/dbus-1.0/include
-isystem
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/include/gio-unix-2.0
-isystem
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/include/glib-2.0
-isystem
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/glib-2.0/include
-isystem
/gnu/store/ggkpff64h669i774wl8ldslasr22rbgl-gtk+-3.24.43/include/gtk-3.0
-isystem
/gnu/store/qj9jhgqn2b9g7yxdhyw6ki1vz241apkd-libpng-1.6.39/include/libpng16
-isystem
/gnu/store/41wzli7i6msbfzllizrgrawgcxgym723-pango-1.54.0/include/pango-1.0
-isystem
/gnu/store/xcgajx3akli9isl0d5cfc8p424bvizcc-webkitgtk-for-gtk3-2.48.1/include/webkitgtk-4.1
-isystem
/gnu/store/2p8j6npwa2k59d8lbhlqzvffn0437x8l-util-linux-2.37.4-lib/include/libmount
-isystem
/gnu/store/2p8j6npwa2k59d8lbhlqzvffn0437x8l-util-linux-2.37.4-lib/include/blkid
-isystem
/gnu/store/bb6c2kxbbfpfpvjpglkl8sib310dbqji-libcloudproviders-minimal-0.3.6/include/cloudproviders
-isystem
/gnu/store/7ah6i5829f5ha6bdfzcj1gf21115xyyd-freetype-2.13.0/include/freetype2
-isystem
/gnu/store/qwi828c782jxp0lq90jzqypi0pk90wkn-fribidi-1.0.12/include/fribidi
-isystem
/gnu/store/gh9cgprk2x0zq7xw44dal0v8s3wixpj3-cairo-1.18.2/include/cairo
-isystem
/gnu/store/64d3lfkly1d9y11zcnm9a90w7n4y373x-at-spi2-core-2.52.0/include/at-spi2-atk/2.0
-isystem
/gnu/store/64d3lfkly1d9y11zcnm9a90w7n4y373x-at-spi2-core-2.52.0/include/at-spi-2.0
-isystem
/gnu/store/64d3lfkly1d9y11zcnm9a90w7n4y373x-at-spi2-core-2.52.0/include/atk-1.0
-isystem
/gnu/store/sw0rl8sfz01j723s03yndrnk14xllfpd-libdrm-2.4.124/include/libdrm
-isystem
/gnu/store/4l66m7h6laqdfzcpdkb2j9a32pb1iidx-harfbuzz-8.3.0/include/harfbuzz
-isystem
/gnu/store/p4gjcpvjyl851dsixm3ps80smbjyj9kq-libsoup-3.6.1/include/libsoup-3.0
-isystem
/gnu/store/bzyx5ac3bm7ha5vynaw5k6r733a1h946-gdk-pixbuf-2.42.12/include/gdk-pixbuf-2.0
-isystem
/gnu/store/zv420d7jscbcwkzndxb9n9dma4xhmf43-pixman-0.42.2/include/pixman-1
-fext-numeric-literals -Wall -Wno-reorder -O2 -g -DNDEBUG -fsigned-char
-Werror=return-type -Wno-ignored-attributes -Wno-unknown-pragmas
-DOPENVDB_ABI_VERSION_NUMBER=11 -pthread -std=gnu++17 -MD -MT
tests/slic3rutils/CMakeFiles/slic3rutils_tests.dir/secretstore_tests.cpp.o
-MF CMakeFiles/slic3rutils_tests.dir/secretstore_tests.cpp.o.d -o
CMakeFiles/slic3rutils_tests.dir/secretstore_tests.cpp.o -c
/tmp/guix-build-prusa-slicer-2.9.2.drv-0/source/tests/slic3rutils/secretstore_tests.cpp
[100%] Linking CXX executable slic3rutils_tests
cd /tmp/guix-build-prusa-slicer-2.9.2.drv-0/build/tests/slic3rutils &&
/gnu/store/8wkkxkgkiqaddpn2al8khxnaaanici26-cmake-minimal-3.24.2/bin/cmake
-E cmake_link_script CMakeFiles/slic3rutils_tests.dir/link.txt --verbose=1
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/bin/c++
-fext-numeric-literals -Wall -Wno-reorder -O2 -g -DNDEBUG -pthread
CMakeFiles/slic3rutils_tests.dir/slic3rutils_tests_main.cpp.o
CMakeFiles/slic3rutils_tests.dir/slic3r_jobs_tests.cpp.o
CMakeFiles/slic3rutils_tests.dir/slic3r_version_tests.cpp.o
CMakeFiles/slic3rutils_tests.dir/slic3r_arrangejob_tests.cpp.o
CMakeFiles/slic3rutils_tests.dir/secretstore_tests.cpp.o -o
slic3rutils_tests ../../src/slic3r/liblibslic3r_gui.a
../../src/libslic3r/liblibslic3r.a
../../src/libseqarrange/liblibseqarrange.a
/gnu/store/0216c3q5air6p46dq9k9s1d3m24nn3n5-catch2-3.8.1/lib/libCatch2Main.so.3.8.1
/gnu/store/0216c3q5air6p46dq9k9s1d3m24nn3n5-catch2-3.8.1/lib/libCatch2.so.3.8.1
../../src/slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a
../../src/slic3r-arrange/libslic3r-arrange.a
../../src/libslic3r/liblibslic3r.a
../../src/libseqarrange/liblibseqarrange.a
../../src/libslic3r/liblibslic3r.a
../../src/libseqarrange/liblibseqarrange.a
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_log.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_filesystem.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_locale.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_thread.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_regex.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_chrono.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_atomic.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_date_time.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_nowide.so.1.83.0
../../src/clipper/libclipper.a
../../bundled_deps/glu-libtess/libglu-libtess.a
/gnu/store/h0vk71isk7x3shzrvd4n29pxr5kp79b8-qhull-2020.2/lib/libqhullcpp.a
/gnu/store/h0vk71isk7x3shzrvd4n29pxr5kp79b8-qhull-2020.2/lib/libqhull_r.so.8.0.2
../../src/libslic3r/liblibslic3r_cgal.a
/gnu/store/kka705681m1hq98b9jz98vxk9s5qd4ld-gmp-6.3.0/lib/libgmpxx.so
/gnu/store/pz4xkjl28w0pqf8nhgv68xix17ap6dsx-mpfr-4.2.1/lib/libmpfr.so
/gnu/store/kka705681m1hq98b9jz98vxk9s5qd4ld-gmp-6.3.0/lib/libgmp.so -ldl
/gnu/store/qj9jhgqn2b9g7yxdhyw6ki1vz241apkd-libpng-1.6.39/lib/libpng.so
/gnu/store/51y585ggga5s38m10i0p47gypcdqm77c-libjpeg-turbo-2.1.4/lib/libjpeg.so
../../bundled_deps/libqoi.a ../../bundled_deps/libsemver.a
../../bundled_deps/admesh/libadmesh.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_convert.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_binarize.a
/gnu/store/z2nidw72w3i9jj6fsycfdwwcqvd2jcdw-heatshrink-0.4.1/lib/libheatshrink_dynalloc.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_core.a
../../bundled_deps/miniz/libminiz_static.a
/gnu/store/mfjx0cv4aj2s2r0nzd07xsr346vj5mkb-openvdb-11.0.0/lib/libopenvdb.so
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_system.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_iostreams.so.1.83.0
/gnu/store/65h1lg8dmc8z9c1icmnmjs4sp6zw68i3-ilmbase-2.5.7/lib/libHalf-2_5.so.25.0.6
/gnu/store/zxfir7az0n8qg8wxjccnajp3cqz6j0lj-z3-4.13.0/lib/libz3.so.4.13.0.0
/gnu/store/zz6inps5b5yfcdmdr39931n147988rg3-tbb-2021.6.0/lib/libtbb.so.12.6
/gnu/store/zz6inps5b5yfcdmdr39931n147988rg3-tbb-2021.6.0/lib/libtbbmalloc.so.2.6
/gnu/store/c4rzb1f905ljp5af4z8f5f2rkc3khihr-nlopt-2.7.1/lib/libnlopt.so
../../bundled_deps/avrdude/libavrdude.a
../../bundled_deps/liblocalesutils.a ../../bundled_deps/imgui/libimgui.a
../../src/libvgcode/liblibvgcode.a
/gnu/store/djarc5py303kgnn130x2i15j8zjiabd2-glew-2.2.0/lib/libGLEW.so
/gnu/store/a4x6jq2c8vh6n58x7r18j31n32v1rkxf-mesa-24.3.2/lib/libGL.so
-lhidapi
/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib/libz.so
/gnu/store/cjvaagi44q7r0nhx49r91kmi96xs6qfh-curl-8.6.0/lib/libcurl.so
-L/gnu/store/d58f4rbj527mmnjbhj419sjh77dvxm9c-prusa-wxwidgets-3.2.0-0.78aa2dc/lib
-pthread -L/gnu/store/a4x6jq2c8vh6n58x7r18j31n32v1rkxf-mesa-24.3.2/lib
-lwx_baseu-3.2 -lwx_gtk3u_core-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_gl-3.2
-lwx_gtk3u_webview-3.2
/gnu/store/qj9jhgqn2b9g7yxdhyw6ki1vz241apkd-libpng-1.6.39/lib/libpng.so
/gnu/store/51y585ggga5s38m10i0p47gypcdqm77c-libjpeg-turbo-2.1.4/lib/libjpeg.so
/gnu/store/8bs3gia5rknqsw840rrwm2na4200ybc5-expat-2.5.0/lib/libexpat.so.1.8.10
-lm /gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/librt.a
/gnu/store/7ayhrp115lnsmqh5xcy414bxa85pkj6n-nanosvg-0.0.0-0.9da543e/lib/libnanosvgrast.so
/gnu/store/7ayhrp115lnsmqh5xcy414bxa85pkj6n-nanosvg-0.0.0-0.9da543e/lib/libnanosvg.so
-lm
/gnu/store/bmiy28325s4qv93s6l3kjxdd9f283fy3-dbus-1.15.8/lib/libdbus-1.so
/gnu/store/xc98v8v485rs704wb26mipb0y5npdl1z-openssl-3.0.8/lib/libssl.so
/gnu/store/xc98v8v485rs704wb26mipb0y5npdl1z-openssl-3.0.8/lib/libcrypto.so
-lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0
-lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0
-lglib-2.0 -lfontconfig
/gnu/store/xcgajx3akli9isl0d5cfc8p424bvizcc-webkitgtk-for-gtk3-2.48.1/lib/libwebkit2gtk-4.1.so
/gnu/store/ggkpff64h669i774wl8ldslasr22rbgl-gtk+-3.24.43/lib/libgtk-3.so
/gnu/store/ggkpff64h669i774wl8ldslasr22rbgl-gtk+-3.24.43/lib/libgdk-3.so
/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib/libz.so
/gnu/store/41wzli7i6msbfzllizrgrawgcxgym723-pango-1.54.0/lib/libpangocairo-1.0.so
/gnu/store/41wzli7i6msbfzllizrgrawgcxgym723-pango-1.54.0/lib/libpango-1.0.so
/gnu/store/4l66m7h6laqdfzcpdkb2j9a32pb1iidx-harfbuzz-8.3.0/lib/libharfbuzz.so
/gnu/store/64d3lfkly1d9y11zcnm9a90w7n4y373x-at-spi2-core-2.52.0/lib/libatk-1.0.so
/gnu/store/gh9cgprk2x0zq7xw44dal0v8s3wixpj3-cairo-1.18.2/lib/libcairo-gobject.so
/gnu/store/gh9cgprk2x0zq7xw44dal0v8s3wixpj3-cairo-1.18.2/lib/libcairo.so
/gnu/store/bzyx5ac3bm7ha5vynaw5k6r733a1h946-gdk-pixbuf-2.42.12/lib/libgdk_pixbuf-2.0.so
/gnu/store/p4gjcpvjyl851dsixm3ps80smbjyj9kq-libsoup-3.6.1/lib/libsoup-3.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgmodule-2.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgio-2.0.so
/gnu/store/xcgajx3akli9isl0d5cfc8p424bvizcc-webkitgtk-for-gtk3-2.48.1/lib/libjavascriptcoregtk-4.1.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgobject-2.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libglib-2.0.so
ld: cannot find -lhidapi: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: ***
[tests/slic3rutils/CMakeFiles/slic3rutils_tests.dir/build.make:245:
tests/slic3rutils/slic3rutils_tests] Error 1
make[2]: Leaving directory '/tmp/guix-build-prusa-slicer-2.9.2.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:1790:
tests/slic3rutils/CMakeFiles/slic3rutils_tests.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable prusa-slicer
cd /tmp/guix-build-prusa-slicer-2.9.2.drv-0/build/src &&
/gnu/store/8wkkxkgkiqaddpn2al8khxnaaanici26-cmake-minimal-3.24.2/bin/cmake
-E cmake_link_script CMakeFiles/PrusaSlicer.dir/link.txt --verbose=1
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/bin/c++
-fext-numeric-literals -Wall -Wno-reorder -pthread -O2 -g -DNDEBUG
-pthread CMakeFiles/PrusaSlicer.dir/PrusaSlicer.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/PrintHelp.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/Setup.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/LoadPrintData.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/ProcessTransform.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/ProcessActions.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/Run.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/ProfilesSharingUtils.cpp.o
CMakeFiles/PrusaSlicer.dir/CLI/GuiParams.cpp.o -o prusa-slicer
-Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
libslic3r/liblibslic3r.a
slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a
libseqarrange/liblibseqarrange.a -ldl -lstdc++ slic3r/liblibslic3r_gui.a
-ldl slic3r-arrange-wrapper/libslic3r-arrange-wrapper.a
slic3r-arrange/libslic3r-arrange.a libslic3r/liblibslic3r.a
libseqarrange/liblibseqarrange.a libslic3r/liblibslic3r.a
libseqarrange/liblibseqarrange.a -ldl
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_log.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_filesystem.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_locale.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_thread.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_regex.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_chrono.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_atomic.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_date_time.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_nowide.so.1.83.0
clipper/libclipper.a ../bundled_deps/glu-libtess/libglu-libtess.a
/gnu/store/h0vk71isk7x3shzrvd4n29pxr5kp79b8-qhull-2020.2/lib/libqhullcpp.a
/gnu/store/h0vk71isk7x3shzrvd4n29pxr5kp79b8-qhull-2020.2/lib/libqhull_r.so.8.0.2
libslic3r/liblibslic3r_cgal.a
/gnu/store/kka705681m1hq98b9jz98vxk9s5qd4ld-gmp-6.3.0/lib/libgmpxx.so
/gnu/store/pz4xkjl28w0pqf8nhgv68xix17ap6dsx-mpfr-4.2.1/lib/libmpfr.so
/gnu/store/kka705681m1hq98b9jz98vxk9s5qd4ld-gmp-6.3.0/lib/libgmp.so
/gnu/store/qj9jhgqn2b9g7yxdhyw6ki1vz241apkd-libpng-1.6.39/lib/libpng.so
/gnu/store/51y585ggga5s38m10i0p47gypcdqm77c-libjpeg-turbo-2.1.4/lib/libjpeg.so
../bundled_deps/libqoi.a ../bundled_deps/libsemver.a
../bundled_deps/admesh/libadmesh.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_convert.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_binarize.a
/gnu/store/z2nidw72w3i9jj6fsycfdwwcqvd2jcdw-heatshrink-0.4.1/lib/libheatshrink_dynalloc.a
/gnu/store/86adfinrfwfg3760isl2v1l8vhn5i3fr-prusa-libbgcode-0.0.0-1.5041c09/lib/libbgcode_core.a
../bundled_deps/miniz/libminiz_static.a
/gnu/store/mfjx0cv4aj2s2r0nzd07xsr346vj5mkb-openvdb-11.0.0/lib/libopenvdb.so
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_system.so.1.83.0
/gnu/store/di4520fl1q7lkxahblsvpd2079zhx0q4-boost-1.83.0/lib/libboost_iostreams.so.1.83.0
/gnu/store/65h1lg8dmc8z9c1icmnmjs4sp6zw68i3-ilmbase-2.5.7/lib/libHalf-2_5.so.25.0.6
/gnu/store/zxfir7az0n8qg8wxjccnajp3cqz6j0lj-z3-4.13.0/lib/libz3.so.4.13.0.0
/gnu/store/zz6inps5b5yfcdmdr39931n147988rg3-tbb-2021.6.0/lib/libtbb.so.12.6
/gnu/store/zz6inps5b5yfcdmdr39931n147988rg3-tbb-2021.6.0/lib/libtbbmalloc.so.2.6
/gnu/store/c4rzb1f905ljp5af4z8f5f2rkc3khihr-nlopt-2.7.1/lib/libnlopt.so
/gnu/store/8bs3gia5rknqsw840rrwm2na4200ybc5-expat-2.5.0/lib/libexpat.so.1.8.10
-lm ../bundled_deps/avrdude/libavrdude.a
../bundled_deps/liblocalesutils.a ../bundled_deps/imgui/libimgui.a
libvgcode/liblibvgcode.a
/gnu/store/djarc5py303kgnn130x2i15j8zjiabd2-glew-2.2.0/lib/libGLEW.so
/gnu/store/a4x6jq2c8vh6n58x7r18j31n32v1rkxf-mesa-24.3.2/lib/libGL.so
-lhidapi
/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib/libz.so
/gnu/store/cjvaagi44q7r0nhx49r91kmi96xs6qfh-curl-8.6.0/lib/libcurl.so
-L/gnu/store/d58f4rbj527mmnjbhj419sjh77dvxm9c-prusa-wxwidgets-3.2.0-0.78aa2dc/lib
-pthread -L/gnu/store/a4x6jq2c8vh6n58x7r18j31n32v1rkxf-mesa-24.3.2/lib
-lwx_baseu-3.2 -lwx_gtk3u_core-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_gl-3.2
-lwx_gtk3u_webview-3.2
/gnu/store/qj9jhgqn2b9g7yxdhyw6ki1vz241apkd-libpng-1.6.39/lib/libpng.so
/gnu/store/51y585ggga5s38m10i0p47gypcdqm77c-libjpeg-turbo-2.1.4/lib/libjpeg.so
/gnu/store/zvlp3n8iwa1svxmwv4q22pv1pb1c9pjq-glibc-2.39/lib/librt.a
/gnu/store/7ayhrp115lnsmqh5xcy414bxa85pkj6n-nanosvg-0.0.0-0.9da543e/lib/libnanosvgrast.so
/gnu/store/7ayhrp115lnsmqh5xcy414bxa85pkj6n-nanosvg-0.0.0-0.9da543e/lib/libnanosvg.so
-lm
/gnu/store/bmiy28325s4qv93s6l3kjxdd9f283fy3-dbus-1.15.8/lib/libdbus-1.so
/gnu/store/xc98v8v485rs704wb26mipb0y5npdl1z-openssl-3.0.8/lib/libssl.so
/gnu/store/xc98v8v485rs704wb26mipb0y5npdl1z-openssl-3.0.8/lib/libcrypto.so
-lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0
-lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0
-lglib-2.0 -lfontconfig
/gnu/store/xcgajx3akli9isl0d5cfc8p424bvizcc-webkitgtk-for-gtk3-2.48.1/lib/libwebkit2gtk-4.1.so
/gnu/store/ggkpff64h669i774wl8ldslasr22rbgl-gtk+-3.24.43/lib/libgtk-3.so
/gnu/store/ggkpff64h669i774wl8ldslasr22rbgl-gtk+-3.24.43/lib/libgdk-3.so
/gnu/store/1prv14v6jfnzzg7szm57690b7fr6sx33-zlib-1.3/lib/libz.so
/gnu/store/41wzli7i6msbfzllizrgrawgcxgym723-pango-1.54.0/lib/libpangocairo-1.0.so
/gnu/store/41wzli7i6msbfzllizrgrawgcxgym723-pango-1.54.0/lib/libpango-1.0.so
/gnu/store/4l66m7h6laqdfzcpdkb2j9a32pb1iidx-harfbuzz-8.3.0/lib/libharfbuzz.so
/gnu/store/64d3lfkly1d9y11zcnm9a90w7n4y373x-at-spi2-core-2.52.0/lib/libatk-1.0.so
/gnu/store/gh9cgprk2x0zq7xw44dal0v8s3wixpj3-cairo-1.18.2/lib/libcairo-gobject.so
/gnu/store/gh9cgprk2x0zq7xw44dal0v8s3wixpj3-cairo-1.18.2/lib/libcairo.so
/gnu/store/bzyx5ac3bm7ha5vynaw5k6r733a1h946-gdk-pixbuf-2.42.12/lib/libgdk_pixbuf-2.0.so
/gnu/store/p4gjcpvjyl851dsixm3ps80smbjyj9kq-libsoup-3.6.1/lib/libsoup-3.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgmodule-2.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgio-2.0.so
/gnu/store/xcgajx3akli9isl0d5cfc8p424bvizcc-webkitgtk-for-gtk3-2.48.1/lib/libjavascriptcoregtk-4.1.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libgobject-2.0.so
/gnu/store/5csw0jn2lfkzavkq1fjjl7s7bdgmzjjk-glib-2.82.1/lib/libglib-2.0.so
ld: cannot find -lhidapi: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/PrusaSlicer.dir/build.make:308:
src/prusa-slicer] Error 1
make[2]: Leaving directory '/tmp/guix-build-prusa-slicer-2.9.2.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:1147:
src/CMakeFiles/PrusaSlicer.dir/all] Error 2
make[1]: Leaving directory '/tmp/guix-build-prusa-slicer-2.9.2.drv-0/build'
make: *** [Makefile:149: all] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "5")
exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 3407.6 seconds
command "make" "-j" "5" failed with status 2
build process 14 exited with status 256
note: keeping build directory `/tmp/guix-build-prusa-slicer-2.9.2.drv-6'
builder for
`/gnu/store/8yd5683sa2a97qmsbvswslkrrivfqk0n-prusa-slicer-2.9.2.drv'
failed with exit code 1
build of
/gnu/store/8yd5683sa2a97qmsbvswslkrrivfqk0n-prusa-slicer-2.9.2.drv failed
Could not find build log for
'/gnu/store/8yd5683sa2a97qmsbvswslkrrivfqk0n-prusa-slicer-2.9.2.drv'.
guix build: error: build of
`/gnu/store/8yd5683sa2a97qmsbvswslkrrivfqk0n-prusa-slicer-2.9.2.drv' failed
```
The hidapi documentation talks about automake being deprecated and CMake
being the new preferred build-system. But as hidapi currently has a lot
of dependencies, for now I opted to not touching it and adding
hidapi-cmake as a separate package. With prusaslicer using CMake itself,
I figured it would be easier to succeed (I'm not all too familiar with
CMake to be honest). So if anyone has any opinion about that, this would
be helpful.
I've created some preliminary patches so I can attach it to that email.
Once everything is done, I will do some cleanup and properly submit them.
So if anyone can share an idea about how to get this working, it would
be greatly appreciated.
Let me know please, if I can provide any additional information.
Thanks a lot!
nomike
[0]
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/engineering.scm#n4403
[1] https://packages.gentoo.org/packages/media-gfx/prusaslicer
[2] https://issues.guix.gnu.org/77881
From d153ad376dc783a8047bde92152d2471d348278f Mon Sep 17 00:00:00 2001
From: nomike <nom...@nomike.com>
Date: Tue, 22 Apr 2025 21:03:51 +0200
Subject: [PATCH 1/5] Add Patches for prusa-slicer@2.9.2.
Change-Id: I491dffbed689cb72701c813a825f7c5fc9e5d401
---
...0-dont-force-link-to-wayland-and-x11.patch | 12 ++
.../patches/prusaslicer-2.8.1-cgal-6.0.patch | 191 ++++++++++++++++++
...cer-2.8.1-fix-libsoup-double-linking.patch | 11 +
.../patches/prusaslicer-2.8.1-fstream.patch | 42 ++++
4 files changed, 256 insertions(+)
create mode 100644 gnu/packages/patches/prusaslicer-2.6.0-dont-force-link-to-wayland-and-x11.patch
create mode 100644 gnu/packages/patches/prusaslicer-2.8.1-cgal-6.0.patch
create mode 100644 gnu/packages/patches/prusaslicer-2.8.1-fix-libsoup-double-linking.patch
create mode 100644 gnu/packages/patches/prusaslicer-2.8.1-fstream.patch
diff --git a/gnu/packages/patches/prusaslicer-2.6.0-dont-force-link-to-wayland-and-x11.patch b/gnu/packages/patches/prusaslicer-2.6.0-dont-force-link-to-wayland-and-x11.patch
new file mode 100644
index 0000000000..1d36fcbb7b
--- /dev/null
+++ b/gnu/packages/patches/prusaslicer-2.6.0-dont-force-link-to-wayland-and-x11.patch
@@ -0,0 +1,12 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -115,9 +115,6 @@ if (SLIC3R_GUI)
+ # libslic3r_gui will link to opengl anyway, so lets override wx
+ list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX OpenGL)
+
+- if (UNIX AND NOT APPLE)
+- list(APPEND wxWidgets_LIBRARIES X11 wayland-client wayland-egl EGL)
+- endif ()
+ # list(REMOVE_ITEM wxWidgets_LIBRARIES oleacc)
+ message(STATUS "wx libs: ${wxWidgets_LIBRARIES}")
+
diff --git a/gnu/packages/patches/prusaslicer-2.8.1-cgal-6.0.patch b/gnu/packages/patches/prusaslicer-2.8.1-cgal-6.0.patch
new file mode 100644
index 0000000000..3aac479197
--- /dev/null
+++ b/gnu/packages/patches/prusaslicer-2.8.1-cgal-6.0.patch
@@ -0,0 +1,191 @@
+From a9283c62cec2b802aa2133c92b7ff5bf320c0bb6 Mon Sep 17 00:00:00 2001
+From: Laurent Rineau <laurent.rin...@cgal.org>
+Date: Sat, 13 Jul 2024 01:19:21 +0200
+Subject: [PATCH] compatibility with CGAL-6.0 (and 5.6.x)
+
+updated for 2.8.1
+
+--- a/src/libslic3r/CutSurface.cpp
++++ b/src/libslic3r/CutSurface.cpp
+@@ -4,6 +4,14 @@
+ ///|/
+ #include "CutSurface.hpp"
+
++template <typename T>
++auto access_pmap(std::optional<T> opt) -> T {
++ return opt.value();
++}
++
++template <typename Pair>
++auto access_pmap(Pair pair) { return pair.first; }
++
+ /// models_input.obj - Check transormation of model to each others
+ /// projection_center.obj - circle representing center of projection with correct distance
+ /// {M} .. model index
+@@ -31,6 +39,7 @@ using namespace Slic3r;
+ #include <CGAL/Exact_integer.h>
+ #include <CGAL/Surface_mesh.h>
+ #include <CGAL/Cartesian_converter.h>
++#include <CGAL/AABB_traits.h>
+ #include <oneapi/tbb/blocked_range.h>
+ #include <oneapi/tbb/parallel_for.h>
+ #include <boost/property_map/property_map.hpp>
+@@ -1021,8 +1030,8 @@ priv::CutMesh priv::to_cgal(const ExPolygons &shapes,
+ if (shapes.empty()) return {};
+
+ CutMesh result;
+- EdgeShapeMap edge_shape_map = result.add_property_map<EI, IntersectingElement>(edge_shape_map_name).first;
+- FaceShapeMap face_shape_map = result.add_property_map<FI, IntersectingElement>(face_shape_map_name).first;
++ EdgeShapeMap edge_shape_map = access_pmap((result.add_property_map<EI, IntersectingElement>(edge_shape_map_name)));
++ FaceShapeMap face_shape_map = access_pmap((result.add_property_map<FI, IntersectingElement>(face_shape_map_name)));
+
+ std::vector<VI> indices;
+ auto insert_contour = [&projection, &indices, &result,
+@@ -1432,17 +1441,17 @@ priv::CutAOIs priv::cut_from_model(CutMesh &cgal_model,
+ const ExPolygonsIndices &s2i)
+ {
+ // pointer to edge or face shape_map
+- VertexShapeMap vert_shape_map = cgal_model.add_property_map<VI, const IntersectingElement*>(vert_shape_map_name, nullptr).first;
++ VertexShapeMap vert_shape_map = access_pmap((cgal_model.add_property_map<VI, const IntersectingElement*>(vert_shape_map_name, nullptr)));
+
+ // detect anomalities in visitor.
+ bool is_valid = true;
+ // NOTE: map are created when convert shapes to cgal model
+- const EdgeShapeMap& edge_shape_map = cgal_shape.property_map<EI, IntersectingElement>(edge_shape_map_name).first;
+- const FaceShapeMap& face_shape_map = cgal_shape.property_map<FI, IntersectingElement>(face_shape_map_name).first;
++ const EdgeShapeMap& edge_shape_map = access_pmap((cgal_shape.property_map<EI, IntersectingElement>(edge_shape_map_name)));
++ const FaceShapeMap& face_shape_map = access_pmap((cgal_shape.property_map<FI, IntersectingElement>(face_shape_map_name)));
+ Visitor visitor{cgal_model, cgal_shape, edge_shape_map, face_shape_map, vert_shape_map, &is_valid};
+
+ // a property map containing the constrained-or-not status of each edge
+- EdgeBoolMap ecm = cgal_model.add_property_map<EI, bool>(is_constrained_edge_name, false).first;
++ EdgeBoolMap ecm = access_pmap((cgal_model.add_property_map<EI, bool>(is_constrained_edge_name, false)));
+ const auto &p = CGAL::parameters::visitor(visitor)
+ .edge_is_constrained_map(ecm)
+ .throw_on_self_intersection(false);
+@@ -1451,7 +1460,7 @@ priv::CutAOIs priv::cut_from_model(CutMesh &cgal_model,
+
+ if (!is_valid) return {};
+
+- FaceTypeMap face_type_map = cgal_model.add_property_map<FI, FaceType>(face_type_map_name, FaceType::not_constrained).first;
++ FaceTypeMap face_type_map = access_pmap((cgal_model.add_property_map<FI, FaceType>(face_type_map_name, FaceType::not_constrained)));
+
+ // Select inside and outside face in model
+ set_face_type(face_type_map, cgal_model, vert_shape_map, ecm, cgal_shape, s2i);
+@@ -1587,8 +1596,8 @@ void priv::collect_surface_data(std::queue<FI> &process,
+
+ void priv::create_reduce_map(ReductionMap &reduction_map, const CutMesh &mesh)
+ {
+- const VertexShapeMap &vert_shape_map = mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name).first;
+- const EdgeBoolMap &ecm = mesh.property_map<EI, bool>(is_constrained_edge_name).first;
++ const VertexShapeMap &vert_shape_map = access_pmap((mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name)));
++ const EdgeBoolMap &ecm = access_pmap((mesh.property_map<EI, bool>(is_constrained_edge_name)));
+
+ // check if vertex was made by edge_2 which is diagonal of quad
+ auto is_reducible_vertex = [&vert_shape_map](VI reduction_from) -> bool {
+@@ -1773,10 +1782,10 @@ priv::VDistances priv::calc_distances(const SurfacePatches &patches,
+ for (const SurfacePatch &patch : patches) {
+ // map is created during intersection by corefine visitor
+ const VertexShapeMap &vert_shape_map =
+- models[patch.model_id].property_map<VI, const IntersectingElement *>(vert_shape_map_name).first;
++ access_pmap((models[patch.model_id].property_map<VI, const IntersectingElement *>(vert_shape_map_name)));
+ uint32_t patch_index = &patch - &patches.front();
+ // map is created during patch creation / dividing
+- const CvtVI2VI& cvt = patch.mesh.property_map<VI, VI>(patch_source_name).first;
++ const CvtVI2VI& cvt = access_pmap((patch.mesh.property_map<VI, VI>(patch_source_name)));
+ // for each point on outline
+ for (const Loop &loop : patch.loops)
+ for (const VI &vi_patch : loop) {
+@@ -2666,7 +2675,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector<FI> &fis,
+ /* const */ CutMesh &mesh,
+ const ReductionMap *rmap)
+ {
+- auto is_counted = mesh.add_property_map<VI, bool>("v:is_counted").first;
++ auto is_counted = access_pmap((mesh.add_property_map<VI, bool>("v:is_counted")));
+ uint32_t count_vertices = 0;
+ if (rmap == nullptr) {
+ for (FI fi : fis)
+@@ -2696,7 +2705,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector<FI> &fis,
+ cm.reserve(count_vertices, count_edges, count_faces);
+
+ // vertex conversion function from mesh VI to result VI
+- CvtVI2VI mesh2result = mesh.add_property_map<VI,VI>("v:mesh2result").first;
++ CvtVI2VI mesh2result = access_pmap((mesh.add_property_map<VI,VI>("v:mesh2result")));
+
+ if (rmap == nullptr) {
+ for (FI fi : fis) {
+@@ -2748,7 +2757,7 @@ priv::SurfacePatch priv::create_surface_patch(const std::vector<FI> &fis,
+ assert(count_edges >= cm.edges().size());
+
+ // convert VI from this patch to source VI, when exist
+- CvtVI2VI cvt = cm.add_property_map<VI, VI>(patch_source_name).first;
++ CvtVI2VI cvt = access_pmap((cm.add_property_map<VI, VI>(patch_source_name)));
+ // vi_s .. VertexIndex into mesh (source)
+ // vi_d .. new VertexIndex in cm (destination)
+ for (VI vi_s : mesh.vertices()) {
+@@ -2939,7 +2948,7 @@ bool priv::is_patch_inside_of_model(const SurfacePatch &patch,
+ uint32_t priv::get_shape_point_index(const CutAOI &cut, const CutMesh &model)
+ {
+ // map is created during intersection by corefine visitor
+- const VertexShapeMap &vert_shape_map = model.property_map<VI, const IntersectingElement *>(vert_shape_map_name).first;
++ const VertexShapeMap &vert_shape_map = access_pmap((model.property_map<VI, const IntersectingElement *>(vert_shape_map_name)));
+ // for each half edge of outline
+ for (HI hi : cut.second) {
+ VI vi = model.source(hi);
+@@ -2964,7 +2973,7 @@ priv::SurfacePatch priv::separate_patch(const std::vector<FI>& fis,
+ patch_new.model_id = patch.model_id;
+ patch_new.shape_id = patch.shape_id;
+ // fix cvt
+- CvtVI2VI cvt = patch_new.mesh.property_map<VI, VI>(patch_source_name).first;
++ CvtVI2VI cvt = access_pmap((patch_new.mesh.property_map<VI, VI>(patch_source_name)));
+ for (VI &vi : cvt) {
+ if (!vi.is_valid()) continue;
+ vi = cvt_from[vi];
+@@ -2982,9 +2991,9 @@ void priv::divide_patch(size_t i, SurfacePatchesEx &patches)
+ CutMesh& cm = patch.mesh;
+ assert(!cm.faces().empty());
+ std::string patch_number_name = "f:patch_number";
+- CutMesh::Property_map<FI,bool> is_processed = cm.add_property_map<FI, bool>(patch_number_name, false).first;
++ CutMesh::Property_map<FI,bool> is_processed = access_pmap((cm.add_property_map<FI, bool>(patch_number_name, false)));
+
+- const CvtVI2VI& cvt_from = patch.mesh.property_map<VI, VI>(patch_source_name).first;
++ const CvtVI2VI& cvt_from = access_pmap((patch.mesh.property_map<VI, VI>(patch_source_name)));
+
+ std::vector<FI> fis;
+ fis.reserve(cm.faces().size());
+@@ -3085,7 +3094,7 @@ priv::SurfacePatches priv::diff_models(VCutAOIs &cuts,
+ CutAOIs &model_cuts = cuts[model_index];
+ CutMesh &cut_model_ = cut_models[model_index];
+ const CutMesh &cut_model = cut_model_;
+- ReductionMap vertex_reduction_map = cut_model_.add_property_map<VI, VI>(vertex_reduction_map_name).first;
++ ReductionMap vertex_reduction_map = access_pmap((cut_model_.add_property_map<VI, VI>(vertex_reduction_map_name)));
+ create_reduce_map(vertex_reduction_map, cut_model);
+
+ for (size_t cut_index = 0; cut_index < model_cuts.size(); ++cut_index, ++index) {
+@@ -3171,7 +3180,7 @@ bool priv::is_over_whole_expoly(const CutAOI &cutAOI,
+ const CutMesh &mesh)
+ {
+ // NonInterupted contour is without other point and contain all from shape
+- const VertexShapeMap &vert_shape_map = mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name).first;
++ const VertexShapeMap &vert_shape_map = access_pmap((mesh.property_map<VI, const IntersectingElement*>(vert_shape_map_name)));
+ for (HI hi : cutAOI.second) {
+ const IntersectingElement *ie_s = vert_shape_map[mesh.source(hi)];
+ const IntersectingElement *ie_t = vert_shape_map[mesh.target(hi)];
+@@ -3708,7 +3717,7 @@ void priv::store(const CutMesh &mesh, const FaceTypeMap &face_type_map, const st
+ }
+
+ CutMesh &mesh_ = const_cast<CutMesh &>(mesh);
+- auto face_colors = mesh_.add_property_map<priv::FI, CGAL::Color>("f:color").first;
++ auto face_colors = access_pmap((mesh_.add_property_map<priv::FI, CGAL::Color>("f:color")));
+ for (FI fi : mesh.faces()) {
+ auto &color = face_colors[fi];
+ switch (face_type_map[fi]) {
+@@ -3734,7 +3743,7 @@ void priv::store(const CutMesh &mesh, const ReductionMap &reduction_map, const s
+ std::string off_file = dir + "model" + std::to_string(reduction_order++) + ".off";
+
+ CutMesh &mesh_ = const_cast<CutMesh &>(mesh);
+- auto vertex_colors = mesh_.add_property_map<priv::VI, CGAL::Color>("v:color").first;
++ auto vertex_colors = access_pmap((mesh_.add_property_map<priv::VI, CGAL::Color>("v:color")));
+ // initialize to gray color
+ for (VI vi: mesh.vertices())
+ vertex_colors[vi] = CGAL::Color{127, 127, 127};
diff --git a/gnu/packages/patches/prusaslicer-2.8.1-fix-libsoup-double-linking.patch b/gnu/packages/patches/prusaslicer-2.8.1-fix-libsoup-double-linking.patch
new file mode 100644
index 0000000000..dbb0aa3672
--- /dev/null
+++ b/gnu/packages/patches/prusaslicer-2.8.1-fix-libsoup-double-linking.patch
@@ -0,0 +1,11 @@
+--- a/src/slic3r/CMakeLists.txt
++++ b/src/slic3r/CMakeLists.txt
+@@ -465,7 +465,7 @@ if (UNIX AND NOT APPLE)
+ find_package(GTK${SLIC3R_GTK} REQUIRED)
+ find_package(PkgConfig REQUIRED)
+
+- pkg_search_module(WEBKIT2GTK REQUIRED IMPORTED_TARGET webkit2gtk-4.0 webkit2gtk-4.1)
++ pkg_search_module(WEBKIT2GTK REQUIRED IMPORTED_TARGET webkit2gtk-4.1)
+ target_link_libraries(libslic3r_gui PUBLIC ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig PkgConfig::WEBKIT2GTK)
+ endif ()
+
diff --git a/gnu/packages/patches/prusaslicer-2.8.1-fstream.patch b/gnu/packages/patches/prusaslicer-2.8.1-fstream.patch
new file mode 100644
index 0000000000..f550c53d3f
--- /dev/null
+++ b/gnu/packages/patches/prusaslicer-2.8.1-fstream.patch
@@ -0,0 +1,42 @@
+--- a/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp
++++ b/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp
+@@ -1595,7 +1595,7 @@ void GLGizmoSVG::draw_filename(){
+ if (dlg.ShowModal() == wxID_OK ){
+ last_used_directory = dlg.GetDirectory();
+ std::string out_path_str(into_u8(dlg.GetPath()));
+- boost::nowide::ofstream stream(out_path_str);
++ std::ofstream stream(out_path_str);
+ if (stream.is_open()){
+ stream << *svg.file_data;
+
+--- a/src/slic3r/GUI/PresetArchiveDatabase.cpp
++++ b/src/slic3r/GUI/PresetArchiveDatabase.cpp
+@@ -515,7 +515,7 @@ void PresetArchiveDatabase::load_app_manifest_json()
+ if (!fs::exists(path, ec) || ec) {
+ copy_initial_manifest();
+ }
+- boost::nowide::ifstream file(path.string());
++ std::ifstream file(path.string());
+ std::string data;
+ if (file.is_open()) {
+ std::string line;
+@@ -682,7 +682,7 @@ void PresetArchiveDatabase::save_app_manifest_json() const
+ data += "]";
+
+ std::string path = get_stored_manifest_path().string();
+- boost::nowide::ofstream file(path);
++ std::ofstream file(path);
+ if (file.is_open()) {
+ file << data;
+ file.close();
+--- a/src/slic3r/Utils/Http.cpp
++++ b/src/slic3r/Utils/Http.cpp
+@@ -302,7 +302,7 @@ void Http::priv::form_add_file(const char *name, const fs::path &path, const cha
+ //FIXME may throw! Is the caller aware of it?
+ void Http::priv::set_post_body(const fs::path &path)
+ {
+- boost::nowide::ifstream file(path.string());
++ std::ifstream file(path.string());
+ std::string file_content { std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>() };
+ postfields = std::move(file_content);
+ }
--
2.49.0
From 28fd05d0c90271cc394a5e799ac40bc81a84f8bc Mon Sep 17 00:00:00 2001
From: nomike <nom...@nomike.com>
Date: Tue, 22 Apr 2025 21:05:53 +0200
Subject: [PATCH 2/5] gnu: Add catch2@3.8.1
* gnu/packages/check.scm (catch2-3.8): New variable
Change-Id: I41d284ca03134dd0ea2b9abe88f926abf228c0f1
---
gnu/packages/check.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 5238fe4e31..b6c25b4711 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -735,6 +735,33 @@ (define-public catch2-3
a multi-paradigm automated test framework for C++ and Objective-C.")
(license license:boost1.0)))
+(define-public catch2-3.8
+ (package
+ (name "catch2")
+ (version "3.8.1")
+ (home-page "https://github.com/catchorg/Catch2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/catchorg/Catch2")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0v1k14n02aiw4rv5sxhc5612cjhkdj59cjpm50qfxhapsdv54n3f"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:configure-flags
+ #~(list "-DCATCH_DEVELOPMENT_BUILD=ON" "-DCATCH_ENABLE_WERROR=OFF"
+ "-DBUILD_SHARED_LIBS=ON")))
+ (inputs (list python-wrapper))
+ (synopsis "Automated test framework for C++ and Objective-C")
+ (description
+ "Catch2 stands for C++ Automated Test Cases in Headers and is
+a multi-paradigm automated test framework for C++ and Objective-C.")
+ (license license:boost1.0)))
+
(define-public cmdtest
(package
(name "cmdtest")
--
2.49.0
From b29dbdc126584aca834352a46cee32ca4fe2758e Mon Sep 17 00:00:00 2001
From: nomike <nom...@nomike.com>
Date: Tue, 22 Apr 2025 21:06:30 +0200
Subject: [PATCH 3/5] gnu: Add hidapi-cmake
* gnu/packages/libusb.scm (hidapi-cmake): New variable
Change-Id: Ie75ada2a6ac0827082fa6327096b8f16fded6eb2
---
gnu/packages/libusb.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index a6e24f8c41..6f776937e3 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -712,6 +712,36 @@ (define-public hidapi
license:bsd-3
(license:non-copyleft "file://LICENSE-orig.txt")))))
+(define-public hidapi-cmake
+ (package
+ (name "hidapi-cmake")
+ (version "0.14.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/libusb/hidapi")
+ (commit (string-append "hidapi-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "121laqsml0104d1h4hp115gp21qiqi0r9dgcaqdi9ismmq3b6yx7"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f))
+ (inputs
+ (list libusb eudev))
+ (native-inputs
+ (list autoconf automake libtool pkg-config))
+ (home-page "https://github.com/libusb/hidapi")
+ (synopsis "HID API library")
+ (description
+ "HIDAPI is a library which allows an application to interface with USB and Bluetooth
+HID-Class devices.")
+ ;; HIDAPI can be used under one of three licenses.
+ (license (list license:gpl3
+ license:bsd-3
+ (license:non-copyleft "file://LICENSE-orig.txt")))))
+
(define-public python-hid
(package
(name "python-hid")
--
2.49.0
From 051fe181de574b3ed6f7f201400bdebebfd5e23e Mon Sep 17 00:00:00 2001
From: nomike <nom...@nomike.com>
Date: Tue, 22 Apr 2025 21:08:28 +0200
Subject: [PATCH 4/5] prusa-lubbgcode: Update to commit used by
prusa-slicer@2.9.2
Change-Id: Ifcb2fd1a6657516b616aec7102f19472a120b323
---
gnu/packages/engineering.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f472d1127f..440c075156 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -4355,8 +4355,8 @@ (define (fix-external-library cmake source)
(define-public prusa-libbgcode
;; Use the latest commit since there are no proper releases nor tags, see
;; <https://github.com/prusa3d/libbgcode/issues/31>.
- (let ((commit "8ae75bd0eea622f0e34cae311b3bd065b55eae9b")
- (revision "0"))
+ (let ((commit "5041c093b33e2748e76d6b326f2251310823f3df")
+ (revision "1"))
(package
(name "prusa-libbgcode")
(version (git-version "0.0.0" revision commit))
@@ -4368,8 +4368,8 @@ (define-public prusa-libbgcode
(commit commit)))
(file-name (git-file-name name version))
(sha256
- (base32 "0fjx2ijz9zqpqs486lcrrrhqvmfzrpb8j6v57l0jiynavwv3kznw"))))
- (native-inputs (list catch2))
+ (base32 "0ivc0zhpf0gz55jfj0gbkff6yw5gpwazk94asldzznn7x9jmbb0i"))))
+ (native-inputs (list catch2-3.8))
(propagated-inputs (list zlib boost heatshrink))
(build-system cmake-build-system)
(home-page "https://github.com/prusa3d/libbgcode")
--
2.49.0
From 80821653788cbd7565e1147be93f84fe7798c7e1 Mon Sep 17 00:00:00 2001
From: nomike <nom...@nomike.com>
Date: Wed, 23 Apr 2025 01:28:38 +0200
Subject: [PATCH 5/5] Update prusa-slicer to 2.9.2.
Change-Id: I3ffeffbc22419216f536174b5c26d37a4a2ec0e3
---
gnu/packages/engineering.scm | 58 +++++++++++++++++++++---------------
1 file changed, 34 insertions(+), 24 deletions(-)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 440c075156..02547c4800 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -42,6 +42,7 @@
;;; Copyright © 2024 Juliana Sims <j...@incana.org>
;;; Copyright © 2024 Nguyễn Gia Phong <mcsi...@disroot.org>
;;; Copyright © 2025 Frederick Muriuki Muriithi <fredmang...@gmail.com>
+;;; Copyright © 2025 nomike Postmann <nom...@nomike.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -169,6 +170,7 @@ (define-module (gnu packages engineering)
#:use-module (gnu packages tree-sitter)
#:use-module (gnu packages version-control)
#:use-module (gnu packages web)
+ #:use-module (gnu packages webkit)
#:use-module (gnu packages wxwidgets)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
@@ -4402,7 +4404,7 @@ (define-public prusa-libbgcode
(define-public prusa-slicer
(package
(name "prusa-slicer")
- (version "2.7.4")
+ (version "2.9.2")
(source
(origin
(method git-fetch)
@@ -4411,8 +4413,12 @@ (define-public prusa-slicer
(url "https://github.com/prusa3d/PrusaSlicer")
(commit (string-append "version_" version))))
(file-name (git-file-name name version))
- (sha256 (base32 "0s1cfvhfilyv0y98asr61c6rwlgyr1hf5v5hg8q9zwmzm2bkcql3"))
- (patches (search-patches "prusa-slicer-fix-tests.patch"))
+ (sha256 (base32 "05zwwhqv3fjg9rx6a4ga55f4ic1136f6lwms0kb4kaq50w9dvxwg"))
+ (patches (search-patches "prusaslicer-2.6.0-dont-force-link-to-wayland-and-x11.patch"
+ "prusaslicer-2.8.1-cgal-6.0.patch"
+ "prusaslicer-2.8.1-fix-libsoup-double-linking.patch"
+ "prusaslicer-2.8.1-fstream.patch"
+ ))
(modules '((guix build utils)))
(snippet
`(begin
@@ -4420,25 +4426,22 @@ (define-public prusa-slicer
;; Most of them contain prusa-specific modifications (e.g. avrdude),
;; but others do not. Here we replace the latter with Guix packages.
;; Remove bundled libraries that were not modified by Prusa Slicer developers.
- (delete-file-recursively "src/hidapi")
- (delete-file-recursively "src/eigen")
- (delete-file-recursively "src/libigl/igl")
- (substitute* "CMakeLists.txt"
- (("add_library\\(libexpat INTERFACE\\)")
- ""))
- (substitute* "src/libigl/CMakeLists.txt"
+ (delete-file-recursively "bundled_deps/hidapi")
+ (delete-file-recursively "bundled_deps/libigl/igl")
+ (substitute* "bundled_deps/libigl/CMakeLists.txt"
(("target_link_libraries\\(libigl INTERFACE igl::core\\)") ""))
- (substitute* "src/CMakeLists.txt"
+ (substitute* "bundled_deps/CMakeLists.txt"
(("add_subdirectory\\(hidapi\\)")
- "pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw)")
- (("include_directories\\(hidapi/include\\)")
- "include_directories()"))
+ ""))
+ (substitute* "src/CMakeLists.txt"
+ (("add_subdirectory\\(clipper\\)")
+ "add_subdirectory(clipper)\nfind_package(hidapi REQUIRED)"))
(substitute* "src/slic3r/CMakeLists.txt"
- (("add_library\\(libslic3r_gui.*" all)
- (string-append
- all
- "\ntarget_include_directories(libslic3r_gui PUBLIC ${HIDAPI_INCLUDE_DIRS})\n"))
- (("\\bhidapi\\b") "${HIDAPI_LIBRARIES}"))))))
+ (("add_library\\(libslic3r_gui.*" all)
+ (string-append
+ all
+ "\nfind_package(hidapi REQUIRED)\n"))
+ )))))
(build-system cmake-build-system)
(arguments
(list #:configure-flags
@@ -4458,9 +4461,13 @@ (define-public prusa-slicer
(lambda _
(substitute* "tests/libslic3r/test_quadric_edge_collapse.cpp"
(("#include <libigl/igl/qslim.h>")
- "#include <igl/qslim.h>")))))))
+ "#include <igl/qslim.h>"))
+ (substitute* "src/slic3r/GUI/Mouse3DController.hpp"
+ (( "#include \"hidapi.h\"")
+ "#include \"hidapi/hidapi.h\"")
+ ))))))
(native-inputs
- (list pkg-config catch2))
+ (list pkg-config catch2-3.8))
(inputs
(list boost
cereal
@@ -4469,13 +4476,13 @@ (define-public prusa-slicer
dbus
eigen
eudev
- expat
+ `(,expat "static")
glew
glib
gmp
gtk+
heatshrink
- hidapi
+ hidapi-cmake
ilmbase
libigl
libjpeg-turbo
@@ -4484,7 +4491,8 @@ (define-public prusa-slicer
mpfr
nanosvg
nlopt
- opencascade-occt
+ opencascade-occt-7.6.1
+ openssl
openvdb
pango
prusa-libbgcode
@@ -4493,6 +4501,8 @@ (define-public prusa-slicer
prusa-wxwidgets
qhull
tbb
+ webkitgtk-for-gtk3
+ z3
zlib))
(home-page "https://www.prusa3d.com/prusaslicer/")
(synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)")
--
2.49.0