nixpkgs/pkgs/tools/backup/rdiff-backup/default.nix
Bjørn Forsman bad831d6fe rdiff-backup: unbreak 'rdiff-backup-statistics'
By adding needed module to python sys.path. Fixes this:

  $ rdiff-backup-statistics backup-dir
  Traceback (most recent call last):
    File "/home/bfo/.nix-profile/bin/rdiff-backup-statistics", line 24, in
  <module>
      from rdiff_backup import connection, regress, rpath, Globals,
  restore, \
  ImportError: No module named rdiff_backup
2014-11-23 21:58:46 +01:00

29 lines
970 B
Nix

{stdenv, fetchurl, python, librsync, gnused }:
stdenv.mkDerivation {
name = "rdiff-backup-1.3.3";
src = fetchurl {
url = mirror://savannah/rdiff-backup/rdiff-backup-1.3.3.tar.gz;
sha256 = "01hcwf5rgqi303fa4kdjkbpa7n8mvvh7h9gpgh2b23nz73k0q0zf";
};
phases = "unpackPhase installPhase";
installPhase = ''
python ./setup.py install --prefix=$out
sed -i $out/bin/rdiff-backup -e \
"/import sys/ asys.path += [ \"$out/lib/python2.7/site-packages/\" ]"
sed -i $out/bin/rdiff-backup-statistics -e \
"/import .*sys/ asys.path += [ \"$out/lib/python2.7/site-packages/\" ]"
'';
buildInputs = [ python librsync gnused ];
meta = {
description = "backup system trying to combine best a mirror and an incremental backup system";
homepage = http://rdiff-backup.nongnu.org/;
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
};
}