@@ -2,17 +2,21 @@
22, zlib, libyamlcpp, sasl, openssl, libpcap, wiredtiger
33}:
44
5+# Note:
6+# The command line tools are written in Go as part of a different package (mongodb-tools)
7+
58with stdenv.lib;
69
7−let version = "3.0.7";
10+let version = "3.2.1";
811 system-libraries = [
912 "pcre"
13+ #"asio" -- XXX use package?
1014 #"wiredtiger"
1115 "boost"
1216 "snappy"
1317 "zlib"
14− # "v8"
15− # "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs)
18+ #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
19+ #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
1620 "yaml"
1721 ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
1822 buildInputs = [
@@ -21,19 +25,17 @@ let version = "3.0.7";
2125 ]; # ++ optional stdenv.is64bit wiredtiger;
2226
2327 other-args = concatStringsSep " " ([
24− # these are opt-in, lol
25− "--cc-use-shell-environment"
26− "--cxx-use-shell-environment"
27−
28− "--c++11=on"
2928 "--ssl"
3029 #"--rocksdb" # Don't have this packaged yet
3130 "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
32− "--js-engine=v8-3.25"
31+ "--js-engine=mozjs"
3332 "--use-sasl-client"
3433 "--disable-warnings-as-errors"
35− "--variant-dir=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
36− "--extrapath=${concatStringsSep "," buildInputs}"
34+ "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
35+ "CC=$CC"
36+ "CXX=$CXX"
37+ "CCFLAGS=\"${concatStringsSep " " (map (input: "-I${input}/include") buildInputs)}\""
38+ "LINKFLAGS=\"${concatStringsSep " " (map (input: "-L${input}/lib") buildInputs)}\""
3739 ] ++ map (lib: "--use-system-${lib}") system-libraries);
3840
3941in stdenv.mkDerivation rec {
@@ -41,12 +43,18 @@ in stdenv.mkDerivation rec {
4143
4244 src = fetchurl {
4345 url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
44− sha256 = "1rx7faqsq733vdriavdfmvx75nhjq9nm5bgwd3hw1cxzqgkvl99d";
46+ sha256 = "059gskly8maj2c9iy46gccx7a9ya522pl5aaxl5vss5bllxilhsh";
4547 };
4648
4749 nativeBuildInputs = [ scons ];
4850 inherit buildInputs;
4951
52+ # When not building with the system valgrind, the build should use the
53+ # vendored header file - regardless of whether or not we're using the system
54+ # tcmalloc - so we need to lift the include path manipulation out of the
55+ # conditional.
56+ patches = [ ./valgrind-include.patch ];
57+
5058 postPatch = ''
5159 # fix environment variable reading
5260 substituteInPlace SConstruct \
@@ -76,7 +84,7 @@ in stdenv.mkDerivation rec {
7684 homepage = http://www.mongodb.org;
7785 license = licenses.agpl3;
7886
79− maintainers = with maintainers; [ bluescreen303 offline wkennington ];
87+ maintainers = with maintainers; [ bluescreen303 offline wkennington cstrahan ];
8088 platforms = platforms.unix;
8189 };
8290}