···2, zlib, libyamlcpp, sasl, openssl, libpcap, wiredtiger
3}:
45+# Note:
6+# The command line tools are written in Go as part of a different package (mongodb-tools)
7+8with stdenv.lib;
910+let version = "3.2.1";
11 system-libraries = [
12 "pcre"
13+ #"asio" -- XXX use package?
14 #"wiredtiger"
15 "boost"
16 "snappy"
17 "zlib"
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).
20 "yaml"
21 ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
22 buildInputs = [
···25 ]; # ++ optional stdenv.is64bit wiredtiger;
2627 other-args = concatStringsSep " " ([
0000028 "--ssl"
29 #"--rocksdb" # Don't have this packaged yet
30 "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
31+ "--js-engine=mozjs"
32 "--use-sasl-client"
33 "--disable-warnings-as-errors"
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)}\""
39 ] ++ map (lib: "--use-system-${lib}") system-libraries);
4041in stdenv.mkDerivation rec {
···4344 src = fetchurl {
45 url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
46+ sha256 = "059gskly8maj2c9iy46gccx7a9ya522pl5aaxl5vss5bllxilhsh";
47 };
4849 nativeBuildInputs = [ scons ];
50 inherit buildInputs;
51+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 ];
5758 postPatch = ''
59 # fix environment variable reading
···84 homepage = http://www.mongodb.org;
85 license = licenses.agpl3;
8687+ maintainers = with maintainers; [ bluescreen303 offline wkennington cstrahan ];
88 platforms = platforms.unix;
89 };
90}
+25
pkgs/servers/nosql/mongodb/valgrind-include.patch
···0000000000000000000000000
···1+diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
2+index 6add602..6e232d8 100644
3+--- a/src/mongo/util/SConscript
4++++ b/src/mongo/util/SConscript
5+@@ -241,9 +241,6 @@ if get_option('allocator') == 'tcmalloc':
6+ # Add in the include path for our vendored tcmalloc.
7+ tcmspEnv.InjectThirdPartyIncludePaths('gperftools')
8+9+- # Include valgrind since tcmalloc disables itself while running under valgrind
10+- tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
11+-
12+ # If our changes to tcmalloc are ever upstreamed, this should become set based on a top
13+ # level configure check, though its effects should still be scoped just to these files.
14+ tcmspEnv.Append(
15+@@ -252,6 +249,10 @@ if get_option('allocator') == 'tcmalloc':
16+ ]
17+ )
18+19++ # Include valgrind since tcmalloc disables itself while running under valgrind
20++ if not use_system_version_of_library('valgrind'):
21++ tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
22++
23+ tcmspEnv.Library(
24+ target='tcmalloc_set_parameter',
25+ source=[