1 { lib, stdenv, fetchFromGitHub
2 , autoreconfHook, pkg-config, docbook_xsl, libxslt, docbook_xml_dtd_45
3 , acl, attr, boost, btrfs-progs, dbus, diffutils, e2fsprogs, libxml2
4 , lvm2, pam, python, util-linux, fetchpatch, json_c, nixosTests
7 stdenv.mkDerivation rec {
11 src = fetchFromGitHub {
15 sha256 = "1rqv1qfxr02qbkix1mpx91s4827irxryxkhby3ii0fdkm3ympsas";
19 autoreconfHook pkg-config
20 docbook_xsl libxslt docbook_xml_dtd_45
23 acl attr boost btrfs-progs dbus diffutils e2fsprogs libxml2
24 lvm2 pam python util-linux json_c ncurses
27 passthru.tests.snapper = nixosTests.snapper;
30 # Don't use etc/dbus-1/system.d
32 url = "https://github.com/openSUSE/snapper/commit/c51708aea22d9436da287cba84424557ad03644b.patch";
33 sha256 = "106pf7pv8z3q37c8ckmgwxs1phf2fy7l53a9g5xq5kk2rjj1cx34";
38 # Hard-coded root paths, hard-coded root paths everywhere...
39 for file in {client,data,pam,scripts,zypp-plugin}/Makefile.am; do
40 substituteInPlace $file \
41 --replace '$(DESTDIR)/usr' "$out" \
42 --replace "DESTDIR" "out" \
43 --replace "/usr" "$out"
45 substituteInPlace pam/Makefile.am \
46 --replace '/`basename $(libdir)`' "$out/lib"
50 "--disable-ext4" # requires patched kernel & e2fsprogs
53 enableParallelBuilding = true;
55 NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
59 patchShebangs $out/lib/zypp/plugins/commit/*
61 $out/lib/pam_snapper/* \
62 $out/lib/systemd/system/* \
63 $out/share/dbus-1/system-services/* \
65 substituteInPlace $file --replace "/usr" "$out"
70 description = "Tool for Linux filesystem snapshot management";
71 homepage = "http://snapper.io";
72 license = licenses.gpl2Only;
73 platforms = platforms.linux;
74 maintainers = with maintainers; [ tstrobel markuskowa ];