guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/15: gnu: libfive: Generate bindings instead of using pre-generated on


From: guix-commits
Subject: 05/15: gnu: libfive: Generate bindings instead of using pre-generated ones.
Date: Thu, 18 May 2023 14:07:08 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit c95e817bb986c49fd0d2a8896c2e63782f05a7f7
Author: Morgan Smith <Morgan.J.Smith@outlook.com>
AuthorDate: Wed May 10 13:46:20 2023 -0400

    gnu: libfive: Generate bindings instead of using pre-generated ones.
    
    * gnu/packages/engineering.scm (libfive)[phases]: Add phase 
'generate-bindings
    to generate the bindings
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/engineering.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index c2767234fd..91d20c9e3b 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -941,6 +941,16 @@ fonts to gEDA.")
                 (substitute* "libfive/bind/python/libfive/ffi.py"
                   (("os.environ.get\\('LIBFIVE_FRAMEWORK_DIR'\\)" m)
                    (string-append m " or \"" #$output "/lib/\"")))))
+            (add-before 'build 'generate-bindings
+              (lambda _
+                ;; These files already exist but we regenerate them from source
+                (with-directory-excursion "../source/libfive/stdlib"
+                  (substitute* '("gen_scm.py" "gen_c.py" "gen_py.py")
+                    (("datetime.now\\(\\)\\.strftime\\([^)]+)") "\"N/A\"")
+                    (("os\\.getlogin\\(\\)") "\"guix\""))
+                  (invoke "python" "gen_scm.py")
+                  (invoke "python" "gen_c.py")
+                  (invoke "python" "gen_py.py"))))
             (add-after 'unpack 'do-not-build-guile-bindings
               (lambda _
                 (delete-file "libfive/bind/guile/CMakeLists.txt")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]