@@ -1,5 +1,7 @@
1−{ stdenv, fetchzip, fetchurl, python, pyxattr, pylibacl, setuptools
2−, fuse, git, perl, pandoc, makeWrapper, par2cmdline, par2Support ? false }:
1+{ stdenv, fetchFromGitHub, fetchurl, makeWrapper
2+, perl, pandoc, pythonPackages, git
3+, par2cmdline ? null, par2Support ? false
4+}:
35
46assert par2Support -> par2cmdline != null;
57
@@ -10,27 +12,28 @@ with stdenv.lib;
1012stdenv.mkDerivation rec {
1113 name = "bup-${version}";
1214
13− src = fetchzip {
14− url = "https://github.com/bup/bup/archive/${version}.tar.gz";
15+ src = fetchFromGitHub {
16+ repo = "bup";
17+ owner = "bup";
18+ rev = version;
1519 sha256 = "0g7b0xl3kg0z6rn81fvzl1xnvva305i7pjih2hm68mcj0adk3v0d";
1620 };
1721
18− buildInputs = [ python git ];
22+ buildInputs = [ git pythonPackages.python ];
1923 nativeBuildInputs = [ pandoc perl makeWrapper ];
2024
21− darwin_10_10_patch = fetchurl {
25+ patches = optional stdenv.isDarwin (fetchurl {
2226 url = "https://github.com/bup/bup/commit/75d089e7cdb7a7eb4d69c352f56dad5ad3aa1f97.diff";
2327 sha256 = "05kp47p30a45ip0fg090vijvzc7ijr0alc3y8kjl6bvv3gliails";
24− };
28+ name = "darwin_10_10.patch";
29+ });
2530
2631 postPatch = ''
2732 patchShebangs .
2833 substituteInPlace Makefile --replace "-Werror" ""
29− substituteInPlace Makefile --replace "./format-subst.pl" "perl ./format-subst.pl"
34+ substituteInPlace Makefile --replace "./format-subst.pl" "${perl}/bin/perl ./format-subst.pl"
3035 '' + optionalString par2Support ''
3136 substituteInPlace cmd/fsck-cmd.py --replace "['par2'" "['${par2cmdline}/bin/par2'"
32− '' + optionalString (elem stdenv.system platforms.darwin) ''
33− patch -p1 < ${darwin_10_10_patch}
3437 '';
3538
3639 dontAddPrefix = true;
@@ -42,24 +45,24 @@ stdenv.mkDerivation rec {
4245 "LIBDIR=$(out)/lib/bup"
4346 ];
4447
45− postInstall = ''wrapProgram $out/bin/bup --prefix PATH : ${git}/bin ''
46− + optionalString (elem stdenv.system platforms.linux) '' --prefix PYTHONPATH : \
47− ${stdenv.lib.concatStringsSep ":"
48− (map (path: "$(toPythonPath ${path})") [ pyxattr pylibacl setuptools fuse ])}
48+ postInstall = ''
49+ wrapProgram $out/bin/bup \
50+ --prefix PATH : ${git}/bin \
51+ --prefix PYTHONPATH : ${concatStringsSep ":" (map (x: "$(toPythonPath ${x})")
52+ (with pythonPackages; [ pyxattr pylibacl setuptools fuse tornado ]))}
4953 '';
5054
5155 meta = {
5256 homepage = "https://github.com/bup/bup";
53− description = "efficient file backup system based on the git packfile format";
54− license = stdenv.lib.licenses.gpl2Plus;
57+ description = "Efficient file backup system based on the git packfile format";
58+ license = licenses.gpl2Plus;
5559
5660 longDescription = ''
5761 Highly efficient file backup system based on the git packfile format.
5862 Capable of doing *fast* incremental backups of virtual machine images.
5963 '';
6064
61− hydraPlatforms = stdenv.lib.platforms.linux;
62− maintainers = with stdenv.lib.maintainers; [ muflax ];
63−
65+ hydraPlatforms = platforms.linux;
66+ maintainers = with maintainers; [ muflax ];
6467 };
6568}