unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#57361] [PATCH] gnu: Add solvespace.
@ 2022-08-23 12:08 Kristian Lein-Mathisen
  2022-08-31 18:51 ` [bug#57361] Solvespace package re-done Kristian Lein-Mathisen
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Kristian Lein-Mathisen @ 2022-08-23 12:08 UTC (permalink / raw)
  To: 57361


[-- Attachment #1.1: Type: text/plain, Size: 1093 bytes --]

Hi everyone,

I'm new to Guix and I'm enjoying it very much so far. Here is my little
contribution: a lightweight CAD package. I don't have a lot of experience
with SolveSpace, so I haven't done any testing other than checking if
export to DXF works and drawing some sketches.

I think I've managed to follow the steps in the Submitting Patches
<https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>
guide. The package has a couple of TODO's though, mostly regarding
extracting dependencies instead of building the git submodules in-place:

- mimalloc This just points to Microsoft's upstream
<https://github.com/microsoft/mimalloc/tree/f819dbb4e4813fab464aee16770f39f11476bfea>,
very close to version 2.0.6. The only other use of mimalloc I found was
rust-mimalloc, but it seems to be
<https://github.com/purpleprotocol/mimalloc_rust/tree/v0.1.20/libmimalloc-sys/c_src>
on version mimalloc 1.6.4.

- dxfrw: I believe this is an independent fork
<https://github.com/solvespace/libdxfrw>, which is unlikely useful
elsewhere.

Please consider this for inclusion,
Thank you.
K.

[-- Attachment #1.2: Type: text/html, Size: 1343 bytes --]

[-- Attachment #2: 0001-gnu-Add-solvespace.patch --]
[-- Type: text/x-patch, Size: 4803 bytes --]

From e09bfd0058d35b3fd969ed4093cefeb6692715b0 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Tue, 23 Aug 2022 12:45:49 +0200
Subject: [PATCH] gnu: Add solvespace.

* gnu/packages/engineering.scm (solvespace): New variable.
---
 gnu/packages/engineering.scm | 79 ++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f195179413..47a723f329 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2895,6 +2895,85 @@ (define-public pcb2gcode
 dynamic calibration of the milling depth.")
      (license license:gpl3+))))
 
+(define-public solvespace
+  (let ((commit "ab00823acc2920e45b89ec655e4c51d4b346e5d8")
+        (version "3.1"))
+    (package
+      (name "solvespace")
+      (version (git-version version "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/solvespace/solvespace")
+                      (commit commit)
+                      (recursive? #t)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1qixcja3rrgm7qiwc8ydzqidifh3al9kyqgg15z27hcvjlkv70v4"))))
+      (build-system cmake-build-system)
+      (native-inputs (list pkg-config gettext-minimal))
+      (arguments
+       `(#:build-type "Release"
+         #:tests? #f
+         #:phases (modify-phases %standard-phases
+                    ;; CMakeLists will try to `git describe` by default, which doesn't
+                    ;; work inside the temporary build dir. So we embed the commit hash
+                    ;; as described in CMakeLists.txt's comments.
+                    (add-before 'configure 'embed-git-commit-hash
+                      (lambda _
+                        (substitute* "CMakeLists.txt"
+                          (("include\\(GetGitCommitHash\\)")
+                           (string-append "set(GIT_COMMIT_HASH "
+                                          ,commit ")")))))
+                    ;; TODO: only initialize the needed submodules, instead of
+                    ;; initializing all (with recursive? #t) and then deleting most
+                    (add-before 'configure 'delete-submodules
+                      (lambda _
+                        (delete-file-recursively "extlib/angle")
+                        (delete-file-recursively "extlib/cairo")
+                        (delete-file-recursively "extlib/freetype")
+                        ;; TODO: see if we can package upstream libdxfrw and use that
+                        ;; instead
+                        ;; (delete-file-recursively "extlib/libdxfrw")
+                        ;; TODO: see if we can package upstream mimalloc and use that
+                        ;; instead
+                        ;; (delete-file-recursively "extlib/mimalloc")
+                        (delete-file-recursively "extlib/libpng")
+                        (delete-file-recursively "extlib/pixman")
+                        (delete-file-recursively "extlib/si")
+                        (delete-file-recursively "extlib/zlib"))))))
+      (inputs (list cairo
+                    freetype
+                    gtkmm-3
+                    json-c
+                    libpng
+                    libspnav
+                    mesa
+                    zlib))
+      (synopsis "Parametric 2D/3D CAD")
+      (description
+       "SOLVESPACE is a free (GPLv3) parametric 3D @acronym{CAD,
+Computer Aided Design} tool.  Applications include:
+
+@itemize
+@item modeling 3d parts — draw with extrudes, revolves, helixes and
+      Boolean (union / difference / intersection) operations
+@item modeling 2d parts — draw the part as a single section,
+      and export DXF, PDF, SVG; use 3d assembly to verify fit
+@item 3d-printed parts — export the STL or other triangle mesh
+      expected by most 3d printers
+@item preparing CAM data — export 2d vector art for a waterjet
+      machine or laser cutter; or generate STEP or STL, for import into
+      third-party CAM software for machining
+@item mechanism design — use the constraint solver to simulate planar
+      or spatial linkages, with pin, ball, or slide joints
+@item plane and solid geometry — replace hand-solved trigonometry and spreadsheets
+      with a live dimensioned drawing
+@end itemize")
+      (home-page "https://solvespace.com/")
+      (license license:gpl3+))))
+
 (define-public syscall-intercept
   ;; Upstream provides no tag. Also, last version update is 4 years old.
   (let ((commit "304404581c57d43478438d175099d20260bae74e")

base-commit: 7c47fa25134a2111e596e96198d02644aedae459
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-11 14:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 12:08 [bug#57361] [PATCH] gnu: Add solvespace Kristian Lein-Mathisen
2022-08-31 18:51 ` [bug#57361] Solvespace package re-done Kristian Lein-Mathisen
2022-09-01 17:18   ` Liliana Marie Prikler
2022-09-01 17:20     ` Liliana Marie Prikler
2022-09-05 19:57 ` [bug#57361] [PATCH] gnu: Add solvespace Kristian Lein-Mathisen
2022-09-06  8:30 ` Kristian Lein-Mathisen
2022-09-06  8:33 ` Kristian Lein-Mathisen
2022-09-08 13:14   ` Ludovic Courtès
2022-09-10 15:27     ` Liliana Marie Prikler
2022-09-11 14:13       ` bug#57361: " Ludovic Courtès
2022-09-10  7:55 ` [bug#57361] " ( via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).