2014-04-26 20:13:51 +02:00
|
|
|
{ stdenv, fetchurl, scons, boost, gperftools, pcre, snappy }:
|
|
|
|
|
2014-08-29 17:56:07 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2014-08-26 19:44:49 +02:00
|
|
|
let version = "2.6.4";
|
2014-04-26 20:13:51 +02: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 17:56:07 +02:00
|
|
|
] ++ optionals (!stdenv.isDarwin) [ "tcmalloc" ];
|
|
|
|
system-lib-args = concatStringsSep " "
|
|
|
|
(map (lib: "--use-system-${lib}") system-libraries);
|
2014-04-26 20:13:51 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2013-07-18 21:05:49 +02:00
|
|
|
name = "mongodb-${version}";
|
2012-01-18 21:32:41 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-07-18 21:05:49 +02:00
|
|
|
url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
|
2014-08-26 19:44:49 +02:00
|
|
|
sha256 = "1h4rrgcb95234ryjma3fjg50qsm1bnxjx5ib0c3p9nzmc2ji2m07";
|
2012-01-18 21:32:41 +01:00
|
|
|
};
|
|
|
|
|
2014-04-26 20:13:51 +02:00
|
|
|
nativeBuildInputs = [ scons boost gperftools pcre snappy ];
|
2012-01-18 21:32:41 +01:00
|
|
|
|
2012-09-09 17:25:59 +02:00
|
|
|
postPatch = ''
|
2013-05-12 18:21:13 +02:00
|
|
|
substituteInPlace SConstruct \
|
2014-04-26 20:13:51 +02:00
|
|
|
--replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR"
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2014-04-26 20:13:51 +02:00
|
|
|
scons all --release ${system-lib-args}
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2013-05-12 18:21:13 +02:00
|
|
|
mkdir -p $out/lib
|
2014-04-26 20:13:51 +02:00
|
|
|
scons install --release --prefix=$out ${system-lib-args}
|
2012-01-18 21:32:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "a scalable, high-performance, open source NoSQL database";
|
|
|
|
homepage = http://www.mongodb.org;
|
2014-08-29 17:56:07 +02:00
|
|
|
license = licenses.agpl3;
|
2012-01-18 21:32:41 +01:00
|
|
|
|
2014-08-29 17:56:07 +02:00
|
|
|
maintainers = with maintainers; [ bluescreen303 offline ];
|
|
|
|
platforms = platforms.unix;
|
2012-01-18 21:32:41 +01:00
|
|
|
};
|
|
|
|
}
|