[bug#78668,4/4] gnu: openscad: Update to 2025.06.01

Message ID 20250602021230.3231771-4-nomike@nomike.com
State New
Headers
Series Update openscad to 2024.06.01 and improve package |

Commit Message

nomike June 2, 2025, 2:12 a.m. UTC
  * gnu/packages/engineering.scm (openscad): Update to 2025.06.01, unundle bundles libraries, fix all tests, properly comment all fixes currently in place including links to upstream tickets.

Change-Id: I8537290ebd23c14f1d5eef66440d905db7a1e773
---
 gnu/packages/engineering.scm                  |  58 ++++++---
 ...cted-test-results-to-acommodate-diff.patch | 117 ++++++++++++++++++
 2 files changed, 158 insertions(+), 17 deletions(-)
 create mode 100644 gnu/packages/patches/openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch
  

Patch

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index d9be7a50c4..a2a7177b79 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3189,8 +3189,8 @@  (define-public python-lcapy
     (license license:lgpl2.1+)))
 
 (define-public openscad
-  (let ((commit "72c9919d63116f8e711f3566ae34e9eb63a2d6e6")
-        (version "2025.05.08")
+  (let ((commit "7245089d3226de41ab55faee62ffe326f6efcb69")
+        (version "2025.06.01")
         (revision "0"))
     (package
       (name "openscad")
@@ -3201,23 +3201,27 @@  (define-public openscad
          (uri (git-reference
                (url "https://github.com/openscad/openscad")
                (commit commit)
+               ;; Needed for libraries/MCAD, a library specific to OpenSCAD
+               ;; which is included as a submodule. All other libraries are
+               ;; deleted in the patch-source build phase.
                (recursive? #t)))
          (sha256
-          (base32 "077x7s3z65mz6rnrzan3qn06045d2fkqnd6ss6ibw1fhlaypzfbf"))
+          (base32 "1bkzrjjp0qvfg7pj24j5pa0i6zj0zsqjb5z4w4l6pjdb5q9in0qi"))
+         (patches (search-patches
+                   "openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch"))
          (file-name (git-file-name name version))))
       (build-system qt-build-system)
       (arguments
        (list
         #:configure-flags
         #~(list "-DCMAKE_BUILD_TYPE=Release"
-                "-DUSE_BUILTIN_OPENCSG=ON"
+                "-DUSE_BUILTIN_CLIPPER2=OFF"
+                "-DUSE_BUILTIN_MANIFOLD=OFF"
+                "-DUSE_BUILTIN_OPENCSG=OFF"
                 "-DMANIFOLD_PYBIND=OFF"
                 "-DMANIFOLD_TEST=OFF"
-                "-DENABLE_TESTS=OFF"
                 "-DEXPERIMENTAL=ON"
-                "-DSNAPSHOT=ON"
                 "-DENABLE_PYTHON=ON"
-                "-DUSE_BUILTIN_CLIPPER2=OFF"
                 (string-append "-DOPENSCAD_VERSION="
                                #$version)
                 (string-append "-DOPENSCAD_COMMIT="
@@ -3226,27 +3230,47 @@  (define-public openscad
                 "-DENABLE_GLX=ON")
         #:phases
         #~(modify-phases %standard-phases
-            (delete 'check)
             (add-after 'unpack 'patch-source
               (lambda* (#:key inputs #:allow-other-keys)
-                ;; <https://github.com/openscad/openscad/issues/5877>
+                ;; Delete all unbundled libraries to replace them with guix
+                ;; packages.
+                (delete-file-recursively "submodules")
+                ;; Fix: Dependency lib3mf is not found due to using a wrong
+                ;; variable name in the CMake config (see
+                ;; https://github.com/openscad/openscad/issues/5877).
                 (substitute* "cmake/Modules/FindLib3MF.cmake"
                   (("PC_LIB3MF_INCLUDE_DIRS")
                    "PC_LIB3MF_INCLUDEDIR"))
                 (substitute* "CMakeLists.txt"
-                  ;; <https://github.com/openscad/openscad/issues/5880>
+                  ;; Remove bundled libraries from cmake.
+                  (("add_subdirectory\\(submodules\\)")
+                   "")
+                  ;; Fix detection of EGL (see
+                  ;; https://github.com/openscad/openscad/issues/5880).
                   (("target_link_libraries\\(OpenSCAD PRIVATE OpenGL::EGL\\)")
-                   "      find_package(ECM REQUIRED NO_MODULE)
+                   "find_package(ECM REQUIRED NO_MODULE)
       list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
       find_package(EGL REQUIRED)
       target_link_libraries(OpenSCAD PRIVATE EGL::EGL)")
-                  ;; <https://github.com/openscad/openscad/issues/5897>
-                  (("find_package\\(Nettle 3.4\\)")
-                   "find_package(Nettle 3.4 REQUIRED)")
                   ;; Use the system sanitizers-cmake module.
                   (("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
                    (string-append (assoc-ref inputs "sanitizers-cmake")
-                                  "/share/sanitizers-cmake/cmake"))))))))
+                                  "/share/sanitizers-cmake/cmake")))
+                ;; Fix test-tool expecting build directory to be a direct
+                ;; subdirectory of the source directory (see
+                ;; https://github.com/openscad/openscad/issues/5937).
+                (substitute* "tests/test_cmdline_tool.py"
+                  (("build_to_test_sources = \"../../tests\"")
+                   "build_to_test_sources = \"../../source/tests\""))))
+            (add-before 'check 'patch-tests
+              (lambda _
+                ;; Fix tests expecting build directory to be a direct descendant
+                ;; of the source dir (see
+                ;; https://github.com/openscad/openscad/issues/5938).
+                (copy-recursively "../source/color-schemes" "./color-schemes")
+                (copy-recursively "../source/shaders" "./shaders")
+                ;; Required for fontconfig
+                (setenv "HOME" "/tmp"))))))
       (inputs (list boost
                     cairomm
                     cgal
@@ -3267,7 +3291,7 @@  (define-public openscad
                     libxml2
                     libzip
                     manifold
-                    mesa ; or libglvnd if we had mesa-glvnd, too
+                    mesa ;or libglvnd if we had mesa-glvnd, too
                     mimalloc
                     mpfr
                     nettle
@@ -3275,9 +3299,9 @@  (define-public openscad
                     python
                     python-numpy
                     python-pillow
-                    python-pip
                     qscintilla
                     qtbase-5
+                    qtgamepad
                     qtmultimedia-5
                     qtsvg-5
                     qtwayland-5
diff --git a/gnu/packages/patches/openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch b/gnu/packages/patches/openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch
new file mode 100644
index 0000000000..595acb8a68
--- /dev/null
+++ b/gnu/packages/patches/openscad-fix-path-in-expected-test-results-to-acommodate-diff.patch
@@ -0,0 +1,117 @@ 
+From 4fd0053f89728d03c3123c9473c36209556d1018 Mon Sep 17 00:00:00 2001
+From: nomike <nomike@nomike.com>
+Date: Sat, 31 May 2025 23:54:08 +0200
+Subject: [PATCH] Fix path in expected test  results to acommodate different
+ directory structure in guix build
+ (see https://github.com/openscad/openscad/issues/5938)
+---
+ .../echo/bitwise-operators-expected.echo       | 10 +++++-----
+ .../echo/include-recursive-test-expected.echo  | 18 +++++++++---------
+ .../echo/include-tests-expected.echo           |  8 ++++----
+ tests/regression/echo/linenumber-expected.echo | 18 +++++++++---------
+ tests/regression/echo/use-tests-expected.echo  |  8 ++++----
+ 5 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/tests/regression/echo/bitwise-operators-expected.echo b/tests/regression/echo/bitwise-operators-expected.echo
+index d85a95915..91f3155ba 100644
+--- a/tests/regression/echo/bitwise-operators-expected.echo
++++ b/tests/regression/echo/bitwise-operators-expected.echo
+@@ -1,8 +1,8 @@
+-WARNING: Hexadecimal constant "0x10000000000000000" too large in file ../../tests/data/scad/functions/bitwise-operators.scad, line 106
+-WARNING: Integer "0x1000000000000001" cannot be represented precisely in file ../../tests/data/scad/functions/bitwise-operators.scad, line 108
+-WARNING: Integer "1152921504606846977" cannot be represented precisely in file ../../tests/data/scad/functions/bitwise-operators.scad, line 109
+-WARNING: Integer "0xfffffffffffffff0" cannot be represented precisely in file ../../tests/data/scad/functions/bitwise-operators.scad, line 113
+-WARNING: Integer "18446744073709551600" cannot be represented precisely in file ../../tests/data/scad/functions/bitwise-operators.scad, line 113
++WARNING: Hexadecimal constant "0x10000000000000000" too large in file ../../source/tests/data/scad/functions/bitwise-operators.scad, line 106
++WARNING: Integer "0x1000000000000001" cannot be represented precisely in file ../../source/tests/data/scad/functions/bitwise-operators.scad, line 108
++WARNING: Integer "1152921504606846977" cannot be represented precisely in file ../../source/tests/data/scad/functions/bitwise-operators.scad, line 109
++WARNING: Integer "0xfffffffffffffff0" cannot be represented precisely in file ../../source/tests/data/scad/functions/bitwise-operators.scad, line 113
++WARNING: Integer "18446744073709551600" cannot be represented precisely in file ../../source/tests/data/scad/functions/bitwise-operators.scad, line 113
+ ECHO: "Expect two warnings:"
+ WARNING: undefined operation (number | bool) in file bitwise-operators.scad, line 42
+ WARNING: undefined operation (bool | number) in file bitwise-operators.scad, line 44
+diff --git a/tests/regression/echo/include-recursive-test-expected.echo b/tests/regression/echo/include-recursive-test-expected.echo
+index c20e44cbe..855c16d10 100644
+--- a/tests/regression/echo/include-recursive-test-expected.echo
++++ b/tests/regression/echo/include-recursive-test-expected.echo
+@@ -1,12 +1,12 @@
+-WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 1
+-WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 2
+-WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 3
+-WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 1
+-WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 2
+-WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 3
+-WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 1
+-WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 2
+-WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../tests/data/scad/misc/include-recursive-test.scad, line 3
++WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 1
++WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 2
++WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 3
++WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 1
++WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 2
++WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 3
++WARNING: Can't open include file 'include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 1
++WARNING: Can't open include file '../misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 2
++WARNING: Can't open include file '../../scad/misc/include-recursive-test.scad'. in file ../../source/tests/data/scad/misc/include-recursive-test.scad, line 3
+ ECHO: "INC"
+ ECHO: "INC"
+ ECHO: "INC"
+diff --git a/tests/regression/echo/include-tests-expected.echo b/tests/regression/echo/include-tests-expected.echo
+index d0aaecf88..64098d5d6 100644
+--- a/tests/regression/echo/include-tests-expected.echo
++++ b/tests/regression/echo/include-tests-expected.echo
+@@ -1,6 +1,6 @@
+-WARNING: Can't open include file 'not_exist.scad'. in file ../../tests/data/scad/misc/sub1/included.scad, line 3
+-WARNING: Can't open include file 'non/existent/path/non-file'. in file ../../tests/data/scad/misc/include-tests.scad, line 8
+-WARNING: Can't open include file 'test/'. in file ../../tests/data/scad/misc/include-tests.scad, line 20
+-WARNING: Can't open include file '/'. in file ../../tests/data/scad/misc/include-tests.scad, line 23
++WARNING: Can't open include file 'not_exist.scad'. in file ../../source/tests/data/scad/misc/sub1/included.scad, line 3
++WARNING: Can't open include file 'non/existent/path/non-file'. in file ../../source/tests/data/scad/misc/include-tests.scad, line 8
++WARNING: Can't open include file 'test/'. in file ../../source/tests/data/scad/misc/include-tests.scad, line 20
++WARNING: Can't open include file '/'. in file ../../source/tests/data/scad/misc/include-tests.scad, line 23
+ ECHO: "included.scad"
+ ECHO: "included2.scad"
+diff --git a/tests/regression/echo/linenumber-expected.echo b/tests/regression/echo/linenumber-expected.echo
+index 35a74ebe0..f243ae2c0 100644
+--- a/tests/regression/echo/linenumber-expected.echo
++++ b/tests/regression/echo/linenumber-expected.echo
+@@ -1,12 +1,12 @@
+-WARNING: Can't open library 'line 1'. in file ../../tests/data/scad/misc/linenumber.scad, line 1
+-WARNING: Can't open include file 'line 1'. in file ../../tests/data/scad/misc/linenumber.scad, line 1
+-WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../tests/data/scad/misc/linenumber.scad, line 7
+-WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../tests/data/scad/misc/linenumber.scad, line 8
+-WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../tests/data/scad/misc/linenumber.scad, line 9
+-WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../tests/data/scad/misc/linenumber.scad, line 10
+-WARNING: Can't open include file 'line 9'. in file ../../tests/data/scad/misc/linenumber.scad, line 10
+-WARNING: new lines 'use<>'-statement is not defined - behavior may change in the future in file ../../tests/data/scad/misc/linenumber.scad, line 16
+-WARNING: Can't open library 'line 16'. in file ../../tests/data/scad/misc/linenumber.scad, line 16
++WARNING: Can't open library 'line 1'. in file ../../source/tests/data/scad/misc/linenumber.scad, line 1
++WARNING: Can't open include file 'line 1'. in file ../../source/tests/data/scad/misc/linenumber.scad, line 1
++WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../source/tests/data/scad/misc/linenumber.scad, line 7
++WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../source/tests/data/scad/misc/linenumber.scad, line 8
++WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../source/tests/data/scad/misc/linenumber.scad, line 9
++WARNING: new lines in 'include<>'-statement is not defined - behavior may change in the future in file ../../source/tests/data/scad/misc/linenumber.scad, line 10
++WARNING: Can't open include file 'line 9'. in file ../../source/tests/data/scad/misc/linenumber.scad, line 10
++WARNING: new lines 'use<>'-statement is not defined - behavior may change in the future in file ../../source/tests/data/scad/misc/linenumber.scad, line 16
++WARNING: Can't open library 'line 16'. in file ../../source/tests/data/scad/misc/linenumber.scad, line 16
+ WARNING: Unable to convert cube(size="line 3", ...) parameter to a number or a vec3 of numbers in file linenumber.scad, line 3
+ WARNING: Unable to convert cube(size="line 12", ...) parameter to a number or a vec3 of numbers in file linenumber.scad, line 12
+ WARNING: Unable to convert cube(size="line 18", ...) parameter to a number or a vec3 of numbers in file linenumber.scad, line 18
+diff --git a/tests/regression/echo/use-tests-expected.echo b/tests/regression/echo/use-tests-expected.echo
+index 2da158d03..1cfa234e7 100644
+--- a/tests/regression/echo/use-tests-expected.echo
++++ b/tests/regression/echo/use-tests-expected.echo
+@@ -1,7 +1,7 @@
+-WARNING: Can't open library ''. in file ../../tests/data/scad/misc/use-tests.scad, line 2
+-WARNING: Can't open library 'non/existent/path/non-file'. in file ../../tests/data/scad/misc/use-tests.scad, line 8
+-WARNING: Can't open library 'test/'. in file ../../tests/data/scad/misc/use-tests.scad, line 20
+-WARNING: Can't open library '/'. in file ../../tests/data/scad/misc/use-tests.scad, line 23
++WARNING: Can't open library ''. in file ../../source/tests/data/scad/misc/use-tests.scad, line 2
++WARNING: Can't open library 'non/existent/path/non-file'. in file ../../source/tests/data/scad/misc/use-tests.scad, line 8
++WARNING: Can't open library 'test/'. in file ../../source/tests/data/scad/misc/use-tests.scad, line 20
++WARNING: Can't open library '/'. in file ../../source/tests/data/scad/misc/use-tests.scad, line 23
+ WARNING: Ignoring unknown module 'test3' in file use-tests.scad, line 42
+ WARNING: Ignoring unknown module 'test4' in file use-tests.scad, line 43
+ WARNING: Ignoring unknown variable "test2_variable" in file use-tests.scad, line 49
+-- 
+2.49.0