bup: optionally depend on par2cmdline

The default is to use it from path when available, as this is an
optional feature.
This commit is contained in:
Mathijs Kwik 2013-01-06 18:15:04 +01:00
parent c7f30ac377
commit fbeb84b288
2 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,7 @@
{ stdenv, fetchgit, python, pyxattr, pylibacl, setuptools, fuse, git, perl, pandoc, makeWrapper }:
{ stdenv, fetchgit, python, pyxattr, pylibacl, setuptools, fuse, git, perl, pandoc, makeWrapper
, par2cmdline, par2Support ? false }:
assert par2Support -> par2cmdline != null;
with stdenv.lib;
@ -26,6 +29,8 @@ stdenv.mkDerivation {
substituteInPlace $f --replace "/usr/bin/env python" "${python}/bin/python"
done
substituteInPlace Makefile --replace "./format-subst.pl" "perl ./format-subst.pl"
'' + optionalString par2Support ''
substituteInPlace cmd/fsck-cmd.py --replace "['par2'" "['${par2cmdline}/bin/par2'"
'';
makeFlags = [

View File

@ -513,6 +513,7 @@ let
bup = callPackage ../tools/backup/bup {
inherit (pythonPackages) pyxattr pylibacl setuptools fuse;
inherit (haskellPackages) pandoc;
par2Support = (config.bup.par2Support or false);
};
atool = callPackage ../tools/archivers/atool { };