From c95e817bb986c49fd0d2a8896c2e63782f05a7f7 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Wed, 10 May 2023 13:46:20 -0400 Subject: gnu: libfive: Generate bindings instead of using pre-generated ones. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/engineering.scm (libfive)[phases]: Add phase 'generate-bindings to generate the bindings Signed-off-by: Ludovic Courtès --- 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") -- cgit 1.4.1