[PATCH] gnu: Add solvespace.

OpenSubmitted by Myles English.
Details
3 participants
  • Ludovic Courtès
  • Myles English
  • swedebugia
Owner
unassigned
Severity
normal
M
M
Myles English wrote on 24 Jun 2019 14:27
(address . guix-patches@gnu.org)(name . Myles English)(address . myles@tdma.co)
20190624122710.22874-1-myles@tdma.co
* gnu/packages/game-development.scm (solvespace): New variable and
dependencies on gnu package modules.
---
gnu/packages/engineering.scm | 70 ++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)

Toggle diff (101 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 7d48414889..7fc06a6730 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
+;;; Copyright © 2019 Myles English <myles@tdma.co>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -80,6 +81,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages serialization)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages texinfo)
@@ -87,6 +89,8 @@
   #:use-module (gnu packages tex)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public librecad
@@ -2062,3 +2066,69 @@ purpose circuit simulator and can perform DC and transient analyses, fourier
 analysis and AC analysis.  The engine is designed to do true mixed-mode
 simulation.")
     (license license:gpl3+)))
+
+(define-public solvespace-3
+  (let ((commit "5df53fc59e7f31e265fabd4c15e6601bd3032833")
+	(revision "1"))
+    (package
+      (name "solvespace")
+      (version (git-version "3.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/solvespace/solvespace.git")
+               (commit commit)
+               (recursive? #t)))
+         (sha256
+          (base32
+           "0kps2rgakdrbm9f6gwkb7za5ikkc4m6y2x162y3c53ixg5snmlr1"))
+         (file-name (git-file-name name version))
+         (modules '((guix build utils)))
+         (snippet
+          '(begin
+             ;; delete some recursive submodules in order to use guix packages
+             (delete-file-recursively "extlib/zlib")
+             (delete-file-recursively "extlib/libpng")
+             (delete-file-recursively "extlib/freetype")
+             ;; pixman only needed for tests?
+             (delete-file-recursively "extlib/pixman")
+             (delete-file-recursively "extlib/cairo")
+             (delete-file-recursively "extlib/flatbuffers")
+             #t))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:configure-flags
+         (list "-DCMAKE_BUILD_TYPE=Release"
+               (string-append
+                "-DFLATC="
+                (assoc-ref %build-inputs "flatbuffers") "/bin/flatc"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'set-git-commit-hash
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "CMakeLists.txt"
+                 (("include\\(GetGitCommitHash\\)")
+                  "#include(GetGitCommitHash)")
+                 (("\\# set\\(GIT_COMMIT_HASH
+                                    0000000000000000000000000000000000000000\\)")
+                  (string-append "set(GIT_COMMIT_HASH " ,commit ")"))
+                 (("message\\(STATUS \\\"Using in-tree flatbuffers\\\"\\)")
+                  "message(STATUS \"Using guix flatbuffers\")")
+                 (("add_subdirectory\\(extlib/flatbuffers EXCLUDE_FROM_ALL\\)")
+                  "#add_subdirectory(extlib/flatbuffers EXCLUDE_FROM_ALL)"))
+               #t)))))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)))
+      (inputs
+       `(("git" ,git)
+         ("json-c" ,json-c)
+         ("glu" ,glu)
+         ("gtkmm" ,gtkmm)
+         ("flatbuffers" ,flatbuffers)))
+      (home-page "http://solvespace.com")
+      (synopsis "Parametric 2D/3D CAD tool")
+      (description "Parametric 2D/3D computer aided design (CAD) tool and
+constraint-based parametric modeler with simple mechanical simulation
+capabilities.")
+      (license license:gpl3+))))
-- 
2.22.0
S
S
swedebugia wrote on 25 Jun 2019 22:35
(address . guix-patches@gnu.org)
f1f038f2-ca4c-cdf7-6059-5df3d398dbc6@riseup.net
On 2019-06-24 14:27, Myles English wrote:
Toggle quote (54 lines)
> * gnu/packages/game-development.scm (solvespace): New variable and
> dependencies on gnu package modules.
> ---
> gnu/packages/engineering.scm | 70 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 70 insertions(+)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index 7d48414889..7fc06a6730 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -11,6 +11,7 @@
> ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
> ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
> ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
> +;;; Copyright © 2019 Myles English <myles@tdma.co>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -80,6 +81,7 @@
> #:use-module (gnu packages python-xyz)
> #:use-module (gnu packages qt)
> #:use-module (gnu packages readline)
> + #:use-module (gnu packages serialization)
> #:use-module (gnu packages swig)
> #:use-module (gnu packages tcl)
> #:use-module (gnu packages texinfo)
> @@ -87,6 +89,8 @@
> #:use-module (gnu packages tex)
> #:use-module (gnu packages version-control)
> #:use-module (gnu packages wxwidgets)
> + #:use-module (gnu packages web)
> + #:use-module (gnu packages xml)
> #:use-module (gnu packages xorg))
>
> (define-public librecad
> @@ -2062,3 +2066,69 @@ purpose circuit simulator and can perform DC and transient analyses, fourier
> analysis and AC analysis. The engine is designed to do true mixed-mode
> simulation.")
> (license license:gpl3+)))
> +
> +(define-public solvespace-3
> + (let ((commit "5df53fc59e7f31e265fabd4c15e6601bd3032833")
> + (revision "1"))
> + (package
> + (name "solvespace")
> + (version (git-version "3.0" revision commit))
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/solvespace/solvespace.git")
> + (commit commit)
> + (recursive? #t)))

A stable release tarball is available on the release page it seems.

Toggle quote (54 lines)
> + (sha256
> + (base32
> + "0kps2rgakdrbm9f6gwkb7za5ikkc4m6y2x162y3c53ixg5snmlr1"))
> + (file-name (git-file-name name version))
> + (modules '((guix build utils)))
> + (snippet
> + '(begin
> + ;; delete some recursive submodules in order to use guix packages
> + (delete-file-recursively "extlib/zlib")
> + (delete-file-recursively "extlib/libpng")
> + (delete-file-recursively "extlib/freetype")
> + ;; pixman only needed for tests?
> + (delete-file-recursively "extlib/pixman")
> + (delete-file-recursively "extlib/cairo")
> + (delete-file-recursively "extlib/flatbuffers")
> + #t))))
> + (build-system cmake-build-system)
> + (arguments
> + `(#:configure-flags
> + (list "-DCMAKE_BUILD_TYPE=Release"
> + (string-append
> + "-DFLATC="
> + (assoc-ref %build-inputs "flatbuffers") "/bin/flatc"))
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'set-git-commit-hash
> + (lambda* (#:key inputs #:allow-other-keys)
> + (substitute* "CMakeLists.txt"
> + (("include\\(GetGitCommitHash\\)")
> + "#include(GetGitCommitHash)")
> + (("\\# set\\(GIT_COMMIT_HASH
> + 0000000000000000000000000000000000000000\\)")
> + (string-append "set(GIT_COMMIT_HASH " ,commit ")"))
> + (("message\\(STATUS \\\"Using in-tree flatbuffers\\\"\\)")
> + "message(STATUS \"Using guix flatbuffers\")")
> + (("add_subdirectory\\(extlib/flatbuffers EXCLUDE_FROM_ALL\\)")
> + "#add_subdirectory(extlib/flatbuffers EXCLUDE_FROM_ALL)"))
> + #t)))))
> + (native-inputs
> + `(("pkg-config" ,pkg-config)))
> + (inputs
> + `(("git" ,git)
> + ("json-c" ,json-c)
> + ("glu" ,glu)
> + ("gtkmm" ,gtkmm)
> + ("flatbuffers" ,flatbuffers)))
> + (home-page "http://solvespace.com")
> + (synopsis "Parametric 2D/3D CAD tool")
> + (description "Parametric 2D/3D computer aided design (CAD) tool and
> +constraint-based parametric modeler with simple mechanical simulation
> +capabilities.")
> + (license license:gpl3+))))
>

The patch did not apply for some reason.

I did not try to build this package because the recursive checkouts of
cairo et al took too much bandwidth. This is another reason to use the
tarball instead - less waste of bandwidth.

Could you switch to that?

--
Cheers Swedebugia
L
L
Ludovic Courtès wrote on 3 Jul 2019 00:30
(name . Myles English)(address . mylesenglish@gmail.com)
87r2783w83.fsf@gnu.org
Hello Myles,

Myles English <mylesenglish@gmail.com> skribis:

Toggle quote (3 lines)
> * gnu/packages/game-development.scm (solvespace): New variable and
> dependencies on gnu package modules.

The patch LGTM overall. Here are some comments/questions:

Toggle quote (8 lines)
> +(define-public solvespace-3
> + (let ((commit "5df53fc59e7f31e265fabd4c15e6601bd3032833")
> + (revision "1"))
> + (package
> + (name "solvespace")
> + (version (git-version "3.0" revision commit))


Why choose this commit specifically? ‘git describe’ returns
“v2.1.rc1-570-g5df53fc”, and in fact there’s no “v3.0” tag, so this
version string is a bit misleading.

The general policy is to use the latest release, but if there’s a
compelling argument, we can use another commit; in that case, it’s
better to have a comment explaining the choice.

Toggle quote (5 lines)
> + (uri (git-reference
> + (url "https://github.com/solvespace/solvespace.git")
> + (commit commit)
> + (recursive? #t)))

Is ‘recursive?’ needed? If it’s just for the bundled dependencies under
extlib/ that are not used anyway, perhaps we can omit it?

Toggle quote (5 lines)
> + (synopsis "Parametric 2D/3D CAD tool")
> + (description "Parametric 2D/3D computer aided design (CAD) tool and
> +constraint-based parametric modeler with simple mechanical simulation
> +capabilities.")

Could you make it a full sentence and perhaps expound a little bit, as

Thank you, and apologies for the delay!

Ludo’.
L
L
Ludovic Courtès wrote on 2 Sep 2019 15:24
(name . Myles English)(address . mylesenglish@gmail.com)
87v9ua96h9.fsf@gnu.org
Hello Myles,

Did you have a chance to look into that? (See below.)

Thanks in advance,
Ludo’.

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (44 lines)
> Hello Myles,
>
> Myles English <mylesenglish@gmail.com> skribis:
>
>> * gnu/packages/game-development.scm (solvespace): New variable and
>> dependencies on gnu package modules.
>
> The patch LGTM overall. Here are some comments/questions:
>
>> +(define-public solvespace-3
>> + (let ((commit "5df53fc59e7f31e265fabd4c15e6601bd3032833")
>> + (revision "1"))
>> + (package
>> + (name "solvespace")
>> + (version (git-version "3.0" revision commit))
>
>
> Why choose this commit specifically? ‘git describe’ returns
> “v2.1.rc1-570-g5df53fc”, and in fact there’s no “v3.0” tag, so this
> version string is a bit misleading.
>
> The general policy is to use the latest release, but if there’s a
> compelling argument, we can use another commit; in that case, it’s
> better to have a comment explaining the choice.
>
>> + (uri (git-reference
>> + (url "https://github.com/solvespace/solvespace.git")
>> + (commit commit)
>> + (recursive? #t)))
>
> Is ‘recursive?’ needed? If it’s just for the bundled dependencies under
> extlib/ that are not used anyway, perhaps we can omit it?
>
>> + (synopsis "Parametric 2D/3D CAD tool")
>> + (description "Parametric 2D/3D computer aided design (CAD) tool and
>> +constraint-based parametric modeler with simple mechanical simulation
>> +capabilities.")
>
> Could you make it a full sentence and perhaps expound a little bit, as
> per <https://gnu.org/s/guix/manual/en/html_node/Synopses-and-Descriptions.html>?
>
> Thank you, and apologies for the delay!
>
> Ludo’.
M
M
Myles English wrote on 3 Sep 2019 02:28
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAO=Do-y9429YgXeuPvC9gza+-J9QRhbRTAsEO_aoYpvpwwD-0A@mail.gmail.com
Hi Ludo',

Thanks a lot for your comments, sorry I hadn't replied yet.

On Mon, 2 Sep 2019, 14:24 Ludovic Courtès, <ludo@gnu.org> wrote:

Toggle quote (11 lines)
> Did you have a chance to look into that? (See below.)
>
> Ludovic Courtès <ludo@gnu.org> skribis:
>
> > Hello Myles,
> >
> > Myles English <mylesenglish@gmail.com> skribis:
> >
> >> * gnu/packages/game-development.scm (solvespace): New variable and
>

game-development.scm? I think I put it in the wrong place.

Toggle quote (21 lines)
>> dependencies on gnu package modules.
> >
> > The patch LGTM overall. Here are some comments/questions:
> >
> >> +(define-public solvespace-3
> >> + (let ((commit "5df53fc59e7f31e265fabd4c15e6601bd3032833")
> >> + (revision "1"))
> >> + (package
> >> + (name "solvespace")
> >> + (version (git-version "3.0" revision commit))
> >
> >
> > Why choose this commit specifically? ‘git describe’ returns
> > “v2.1.rc1-570-g5df53fc”, and in fact there’s no “v3.0” tag, so this
> > version string is a bit misleading.
> >
> > The general policy is to use the latest release, but if there’s a
> > compelling argument, we can use another commit; in that case, it’s
> > better to have a comment explaining the choice.
>

It looks as though a longawaited v3.0 release may be imminent, hence my
delay in replying to your advice. I'll wait another week or two before
asking if it is going to drop 'soon'. (I would have tried to justify my
choice by referencing the unofficial Debian package, mentioned on the
project's github page, using the master branch and calling itself v3.0.)

Toggle quote (10 lines)
>> + (uri (git-reference
>
>> + (url "https://github.com/solvespace/solvespace.git")
> >> + (commit commit)
> >> + (recursive? #t)))
> >
> > Is ‘recursive?’ needed? If it’s just for the bundled dependencies under
> > extlib/ that are not used anyway, perhaps we can omit it?
>

Some of them are still used (sorry I can't check which ones just now). I
have trivially modified the build system so that if :recursive? is a list
it only clones those submodules listed. I can find the patch later but its
just a couple of lines. If this is adopted should may be rename
:recursive? or add another parameter?

Toggle quote (12 lines)
>> + (synopsis "Parametric 2D/3D CAD tool")
> >> + (description "Parametric 2D/3D computer aided design (CAD) tool
> and
> >> +constraint-based parametric modeler with simple mechanical simulation
> >> +capabilities.")
> >
> > Could you make it a full sentence and perhaps expound a little bit, as
> > per <
> https://gnu.org/s/guix/manual/en/html_node/Synopses-and-Descriptions.html
> >?
>

I'll try and improve this when I make a patch for the true v3.0.

Myles

Toggle quote (1 lines)
>
Attachment: file
L
L
Ludovic Courtès wrote on 3 Sep 2019 11:19
(name . Myles English)(address . mylesenglish@gmail.com)
87o901ybwl.fsf@gnu.org
Hi Myles,

Myles English <mylesenglish@gmail.com> skribis:

Toggle quote (6 lines)
> It looks as though a longawaited v3.0 release may be imminent, hence my
> delay in replying to your advice. I'll wait another week or two before
> asking if it is going to drop 'soon'. (I would have tried to justify my
> choice by referencing the unofficial Debian package, mentioned on the
> project's github page, using the master branch and calling itself v3.0.)

Sounds good!

Toggle quote (16 lines)
>>> + (uri (git-reference
>>
>>> + (url "https://github.com/solvespace/solvespace.git")
>> >> + (commit commit)
>> >> + (recursive? #t)))
>> >
>> > Is ‘recursive?’ needed? If it’s just for the bundled dependencies under
>> > extlib/ that are not used anyway, perhaps we can omit it?
>>
>
> Some of them are still used (sorry I can't check which ones just now). I
> have trivially modified the build system so that if :recursive? is a list
> it only clones those submodules listed. I can find the patch later but its
> just a couple of lines. If this is adopted should may be rename
> :recursive? or add another parameter?

At first sight I think I’d keep it simple and just keep ‘recursive?’ as
it is. After all, if that fetches too many submodules in this specific
case, that’s not the end of the world and we can always delete them
explicitly afterwards. I think it’s quite unusual to need some but not
all of the submodules.

Thanks,
Ludo’.
?