2014-04-26 14:13:51 -04:00
|
|
|
{ stdenv, fetchurl, scons, boost, gperftools, pcre, snappy }:
|
|
|
|
|
2014-08-26 13:44:49 -04:00
|
|
|
let version = "2.6.4";
|
2014-04-26 14:13:51 -04:00
|
|
|
system-libraries = [
|
|
|
|
"pcre"
|
|
|
|
"boost"
|
|
|
|
"snappy"
|
|
|
|
# "v8" -- mongo still bundles 3.12 and does not work with 3.15+
|
|
|
|
# "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs)
|
|
|
|
# "yaml" -- it seems nixpkgs' yamlcpp (0.5.1) is problematic for mongo
|
2014-08-29 11:45:05 -04:00
|
|
|
] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ "tcmalloc" ];
|
2014-04-26 14:13:51 -04:00
|
|
|
system-lib-args = stdenv.lib.concatStringsSep " "
|
|
|
|
(map (lib: "--use-system-${lib}") system-libraries);
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2013-07-18 15:05:49 -04:00
|
|
|
name = "mongodb-${version}";
|
2012-01-18 15:32:41 -05:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-07-18 15:05:49 -04:00
|
|
|
url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
|
2014-08-26 13:44:49 -04:00
|
|
|
sha256 = "1h4rrgcb95234ryjma3fjg50qsm1bnxjx5ib0c3p9nzmc2ji2m07";
|
2012-01-18 15:32:41 -05:00
|
|
|
};
|
|
|
|
|
2014-04-26 14:13:51 -04:00
|
|
|
nativeBuildInputs = [ scons boost gperftools pcre snappy ];
|
2012-01-18 15:32:41 -05:00
|
|
|
|
2012-09-09 11:25:59 -04:00
|
|
|
postPatch = ''
|
2013-05-12 12:21:13 -04:00
|
|
|
substituteInPlace SConstruct \
|
2014-04-26 14:13:51 -04:00
|
|
|
--replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR"
|
2012-01-18 15:32:41 -05:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2014-04-26 14:13:51 -04:00
|
|
|
scons all --release ${system-lib-args}
|
2012-01-18 15:32:41 -05:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2013-05-12 12:21:13 -04:00
|
|
|
mkdir -p $out/lib
|
2014-04-26 14:13:51 -04:00
|
|
|
scons install --release --prefix=$out ${system-lib-args}
|
2012-01-18 15:32:41 -05:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "a scalable, high-performance, open source NoSQL database";
|
|
|
|
homepage = http://www.mongodb.org;
|
2014-06-19 00:19:00 -04:00
|
|
|
license = stdenv.lib.licenses.agpl3;
|
2012-01-18 15:32:41 -05:00
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
|
2014-08-29 11:45:05 -04:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2012-01-18 15:32:41 -05:00
|
|
|
};
|
|
|
|
}
|