gnu: python-chardet: Trim closure size.

* gnu/packages/python-xyz.scm (python-chardet)[arguments]: Override wrap phase.
This commit is contained in:
Marius Bakke 2022-02-04 10:21:40 +01:00
parent 6ec96228ba
commit aad0b91c37
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -13082,7 +13082,27 @@ (define-public python-chardet
(list python-hypothesis python-pytest python-pytest-runner)) (list python-hypothesis python-pytest python-pytest-runner))
(build-system python-build-system) (build-system python-build-system)
;; XXX: Incompatible with Pytest 4: <https://github.com/chardet/chardet/issues/173>. ;; XXX: Incompatible with Pytest 4: <https://github.com/chardet/chardet/issues/173>.
(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 <https://bugs.gnu.org/25235>.)
(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") (home-page "https://github.com/chardet/chardet")
(synopsis "Universal encoding detector for Python 2 and 3") (synopsis "Universal encoding detector for Python 2 and 3")
(description (description