Merge pull request #26268 from Profpatsch/rarfile-unrar-libarchive
pythonPackages.rarfile: use free libarchive by default.
This commit is contained in:
commit
3488c65b2b
@ -1,4 +1,10 @@
|
|||||||
{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, nose, unrar, glibcLocales }:
|
{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, nose, libarchive, glibcLocales
|
||||||
|
# unrar is non-free software
|
||||||
|
, useUnrar ? false, unrar
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert useUnrar -> unrar != null;
|
||||||
|
assert !useUnrar -> libarchive != null;
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "rarfile";
|
pname = "rarfile";
|
||||||
@ -15,8 +21,16 @@ buildPythonPackage rec {
|
|||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
substituteInPlace rarfile.py \
|
substituteInPlace rarfile.py \
|
||||||
--replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\""
|
'' + (if useUnrar then
|
||||||
'';
|
''--replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\""
|
||||||
|
''
|
||||||
|
else
|
||||||
|
''--replace 'ALT_TOOL = "bsdtar"' "ALT_TOOL = \"${libarchive}/bin/bsdtar\""
|
||||||
|
'')
|
||||||
|
+ ''
|
||||||
|
'';
|
||||||
|
# the tests only work with the standard unrar package
|
||||||
|
doCheck = useUnrar;
|
||||||
LC_ALL = "en_US.UTF-8";
|
LC_ALL = "en_US.UTF-8";
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
py.test test -k "not test_printdir"
|
py.test test -k "not test_printdir"
|
||||||
|
@ -2605,7 +2605,7 @@ in {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rarfile = callPackage ../development/python-modules/rarfile {};
|
rarfile = callPackage ../development/python-modules/rarfile { inherit (pkgs) libarchive; };
|
||||||
|
|
||||||
proboscis = buildPythonPackage rec {
|
proboscis = buildPythonPackage rec {
|
||||||
name = "proboscis-1.2.6.0";
|
name = "proboscis-1.2.6.0";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user