From 04365b11c2e078a2e6fe7990737127951db1923f Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Tue, 6 Jan 2026 14:05:57 +0100 Subject: [PATCH] gnu: gemmi: Switch to pyproject. * gnu/packages/chemistry.scm (gemmi): [arguments]<#:imported-modules, #:modules, #:phases>: Switch to pyproject-build-system. Change-Id: Id2bd46050b2820945d5a9d90e17e1c5d1e61c40e Signed-off-by: Sharlatan Hellseher Signed-off-by: Rutherther --- gnu/packages/chemistry.scm | 89 +++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index 7d158522079d3e20a3ad88a5eb7b54a057848bc3..e79830143068ea615ded4758c9f128d872555b58 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -1049,56 +1049,57 @@ integrals for Gaussian type functions.") (build-system cmake-build-system) (arguments (list - #:modules '((guix build cmake-build-system) - (guix build utils) - ((guix build python-build-system) - #:select (site-packages))) #:imported-modules (append %cmake-build-system-modules - '((guix build python-build-system))) + %pyproject-build-system-modules) + #:modules + '((guix build cmake-build-system) + (guix build utils) + ((guix build pyproject-build-system) #:select (site-packages))) #:configure-flags #~(list "-DUSE_PYTHON=ON" (string-append "-DPYTHON_INSTALL_DIR=" (site-packages %build-inputs %outputs))) #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'patch-includes - (lambda _ - (substitute* (list "src/json.cpp" - "src/sprintf.cpp" - "include/gemmi/dirwalk.hpp" - "include/gemmi/cif.hpp" - "include/gemmi/json.hpp" - "python/gemmi.cpp" - "python/serial.h" - "include/gemmi/atof.hpp" - "include/gemmi/numb.hpp" - "include/gemmi/fourier.hpp") - (("") "") - (("\"third_party/tinydir.h\"") "") - (("\"third_party/tao/pegtl.hpp\"") "") - (("\"\\.\\./third_party/sajson.h\"") "") - (("\"gemmi/third_party/tao/pegtl/parse_error.hpp\"") - "") - (("\"third_party/fast_float.h\"") - "") - (("\"third_party/pocketfft_hdronly.h\"") - "") - (("\"\\.\\./third_party/serializer.h\"") - "")))) - (add-after 'unpack 'change-bin-prefix - (lambda _ - (substitute* "CMakeLists.txt" - (("install\\(TARGETS program DESTINATION bin\\)") - (string-append - "install(TARGETS program DESTINATION " - #$output:bin "/bin)"))))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (with-directory-excursion "../source" - (setenv "PYTHONPATH" "../build/py") - (invoke "python3" "-m" "unittest" "discover" "-v" - "-s" "tests")))))))) + (with-extensions (list (pyproject-guile-json)) + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-includes + (lambda _ + (substitute* (list "src/json.cpp" + "src/sprintf.cpp" + "include/gemmi/dirwalk.hpp" + "include/gemmi/cif.hpp" + "include/gemmi/json.hpp" + "python/gemmi.cpp" + "python/serial.h" + "include/gemmi/atof.hpp" + "include/gemmi/numb.hpp" + "include/gemmi/fourier.hpp") + (("") "") + (("\"third_party/tinydir.h\"") "") + (("\"third_party/tao/pegtl.hpp\"") "") + (("\"\\.\\./third_party/sajson.h\"") "") + (("\"gemmi/third_party/tao/pegtl/parse_error.hpp\"") + "") + (("\"third_party/fast_float.h\"") + "") + (("\"third_party/pocketfft_hdronly.h\"") + "") + (("\"\\.\\./third_party/serializer.h\"") + "")))) + (add-after 'unpack 'change-bin-prefix + (lambda _ + (substitute* "CMakeLists.txt" + (("install\\(TARGETS program DESTINATION bin\\)") + (string-append + "install(TARGETS program DESTINATION " + #$output:bin "/bin)"))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "../source" + (setenv "PYTHONPATH" "../build/py") + (invoke "python3" "-m" "unittest" "discover" "-v" + "-s" "tests"))))))))) (inputs (list python zlib)) (native-inputs (list fast-float