@ -1,16 +1,16 @@
{ stdenv , fetchFromGitHub
, autoreconfHook , pkgconfig , docbook_xsl , libxslt , docbook_xml_dtd_45
, acl , attr , boost , btrfs-progs , dbus_libs , diffutils , e2fsprogs , libxml2
, lvm2 , pam , utillinux } :
, lvm2 , pam , python , utillinux } :
stdenv . mkDerivation rec {
name = " s n a p p e r - ${ ver } " ;
ver = " 0 . 2 . 8 " ;
name = " s n a p p e r - ${ version } " ;
version = " 0 . 2 . 8 " ;
src = fetchFromGitHub {
owner = " o p e n S U S E " ;
repo = " s n a p p e r " ;
rev = " v ${ ver } " ;
rev = " v ${ version } " ;
sha256 = " 1 r j 8 v y 6 h q 1 4 0 p b n c 7 m j j b 3 4 m f q d g d a h 1 d m l v 2 0 7 3 i z d g a k h 7 p 3 8 j " ;
} ;
@ -20,33 +20,48 @@ stdenv.mkDerivation rec {
] ;
buildInputs = [
acl attr boost btrfs-progs dbus_libs diffutils e2fsprogs libxml2
lvm2 pam utillinux
lvm2 pam python utillinux
] ;
patchPhase = ''
# work around missing btrfs/version.h; otherwise, use "-DHAVE_BTRFS_VERSION_H"
substituteInPlace snapper/Btrfs.cc - - replace " d e f i n e B T R F S _ L I B _ V E R S I O N ( 1 0 0 ) " " d e f i n e B T R F S _ L I B _ V E R S I O N ( 2 0 0 ) " ;
postPatch = ''
# Hard-coded root paths, hard-coded root paths everywhere...
for file in { client , data , pam , scripts } /Makefile.am ; do
substituteInPlace $ file \
- - replace ' $ ( DESTDIR ) /usr ' " $ o u t " \
- - replace " D E S T D I R " " o u t " \
- - replace " / u s r " " $ o u t "
done
substituteInPlace pam/Makefile.am \
- - replace ' / ` basename $ ( libdir ) ` ' " $ o u t / l i b "
'' ;
configurePhase = ''
./configure - - disable-silent-rules - - disable-ext4 - - disable-btrfs-quota - - prefix = $ out
'' ;
configureFlags = [
" - - d i s a b l e - e x t 4 " # requires patched kernel & e2fsprogs
] ;
makeFlags = " D E S T D I R = $ ( o u t ) " ;
enableParallelBuilding = true ;
NIX_CFLAGS_COMPILE = [ " - I ${ libxml2 } / i n c l u d e / l i b x m l 2 " ] ;
NIX_CFLAGS_COMPILE = [
" - I ${ libxml2 } / i n c l u d e / l i b x m l 2 "
] ;
# Probably a hack, but using DESTDIR and PREFIX makes everything work!
postInstall = ''
cp - r $ out / $ out /* $ o u t
rm - r $ out/nix
'' ;
rm - r $ out/etc/cron. *
patchShebangs $ out/lib/zypp/plugins/commit /*
for file in \
$ out/lib/pam_snapper /* \
$ out/lib/systemd/system /* \
$ out/share/dbus-1/system-services /* \
; do
substituteInPlace $ file - - replace " / u s r " " $ o u t "
done
'' ;
meta = with stdenv . lib ; {
description = " T o o l f o r L i n u x f i l e s y s t e m s n a p s h o t m a n a g e m e n t " ;
homepage = http://snapper.io ;
license = licenses . gpl2 ;
platforms = platforms . linux ;
maintainers = [ maintainers . tstrobel ] ;
maintainers = with maintainers ; [ nckx tstrobel ] ;
} ;
}