From 110dd35a88cc0e95e4401d0af9cf8b97736464d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Tue, 6 Jan 2026 11:02:41 +0100 Subject: [PATCH] gnu: python-numpy: Reduce closure size through custom wrap phase * gnu/packages/python-xyz.scm (python-numpy) [arguments] : Provide custom 'wrap phase. Change-Id: Iab5bbee198796b61364fc3116a748e0e71b79148 Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-xyz.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 878a1f755e0..5bcdb6bf1e5 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -10968,7 +10968,21 @@ include_dirs = ~:*~a/include~%" #$(this-package-input "openblas")))))) (lambda* (#:key tests? test-flags #:allow-other-keys) (when tests? (with-directory-excursion #$output - (apply invoke "pytest" test-flags)))))))) + (apply invoke "pytest" test-flags))))) + ;; The executables provided by this package ('f2py' and 'numpy-config') + ;; only depend on Python. By customizing the wrap phase we can ensure + ;; that we don't add all Python packages listed in native-inputs to + ;; the closure. This significantly reduces the overall closure size. + ;; + ;; See also . + (replace 'wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each + (lambda (program) + (wrap-program program + `("GUIX_PYTHONPATH" ":" suffix + ,(list (site-packages inputs outputs))))) + (find-files (in-vicinity #$output "/bin")))))))) (native-inputs (list gfortran meson-python