gnu: python-numpy: Reduce closure size through custom wrap phase

* gnu/packages/python-xyz.scm (python-numpy)
[arguments] <phases>: Provide custom 'wrap phase.

Change-Id: Iab5bbee198796b61364fc3116a748e0e71b79148
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Sören Tempel 2026-01-06 11:02:41 +01:00 committed by Sharlatan Hellseher
parent 618155f79d
commit 110dd35a88
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -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 <https://bugs.gnu.org/25235>.
(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