This is an automated email from the git hooks/post-receive script.

guix_mirror_bot pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 795069e4d2  gnu: Add pythonscad.
795069e4d2 is described below

commit 795069e4d2bb5bd95623c606b3db9fb1da6828f6
Author: nomike <[email protected]>
AuthorDate: Sun Aug 3 20:28:00 2025 +0200

     gnu: Add pythonscad.
    
    * gnu/packages/engineering.scm (pythonscad): New variable.
    
    Change-Id: Ib559ba4f10c0db685520ce1fa3417975c85ba0a6
    Signed-off-by: Andreas Enge <[email protected]>
---
 gnu/packages/engineering.scm | 66 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index c6905d3308..451d5ab9c9 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3438,6 +3438,72 @@ models in the STL and OFF file formats.")
       (home-page "https://openscad.org/";)
       (license license:gpl2+))))
 
+(define-public pythonscad
+  (let ((commit "e2641ca1a208a9a54a034a8818a9774ad4d5867c")
+        (version "0.0.0")
+        (revision "0"))
+    (package
+      (inherit openscad)
+      (name "pythonscad")
+      (version (git-version version revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/pythonscad/pythonscad";)
+               (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 "1i6yajamdrha2kpgyhn7jn6dv35qmgq0zsqv8cdzdqg5142v66ay"))
+         (modules '((guix build utils)))
+         (snippet #~(begin
+                      ;; Delete all unbundled libraries to replace them with
+                      ;; guix packages.
+                      (delete-file-recursively "submodules")
+                      (substitute* "CMakeLists.txt"
+                        ;; Remove bundled libraries from cmake.
+                        (("add_subdirectory\\(submodules\\)")
+                         ""))))
+         (file-name (git-file-name name version))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments openscad)
+         ((#:configure-flags flags
+           '())
+          #~(append #$flags
+                    (list "-DENABLE_LIBFIVE=ON" "-DUSE_BUILTIN_LIBFIVE=OFF"
+                          (string-append "-DPYTHON_VERSION="
+                                         #$(version-major+minor
+                                            (package-version python))))))
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (replace 'patch-source
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (substitute* "CMakeLists.txt"
+                    ;; 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)
+        list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+        find_package(EGL REQUIRED)
+        target_link_libraries(OpenSCAD PRIVATE EGL::EGL)")
+                    ;; Use the system sanitizers-cmake module.
+                    
(("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
+                     (string-append (assoc-ref inputs "sanitizers-cmake")
+                                    "/share/sanitizers-cmake/cmake")))))))))
+      (inputs (modify-inputs (package-inputs openscad)
+                (append curl libfive)))
+      (synopsis "Script-based 3D modeling app whith Python support")
+      (description
+       "PythonSCAD is a programmatic 3D modeling application.  It allows you
+to turn simple code into 3D models suitable for 3D printing.  It is a fork of
+OpenSCAD which not only adds support for using Python as a native language,
+but also adds new features and improves existing ones.")
+      (home-page "https://pythonscad.org/";)
+      (license license:gpl2+))))
+
 (define-public emacs-scad-mode
   (package
     (name "emacs-scad-mode")

Reply via email to