summary refs log blame commit diff
path: root/pkgs/tools/filesystems/glusterfs/default.nix
blob: 2563c4428a4c4e772d95689b49583b25f494784d (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                                


                                                                           
    


                                       
                    
                                  


                                                                                             

                 
                                                          
                                                           
                           
    



                                     
  
                   
     
                           
                                            
 


                   
 
                    
                                                            
      


                               






                                                                                          





                          


                           
 
          
                        

                                               
                                   
      
                                           


                       
{stdenv, fetchurl, fuse, bison, flex_2_5_35, openssl, python, ncurses, readline,
 autoconf, automake, libtool, pkgconfig, zlib, libaio, libxml2, acl, sqlite
 , liburcu, attr
}:
let 
  s = # Generated upstream information 
  rec {
    baseName="glusterfs";
    version="3.7.6";
    name="${baseName}-${version}";
    hash="01fg132k4gvvx5p0bi88956yzd77pcnw3iyi88vrsncmpnvg10xv";
    url="http://download.gluster.org/pub/gluster/glusterfs/3.7/3.7.6/glusterfs-3.7.6.tar.gz";
    sha256="01fg132k4gvvx5p0bi88956yzd77pcnw3iyi88vrsncmpnvg10xv";
  };
  buildInputs = [
    fuse bison flex_2_5_35 openssl python ncurses readline
    autoconf automake libtool pkgconfig zlib libaio libxml2
    acl sqlite liburcu attr
  ];
  # Some of the headers reference acl
  propagatedBuildInputs = [
    acl
  ];
in
stdenv.mkDerivation
rec {
  inherit (s) name version;
  inherit buildInputs propagatedBuildInputs;

  preConfigure = ''
    ./autogen.sh
    '';

  configureFlags = [
    ''--with-mountutildir="$out/sbin" --localstatedir=/var''
    ];

  makeFlags = "DESTDIR=$(out)";

  preInstall = ''
    substituteInPlace api/examples/Makefile --replace '$(DESTDIR)' $out
    substituteInPlace geo-replication/syncdaemon/Makefile --replace '$(DESTDIR)' $out
    substituteInPlace geo-replication/syncdaemon/Makefile --replace '$(DESTDIR)' $out
    substituteInPlace xlators/features/glupy/examples/Makefile --replace '$(DESTDIR)' $out
    substituteInPlace xlators/features/glupy/src/Makefile --replace '$(DESTDIR)' $out
    '';

  postInstall = ''
    cp -r $out/$out/* $out
    rm -r $out/nix
    '';

  src = fetchurl {
    inherit (s) url sha256;
  };

  meta = {
    inherit (s) version;
    description = "Distributed storage system";
    maintainers = [
      stdenv.lib.maintainers.raskin
    ];
    platforms = with stdenv.lib.platforms; 
      linux ++ freebsd;
  };
}