diff mbox series

[bug#57361] gnu: Add solvespace.

Message ID CAAGQtHywqnr7nAkWg8NA=b1DcSuciFaHiH+r+qhehV6zQOTZoQ@mail.gmail.com
State Accepted
Headers show
Series [bug#57361] gnu: Add solvespace. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Kristian Lein-Mathisen Sept. 5, 2022, 7:57 p.m. UTC
Hi,

And thanks for your feedback, Liliana. Here's another attempt!

> > +(define mimalloc-for-solvespace
> Given that this is the upstream mimalloc, there's no reason to make
> this private or only for solvespace. Note that you should separate
> this into one patch per package.
> > + (let ((commit "f2712f4a8f038a7fb4df2790f4c3b7e3ed9e219b")
> > + (version "2.0.6"))
> This is the release commit, no reason to use git-version etc. here

Done! I wasn't sure where to place this public mimalloc. I asked
on #guix but go no replies, so I kept it right there in engineering.scm.

> > + (synopsis "Compact general purpose allocator with excellent
> > performance")
> Don't bloat the synopsis with marketing terms; "General purpose
> allocator" should probably suffice.

Ah, of course. Fixed.

> > + (define-public solvespace
> > + (let ((commit "70bde63cb32a7f049fa56cbdf924e2695fcb2916")
> > + (version "3.1")
> I haven't checked, but is this the release commit? If so, no need for
> all this verbosity.

Unfortunately, the verbosity is needed. I need to reference the commit hash
before the configure phase below.

> > + (libdxfrw-sources (origin
> > + (method git-fetch)
> > + (uri (git-reference (url
> > + "https://github.com/solvespace/libdxfrw")
> > + (commit
> > +   "0b7b7b709d9299565db603f878214656ef5e9ddf")))
> > + (sha256 (base32
> > +  "0d2wjq81466m3hb5cffiy99vhx0irwwy47yfxp318k2q4cvd5z2a")))))
> This should be its own variable. Unlike with mimalloc, since it's just
> an origin, you can use the same patch as solvespace.

Done, but here I'm curious - why does this deserve it's own top-level
variable? It shouldn't to be referenced by anything other than inside
SolveSpace.
Could I have used a nested define inside solvespace instead?

> > + (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)))
> > +   (file-name (git-file-name name version))
> > +   (sha256
> > +   (base32
> > +    "1hbdln44k00a6vlklv2mq2c9zda3i9d5x0f7ks85w4v6zskhqnra"))))
> > + (build-system cmake-build-system)
> > + (native-inputs (list pkg-config gettext-minimal))
> > + (arguments
> > + (list #:build-type "Release"
> > + #:phases #~(modify-phases %standard-phases
> `guix style' is not yet perfect when it comes to trade-offs between
> horizontal and vertical space. Prefer
> (list
> #:build-type "Release"
> #:phases
> #~(modify-phases ...

Indentation fixed (by Emacs this time, not guix style).

K.
diff mbox series

Patch

From 7602c8d01e7fce26551037304fa2c65f29e5c892 Mon Sep 17 00:00:00 2001
From: Kristian Lein-Mathisen <kristianlein@gmail.com>
Date: Mon, 5 Sep 2022 21:49:03 +0200
Subject: [PATCH 1/2] gnu: Add mimalloc.

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

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f195179413..5f5ef158a2 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2895,6 +2895,28 @@  (define-public pcb2gcode
 dynamic calibration of the milling depth.")
      (license license:gpl3+))))
 
+;; Note there is another mimalloc used in rust-mimalloc (version 1.6.4).
+(define-public mimalloc
+  (package
+    (name "mimalloc")
+    (version "2.0.6")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/microsoft/mimalloc")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "05x2dl3zimflfj91ns3vrphmzpdlyyr230p9adqgfds101f16qmv"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:build-type "Release"))
+    (synopsis "General purpose memory allocator")
+    (description "@code{mimalloc} is a drop-in replacement for @code{malloc}.")
+    (home-page "https://microsoft.github.io/mimalloc/")
+    (license license:expat)))
+
 (define-public syscall-intercept
   ;; Upstream provides no tag. Also, last version update is 4 years old.
   (let ((commit "304404581c57d43478438d175099d20260bae74e")

base-commit: c4504dfb1da78f2f21fc5139a2fd5e82ed0ef21c
-- 
2.37.2