2012-09-08 14:50:47 +02:00
|
|
|
{ stdenv, fetchurl, scons, which, v8, useV8 ? false}:
|
2012-01-18 21:32:41 +01:00
|
|
|
|
2012-06-11 19:41:14 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2012-01-18 21:32:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2012-09-08 14:50:47 +02:00
|
|
|
name = "mongodb-2.2.0";
|
2012-01-18 21:32:41 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-09-08 14:50:47 +02:00
|
|
|
url = http://downloads.mongodb.org/src/mongodb-src-r2.2.0.tar.gz;
|
|
|
|
sha256 = "12v0cpq9j2gmagr9pbw08karqwqgl4j9r223w7x7sx5cfvj2cih8";
|
2012-01-18 21:32:41 +01:00
|
|
|
};
|
|
|
|
|
2012-09-08 14:50:47 +02:00
|
|
|
buildNativeInputs = [ scons which ];
|
2012-01-18 21:32:41 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
patchPhase = ''
|
2012-09-08 14:50:47 +02:00
|
|
|
substituteInPlace SConstruct --replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR"
|
|
|
|
'' + optionalString useV8 ''
|
|
|
|
substituteInPlace SConstruct --replace "#/../v8" "${v8}" \
|
|
|
|
--replace "[\"${v8}/\"]" "[\"${v8}/lib\"]"
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2012-09-08 14:50:47 +02:00
|
|
|
echo $PATH
|
|
|
|
scons all --cc=`which gcc` --cxx=`which g++` ${optionalString useV8 "--usev8"}
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-09-08 14:50:47 +02:00
|
|
|
scons install --cc=`which gcc` --cxx=`which g++` ${optionalString useV8 "--usev8"} --full --prefix=$out
|
|
|
|
rm -rf $out/lib64 # exact same files as installed in $out/lib
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "a scalable, high-performance, open source NoSQL database";
|
|
|
|
homepage = http://www.mongodb.org;
|
|
|
|
license = "AGPLv3";
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
|
|
|
|
platforms = stdenv.lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|