9 # unrar is non-free software
14 assert useUnrar -> unrar != null;
15 assert !useUnrar -> libarchive != null;
17 buildPythonPackage rec {
22 disabled = pythonOlder "3.6";
24 src = fetchFromGitHub {
27 rev = "refs/tags/v${version}";
28 hash = "sha256-ZiwD2LG25fMd4Z+QWsh/x3ceG5QRBH4s/TZDwMnfpNI=";
33 substituteInPlace rarfile.py \
38 --replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\""
42 --replace 'ALT_TOOL = "bsdtar"' "ALT_TOOL = \"${libarchive}/bin/bsdtar\""
47 build-system = [ setuptools ];
49 nativeCheckInputs = [ pytestCheckHook ];
51 # The tests only work with the standard unrar package
54 pythonImportsCheck = [ "rarfile" ];
57 description = "RAR archive reader for Python";
58 homepage = "https://github.com/markokr/rarfile";
59 changelog = "https://github.com/markokr/rarfile/releases/tag/v${version}";
60 license = licenses.isc;