summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Smith <Morgan.J.Smith@outlook.com>2023-05-10 13:46:20 -0400
committerLudovic Courtès <ludo@gnu.org>2023-05-18 19:38:35 +0200
commitc95e817bb986c49fd0d2a8896c2e63782f05a7f7 (patch)
tree81e178ed737fce48a69b9f33d4942b48edb9a5e8
parent3b4a31d52c9adf919830f13cb01cbbeeeebea87c (diff)
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>
-rw-r--r--gnu/packages/engineering.scm10
1 files changed, 10 insertions, 0 deletions
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")