From aad0b91c370e2159e2c23d34950cdd5b40ae1636 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 4 Feb 2022 10:21:40 +0100 Subject: gnu: python-chardet: Trim closure size. * gnu/packages/python-xyz.scm (python-chardet)[arguments]: Override wrap phase. --- gnu/packages/python-xyz.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 88f7af2c1b..88edd7de3e 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -13082,7 +13082,27 @@ simulation, statistical modeling, machine learning and much more.") (list python-hypothesis python-pytest python-pytest-runner)) (build-system python-build-system) ;; XXX: Incompatible with Pytest 4: . - (arguments `(#:tests? #f)) + (arguments + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + ;; This package provides a 'chardetect' executable that only + ;; depends on Python, so customize the wrap phase to avoid + ;; adding pytest and friends in order to save size. + ;; (See also .) + (replace 'wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((sitedir (site-packages inputs outputs)) + (python (dirname (dirname + (search-input-file + inputs "bin/python")))) + (python-sitedir + (string-append python "/lib/python" + (python-version python) + "/site-packages"))) + (wrap-program (string-append #$output "/bin/chardetect") + `("GUIX_PYTHONPATH" ":" suffix + ,(list sitedir python-sitedir))))))))) (home-page "https://github.com/chardet/chardet") (synopsis "Universal encoding detector for Python 2 and 3") (description -- cgit v1.2.3