2016-10-18 21:42:01 +01:00
{ stdenv , fetchurl , fuse , bison , flex_2_5_35 , openssl , python2 , ncurses , readline ,
2015-06-14 09:23:42 +01:00
autoconf , automake , libtool , pkgconfig , zlib , libaio , libxml2 , acl , sqlite
2017-01-05 09:02:33 +00:00
, liburcu , attr , makeWrapper , coreutils , gnused , gnugrep , which
2015-06-14 09:23:42 +01:00
} :
2017-05-14 18:18:07 +01:00
let
2017-03-09 14:37:37 +00:00
s =
2012-12-04 17:54:03 +00:00
rec {
baseName = " g l u s t e r f s " ;
2017-04-08 17:37:03 +01:00
version = " 3 . 1 0 . 1 " ;
2013-10-20 18:10:25 +01:00
name = " ${ baseName } - ${ version } " ;
2017-05-14 18:18:07 +01:00
url = " h t t p s : / / g i t h u b . c o m / g l u s t e r / g l u s t e r f s / a r c h i v e / v ${ version } . t a r . g z " ;
sha256 = " 0 g m b 3 m 9 8 d j l j c y c j g g i 1 q v 9 9 a i 6 k 4 c v n 2 r q y m 2 q 9 f 5 8 q 8 n 8 k d h h 7 " ;
2012-12-04 17:54:03 +00:00
} ;
buildInputs = [
2016-10-18 21:42:01 +01:00
fuse bison flex_2_5_35 openssl python2 ncurses readline
2014-11-02 20:24:51 +00:00
autoconf automake libtool pkgconfig zlib libaio libxml2
2017-01-05 09:02:33 +00:00
acl sqlite liburcu attr makeWrapper
2009-08-31 10:52:01 +01:00
] ;
2015-07-01 07:54:42 +01:00
# Some of the headers reference acl
propagatedBuildInputs = [
acl
] ;
2009-08-31 10:52:01 +01:00
in
2012-12-04 17:54:03 +00:00
stdenv . mkDerivation
2009-08-31 10:52:01 +01:00
rec {
2012-12-04 17:54:03 +00:00
inherit ( s ) name version ;
2015-07-01 07:54:42 +01:00
inherit buildInputs propagatedBuildInputs ;
2014-12-18 10:20:03 +00:00
2017-05-14 18:18:07 +01:00
# Note that the VERSION file is something that is present in release tarballs
# but not in git tags (at least not as of writing in v3.10.1).
# That's why we have to create it.
# Without this, gluster (at least 3.10.1) will fail very late and cryptically,
# for example when setting up geo-replication, with a message like
# Staging of operation 'Volume Geo-replication Create' failed on localhost : Unable to fetch master volume details. Please check the master cluster and master volume.
# What happens here is that the gverify.sh script tries to compare the versions,
# but fails when the version is empty.
# See upstream GlusterFS bug https://bugzilla.redhat.com/show_bug.cgi?id=1452705
preConfigure = ''
echo " v ${ s . version } " > VERSION
2014-06-23 15:12:10 +01:00
./autogen.sh
'' ;
2014-12-18 10:20:03 +00:00
2009-08-31 10:52:01 +01:00
configureFlags = [
2017-01-05 09:02:33 +00:00
'' - - l o c a l s t a t e d i r = / v a r ''
2009-08-31 10:52:01 +01:00
] ;
2014-12-18 10:20:03 +00:00
makeFlags = " D E S T D I R = $ ( o u t ) " ;
postInstall = ''
cp - r $ out / $ out /* $ o u t
rm - r $ out/nix
2017-01-05 09:02:33 +00:00
wrapProgram $ out/sbin/mount.glusterfs - - set PATH " ${ stdenv . lib . makeBinPath [ coreutils gnused attr gnugrep which ] } "
2014-12-18 10:20:03 +00:00
'' ;
2012-12-04 17:54:03 +00:00
src = fetchurl {
inherit ( s ) url sha256 ;
} ;
2009-08-31 10:52:01 +01:00
meta = {
2012-12-04 17:54:03 +00:00
inherit ( s ) version ;
2009-08-31 10:52:01 +01:00
description = " D i s t r i b u t e d s t o r a g e s y s t e m " ;
maintainers = [
2012-12-04 17:54:03 +00:00
stdenv . lib . maintainers . raskin
2009-08-31 10:52:01 +01:00
] ;
2017-05-14 18:18:07 +01:00
platforms = with stdenv . lib . platforms ;
2009-08-31 10:52:01 +01:00
linux ++ freebsd ;
} ;
}