1 { lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, nose, libarchive, glibcLocales, isPy27
2 # unrar is non-free software
3 , useUnrar ? false, unrar
6 assert useUnrar -> unrar != null;
7 assert !useUnrar -> libarchive != null;
9 buildPythonPackage rec {
12 format = "setuptools";
15 src = fetchFromGitHub {
18 rev = "refs/tags/v${version}";
19 sha256 = "sha256-ZiwD2LG25fMd4Z+QWsh/x3ceG5QRBH4s/TZDwMnfpNI=";
22 nativeCheckInputs = [ pytestCheckHook nose glibcLocales ];
25 substituteInPlace rarfile.py \
26 '' + (if useUnrar then
27 ''--replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\""
30 ''--replace 'ALT_TOOL = "bsdtar"' "ALT_TOOL = \"${libarchive}/bin/bsdtar\""
33 # the tests only work with the standard unrar package
35 LC_ALL = "en_US.UTF-8";
36 pythonImportsCheck = [ "rarfile" ];
39 description = "RAR archive reader for Python";
40 homepage = "https://github.com/markokr/rarfile";
41 license = licenses.isc;