nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, makeWrapper
2, perl, pandoc, python3, git
3, par2cmdline ? null, par2Support ? true
4}:
5
6assert par2Support -> par2cmdline != null;
7
8let
9 version = "0.33.3";
10
11 pythonDeps = with python3.pkgs; [ setuptools tornado ]
12 ++ lib.optionals (!stdenv.isDarwin) [ pyxattr pylibacl fuse ];
13in
14
15stdenv.mkDerivation {
16 pname = "bup";
17 inherit version;
18
19 src = fetchFromGitHub {
20 repo = "bup";
21 owner = "bup";
22 rev = version;
23 hash = "sha256-w7yPs7hG4v0Kd9i2tYhWH7vW95MAMfI/8g61MB6bfps=";
24 };
25
26 buildInputs = [ git python3 ];
27 nativeBuildInputs = [ pandoc perl makeWrapper ];
28
29 postPatch = "patchShebangs .";
30
31 dontAddPrefix = true;
32
33 makeFlags = [
34 "MANDIR=$(out)/share/man"
35 "DOCDIR=$(out)/share/doc/bup"
36 "BINDIR=$(out)/bin"
37 "LIBDIR=$(out)/lib/bup"
38 ];
39
40 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration -Wno-error=implicit-int";
41
42 postInstall = ''
43 wrapProgram $out/bin/bup \
44 --prefix PATH : ${lib.makeBinPath [ git par2cmdline ]} \
45 --prefix NIX_PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages pythonDeps}
46 '';
47
48 meta = with lib; {
49 homepage = "https://github.com/bup/bup";
50 description = "Efficient file backup system based on the git packfile format";
51 mainProgram = "bup";
52 license = licenses.gpl2Plus;
53
54 longDescription = ''
55 Highly efficient file backup system based on the git packfile format.
56 Capable of doing *fast* incremental backups of virtual machine images.
57 '';
58
59 platforms = platforms.linux ++ platforms.darwin;
60 maintainers = with maintainers; [ rnhmjoj ];
61 };
62}