···22, zlib, libyamlcpp, sasl, openssl, libpcap, wiredtiger
33}:
4455+# Note:
66+# The command line tools are written in Go as part of a different package (mongodb-tools)
77+58with stdenv.lib;
6977-let version = "3.0.7";
1010+let version = "3.2.1";
811 system-libraries = [
912 "pcre"
1313+ #"asio" -- XXX use package?
1014 #"wiredtiger"
1115 "boost"
1216 "snappy"
1317 "zlib"
1414- # "v8"
1515- # "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs)
1818+ #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
1919+ #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
1620 "yaml"
1721 ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
1822 buildInputs = [
···2125 ]; # ++ optional stdenv.is64bit wiredtiger;
22262327 other-args = concatStringsSep " " ([
2424- # these are opt-in, lol
2525- "--cc-use-shell-environment"
2626- "--cxx-use-shell-environment"
2727-2828- "--c++11=on"
2928 "--ssl"
3029 #"--rocksdb" # Don't have this packaged yet
3130 "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
3232- "--js-engine=v8-3.25"
3131+ "--js-engine=mozjs"
3332 "--use-sasl-client"
3433 "--disable-warnings-as-errors"
3535- "--variant-dir=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
3636- "--extrapath=${concatStringsSep "," buildInputs}"
3434+ "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
3535+ "CC=$CC"
3636+ "CXX=$CXX"
3737+ "CCFLAGS=\"${concatStringsSep " " (map (input: "-I${input}/include") buildInputs)}\""
3838+ "LINKFLAGS=\"${concatStringsSep " " (map (input: "-L${input}/lib") buildInputs)}\""
3739 ] ++ map (lib: "--use-system-${lib}") system-libraries);
38403941in stdenv.mkDerivation rec {
···41434244 src = fetchurl {
4345 url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
4444- sha256 = "1rx7faqsq733vdriavdfmvx75nhjq9nm5bgwd3hw1cxzqgkvl99d";
4646+ sha256 = "059gskly8maj2c9iy46gccx7a9ya522pl5aaxl5vss5bllxilhsh";
4547 };
46484749 nativeBuildInputs = [ scons ];
4850 inherit buildInputs;
5151+5252+ # When not building with the system valgrind, the build should use the
5353+ # vendored header file - regardless of whether or not we're using the system
5454+ # tcmalloc - so we need to lift the include path manipulation out of the
5555+ # conditional.
5656+ patches = [ ./valgrind-include.patch ];
49575058 postPatch = ''
5159 # fix environment variable reading
···7684 homepage = http://www.mongodb.org;
7785 license = licenses.agpl3;
78867979- maintainers = with maintainers; [ bluescreen303 offline wkennington ];
8787+ maintainers = with maintainers; [ bluescreen303 offline wkennington cstrahan ];
8088 platforms = platforms.unix;
8189 };
8290}
+25
pkgs/servers/nosql/mongodb/valgrind-include.patch
···11+diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
22+index 6add602..6e232d8 100644
33+--- a/src/mongo/util/SConscript
44++++ b/src/mongo/util/SConscript
55+@@ -241,9 +241,6 @@ if get_option('allocator') == 'tcmalloc':
66+ # Add in the include path for our vendored tcmalloc.
77+ tcmspEnv.InjectThirdPartyIncludePaths('gperftools')
88+99+- # Include valgrind since tcmalloc disables itself while running under valgrind
1010+- tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
1111+-
1212+ # If our changes to tcmalloc are ever upstreamed, this should become set based on a top
1313+ # level configure check, though its effects should still be scoped just to these files.
1414+ tcmspEnv.Append(
1515+@@ -252,6 +249,10 @@ if get_option('allocator') == 'tcmalloc':
1616+ ]
1717+ )
1818+1919++ # Include valgrind since tcmalloc disables itself while running under valgrind
2020++ if not use_system_version_of_library('valgrind'):
2121++ tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
2222++
2323+ tcmspEnv.Library(
2424+ target='tcmalloc_set_parameter',
2525+ source=[