summary refs log tree commit diff
path: root/gnu/packages/engineering.scm
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2024-07-13 14:13:17 +0300
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-08-12 23:09:07 +0100
commit99a81b6f2a1386d6ea76a6ecb1942f1f7f891080 (patch)
tree61caa54184e6977472bf801d2848c24899f5d658 /gnu/packages/engineering.scm
parent23fc353b3a5ad874b65c1b9d2ee55b2892db056c (diff)
downloadguix-99a81b6f2a1386d6ea76a6ecb1942f1f7f891080.tar.gz
gnu: prusa-slicer: Update to 2.7.4.
* gnu/packages/engineering.scm (prusa-slicer): Update to 2.7.4.
[source]: Remove "prusa-slicer-boost-fixes.patch" and
"prusa-slicer-with-cereal-1.3.1.patch".  Move some part of the snippet code to
custom build phases.
[arguments] <configure-flags>: Add paths to external libraries.  Add
"fix-include-paths" phase.
[native-inputs]: Add catch2.
[inputs]: Use prusa-wxwidgets instead of wxwidgets to fix segfaults.  Add
qhull, nanosvg, heatshrink and prusa-libbgcode.  Sort inputs aphabetically.
* gnu/packages/patches/prusa-slicer-boost-fixes.patch,
gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch: Remove unused
patches.
* gnu/local.mk (dist_patch_DATA): De-register "prusa-slicer-boost-fixes.patch"
and "prusa-slicer-with-cereal-1.3.1.patch".

Change-Id: I15e85d63c9ad6c731c8040ef2d8ec8b2f31f2ab7
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/engineering.scm')
-rw-r--r--gnu/packages/engineering.scm55
1 files changed, 36 insertions, 19 deletions
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index c4c5333beb..7a9c0bc436 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3926,7 +3926,7 @@ G-codes to binary and vice versa.")
 (define-public prusa-slicer
   (package
     (name "prusa-slicer")
-    (version "2.5.2")
+    (version "2.7.4")
     (source
      (origin
        (method git-fetch)
@@ -3935,13 +3935,11 @@ G-codes to binary and vice versa.")
          (url "https://github.com/prusa3d/PrusaSlicer")
          (commit (string-append "version_" version))))
        (file-name (git-file-name name version))
-       (sha256 (base32 "02qcrw3fa0d8ldbp73hp14l1qxbp3f4608j4csc07ny00ra42151"))
-       (patches (search-patches "prusa-slicer-boost-fixes.patch"
-                                "prusa-slicer-fix-tests.patch"
-                                "prusa-slicer-with-cereal-1.3.1.patch"))
+       (sha256 (base32 "0s1cfvhfilyv0y98asr61c6rwlgyr1hf5v5hg8q9zwmzm2bkcql3"))
+       (patches (search-patches "prusa-slicer-fix-tests.patch"))
        (modules '((guix build utils)))
        (snippet
-        '(begin
+        `(begin
            ;; Prusa slicer bundles a lot of dependencies in src/ directory.
            ;; Most of them contain prusa-specific modifications (e.g. avrdude),
            ;; but others do not. Here we replace the latter with Guix packages.
@@ -3949,10 +3947,12 @@ G-codes to binary and vice versa.")
            (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"
+             (("target_link_libraries\\(libigl INTERFACE igl::core\\)") ""))
            (substitute* "src/CMakeLists.txt"
-             (("add_subdirectory\\(libigl\\)" all)
-              (string-append
-               all "\ninclude_directories(libigl INTERFACE libigl::core)"))
              (("add_subdirectory\\(hidapi\\)")
               "pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw)")
              (("include_directories\\(hidapi/include\\)")
@@ -3965,13 +3965,26 @@ G-codes to binary and vice versa.")
              (("\\bhidapi\\b") "${HIDAPI_LIBRARIES}"))))))
     (build-system cmake-build-system)
     (arguments
-     `(#:configure-flags
-       '("-DSLIC3R_FHS=1" ;; Use The Filesystem Hierarchy Standard.
-         "-DSLIC3R_GTK=3" ;; Use GTK+
-         ;; Use wxWidgets 3.0.x.x to prevent GUI crashes when adding support enforcers.
-         "-DSLIC3R_WX_STABLE=1")))
+     (list #:configure-flags
+           #~(list "-DSLIC3R_FHS=1" ;; Use The Filesystem Hierarchy Standard.
+                   "-DSLIC3R_GTK=3" ;; Use GTK+
+                   ;; Use wxWidgets 3.0.x.x to prevent GUI crashes when adding support enforcers.
+                   "-DSLIC3R_WX_STABLE=1"
+                   (format #f "-Dlibigl_DIR=~a"
+                           (search-input-directory %build-inputs
+                                                   "lib/cmake/igl/"))
+                   (format #f "-DCatch2_DIR=~a"
+                           (search-input-directory %build-inputs
+                                                   "lib/cmake/Catch2/")))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'fix-include-paths
+                 (lambda _
+                   (substitute* "tests/libslic3r/test_quadric_edge_collapse.cpp"
+                     (("#include <libigl/igl/qslim.h>")
+                      "#include <igl/qslim.h>")))))))
     (native-inputs
-     (list pkg-config))
+     (list pkg-config catch2))
     (inputs
      (list boost
            cereal
@@ -3979,11 +3992,13 @@ G-codes to binary and vice versa.")
            curl
            dbus
            eigen
+           eudev
            expat
            glew
            glib
            gmp
            gtk+
+           heatshrink
            hidapi
            ilmbase
            libigl
@@ -3991,15 +4006,17 @@ G-codes to binary and vice versa.")
            libpng
            mesa
            mpfr
+           nanosvg
            nlopt
            opencascade-occt
            openvdb
            pango
+           prusa-libbgcode
+           ;; XXX: Using Prusa wxWidgets fork as PrusaSlicer segfaults when compiled
+           ;; with regular wxwidgets.
+           prusa-wxwidgets
+           qhull
            tbb
-           eudev
-           ;; prusa-slicer 2.5 segfaults on startup with wxwidgets 3.2
-           ;; See https://github.com/prusa3d/PrusaSlicer/issues/8299
-           wxwidgets-3.0
            zlib))
     (home-page "https://www.prusa3d.com/prusaslicer/")
     (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)")