1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-16 12:00:35 +02:00

gnu: python-rarfile: Update to 4.0.

This package is close to useless, because we lack the non-free unrar
utility and the libarchive backend does not support most operations.

* gnu/packages/python-xyz.scm (python-rarfile)[version]: Update to 4.0.
[arguments]: Disable tests.
[propagated-inputs]: Move…
[inputs]: …here.
[native-inputs]: Add pytest.
[#:phases]: Use pytest for 'check and Add 'patch phase.
(python2-rarfile): Remove, unsupported by upstream.
This commit is contained in:
Lars-Dominik Braun 2021-09-03 11:00:24 +02:00
parent 26fe4d77bf
commit e82b103a77
No known key found for this signature in database
GPG key ID: F663943E08D8092A

View file

@ -13910,33 +13910,39 @@ can also be used to get the exact location, font or color of the text.")
(define-public python-rarfile (define-public python-rarfile
(package (package
(name "python-rarfile") (name "python-rarfile")
(version "2.8") (version "4.0")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "rarfile" version)) (uri (pypi-uri "rarfile" version))
(sha256 (sha256
(base32 (base32
"0qfad483kcbga0bn4qmcz953xjk16r52fahiy46zzn56v80y89ra")))) "1882wv9szcm29mnyhjmspyflyr2l7z73srn14w4dlnww49lqfm37"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
'(#:phases `(#:tests? #f ;; The bsdtar utility is very limited and most tests fail.
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'patch
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "rarfile.py"
;; Disable unrar and unar, which are unavailable on Guix.
(("(unrar|unar)=True" all tool) (string-append tool "=False"))
;; Hardcode path to bsdtar
(("\"bsdtar\"")
(string-append "\"" (assoc-ref inputs "libarchive") "/bin/bsdtar\"")))
#t))
(replace 'check (replace 'check
;; Many tests fail, but the installation proceeds. (lambda* (#:key inputs tests? #:allow-other-keys)
(lambda _ (invoke "make" "-C" "test" "test")))))) (when tests?
(native-inputs (invoke "pytest" "-vv")))))))
`(("which" ,which))) ; required for tests (native-inputs `(("python-pytest" ,python-pytest)))
(propagated-inputs (inputs `(("libarchive" ,libarchive)))
`(("libarchive" ,libarchive)))
(home-page "https://github.com/markokr/rarfile") (home-page "https://github.com/markokr/rarfile")
(synopsis "RAR archive reader for Python") (synopsis "RAR archive reader for Python")
(description "This is Python module for RAR archive reading. The interface (description "This is Python module for RAR archive reading. The interface
is made as zipfile like as possible.") is made as zipfile like as possible.")
(license license:isc))) (license license:isc)))
(define-public python2-rarfile
(package-with-python2 python-rarfile))
(define-public python-rich (define-public python-rich
(package (package
(name "python-rich") (name "python-rich")