diff options
author | Profpatsch <mail@profpatsch.de> | 2017-05-31 05:53:29 +0200 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2017-05-31 05:53:29 +0200 |
commit | 0697dd8b8105714a3acecc431954072492a66383 (patch) | |
tree | bfc9237dcdb041cdb5e2e7d54adc51cac0fcb5f1 /pkgs/development/python-modules/rarfile | |
parent | 789bde24088c8b99f5596de271f57691409b7640 (diff) | |
download | nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar.gz nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar.bz2 nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar.lz nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar.xz nixpkgs-0697dd8b8105714a3acecc431954072492a66383.tar.zst nixpkgs-0697dd8b8105714a3acecc431954072492a66383.zip |
pythonPackages.rarfile: use free libarchive by default.
`unrar` is a non-free package, so it should only be used on request. rarfile can use the rar-mode of `libarchive` instead, which should work well enough for most cases.
Diffstat (limited to 'pkgs/development/python-modules/rarfile')
-rw-r--r-- | pkgs/development/python-modules/rarfile/default.nix | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/rarfile/default.nix b/pkgs/development/python-modules/rarfile/default.nix index 183e5a2f1d9..c2c8c926432 100644 --- a/pkgs/development/python-modules/rarfile/default.nix +++ b/pkgs/development/python-modules/rarfile/default.nix @@ -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 { pname = "rarfile"; @@ -15,8 +21,16 @@ buildPythonPackage rec { prePatch = '' 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"; checkPhase = '' py.test test -k "not test_printdir" |