unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#63422] [PATCH 0/3] gnu: libfive: Fixes
@ 2023-05-10 17:17 Morgan.J.Smith
  2023-05-10 17:46 ` [bug#63422] [PATCH 1/3] gnu: libfive: Fix install and wrap Studio Morgan Smith
  2023-05-18 17:50 ` bug#63422: [PATCH 0/3] gnu: libfive: Fixes Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Morgan.J.Smith @ 2023-05-10 17:17 UTC (permalink / raw)
  To: 63422

[PATCH 1/3] gnu: libfive: Fix install and wrap Studio.
[PATCH 2/3] gnu: libfive: Add Python bindings.
[PATCH 3/3] gnu: libfive: Generate bindings instead of using





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

* [bug#63422] [PATCH 1/3] gnu: libfive: Fix install and wrap Studio.
  2023-05-10 17:17 [bug#63422] [PATCH 0/3] gnu: libfive: Fixes Morgan.J.Smith
@ 2023-05-10 17:46 ` Morgan Smith
  2023-05-18 17:50 ` bug#63422: [PATCH 0/3] gnu: libfive: Fixes Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Morgan Smith @ 2023-05-10 17:46 UTC (permalink / raw)
  To: 63422

The old install phase didn't handle nested directories (which there are) and
the cmake files didn't seem to install the go files in a way that guile would
use so I just used the guile build system instead.

Also Studio works much better when it know where the libraries are.

* gnu/packages/engineering.scm (libfive)
[imported-modules]: Add (guix build guile-build-system).
[modules]: Add (guix build guile-build-system).
[configure-flags]: Remove.
[phases]: Remove phases 'fix-autocompilation and 'install-scm-files.  Add
phase 'do-not-build-guile-bindings and add phase 'guile-build which uses the
guile build system.  Add wrap-studio phase.
[inputs]: Add bash-minimal for the wrapper.  Use qtbase instead of qtbase-5
---
 gnu/packages/engineering.scm | 47 ++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index a8261dfbc1..1f7fdf942f 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -20,7 +20,7 @@
 ;;; Copyright © 2020, 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego@posteo.net>
-;;; Copyright © 2020, 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2020, 2021, 2023 Morgan Smith <Morgan.J.Smith@outlook.com>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
 ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
 ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
@@ -908,17 +908,21 @@ (define-public libfive
       (build-system cmake-build-system)
       (arguments
        (list
+        #:imported-modules `((guix build guile-build-system)
+                             ,@%cmake-build-system-modules)
+        #:modules '((guix build cmake-build-system)
+                    ((guix build guile-build-system) #:prefix guile:)
+                    (guix build utils))
         #:test-target "libfive-test"
-        #:configure-flags
-        #~(list (string-append "-DGUILE_CCACHE_DIR="
-                               #$output "/lib/guile/3.0/site-ccache"))
         #:phases
         #~(modify-phases %standard-phases
-            (add-after 'unpack 'fix-autocompilation
-              (lambda _ (setenv "HOME" "/tmp")))
             (add-after 'unpack 'remove-native-compilation
               (lambda _
                 (substitute* "CMakeLists.txt" (("-march=native") ""))))
+            (add-after 'unpack 'remove-environment-variable-override
+              (lambda _
+                (substitute* "studio/src/guile/interpreter.cpp"
+                  (("qputenv\\(\"GUILE_LOAD_COMPILED_PATH\".*") ""))))
             (add-after 'unpack 'fix-library-location
               (lambda _
                 (substitute* "libfive/bind/guile/libfive/lib.scm"
@@ -926,19 +930,32 @@ (define-public libfive
                    (string-append m "\n\"" #$output "/lib/\""))
                   (("\\(get-environment-variable \"LIBFIVE_STDLIB_DIR\"\\)" m)
                    (string-append m "\n\"" #$output "/lib/\"")))))
-            (add-after 'install 'install-scm-files
+            (add-after 'unpack 'do-not-build-guile-bindings
+              (lambda _
+                (delete-file "libfive/bind/guile/CMakeLists.txt")
+                (call-with-output-file
+                    "libfive/bind/guile/CMakeLists.txt"
+                  (lambda (port)
+                    (display "add_custom_target(libfive-guile)\n" port)))))
+            (add-after 'build 'guile-build
+              (lambda args
+                (apply (assoc-ref guile:%standard-phases 'build)
+                       #:source-directory "../source/libfive/bind/guile"
+                       args)))
+            (add-after 'install 'wrap-studio
               (lambda _
-                (for-each
-                 (lambda (file)
-                   (install-file file
-                                 (string-append #$output
-                                                "/share/guile/site/3.0/libfive")))
-                 (find-files "../source/libfive/bind/guile/libfive"
-                             "\\.scm$")))))))
+                (let* ((effective-version (guile:target-guile-effective-version))
+                       (scm (string-append #$output "/share/guile/site/"
+                                           effective-version))
+                       (go (string-append #$output "/lib/guile/"
+                                          effective-version "/site-ccache")))
+                  (wrap-program (string-append #$output "/bin/Studio")
+                    `("GUILE_LOAD_PATH" ":" prefix (,scm))
+                    `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go)))))))))
       (native-inputs
        (list pkg-config))
       (inputs
-       (list boost libpng qtbase-5 eigen guile-3.0))
+       (list boost libpng qtbase eigen guile-3.0 bash-minimal))
       (home-page "https://libfive.com")
       (synopsis "Tool for programmatic computer-aided design")
       (description

base-commit: e0c35d1578c10a8fe27c8372f3a8bb5dd88b01b8
-- 
2.39.2





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

* bug#63422: [PATCH 0/3] gnu: libfive: Fixes
  2023-05-10 17:17 [bug#63422] [PATCH 0/3] gnu: libfive: Fixes Morgan.J.Smith
  2023-05-10 17:46 ` [bug#63422] [PATCH 1/3] gnu: libfive: Fix install and wrap Studio Morgan Smith
@ 2023-05-18 17:50 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2023-05-18 17:50 UTC (permalink / raw)
  To: Morgan.J.Smith; +Cc: 63422-done

Hi,

Morgan.J.Smith@outlook.com skribis:

> [PATCH 1/3] gnu: libfive: Fix install and wrap Studio.
> [PATCH 2/3] gnu: libfive: Add Python bindings.
> [PATCH 3/3] gnu: libfive: Generate bindings instead of using

Applied, thanks!

Ludo’.




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

end of thread, other threads:[~2023-05-18 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 17:17 [bug#63422] [PATCH 0/3] gnu: libfive: Fixes Morgan.J.Smith
2023-05-10 17:46 ` [bug#63422] [PATCH 1/3] gnu: libfive: Fix install and wrap Studio Morgan Smith
2023-05-18 17:50 ` bug#63422: [PATCH 0/3] gnu: libfive: Fixes Ludovic Courtès

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).