about summary refs log tree commit diff
path: root/pkgs/servers/nosql
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2016-01-26 21:48:57 -0500
committerCharles Strahan <charles.c.strahan@gmail.com>2016-01-28 14:15:59 -0500
commit5583ecf361c839bbe2d0bd9e9ad89f796d596cf1 (patch)
tree17ac14c6ff645dd07f7af4279d186aab246c470f /pkgs/servers/nosql
parent9e743fd1519ceb447baa715edea558db1c4d160c (diff)
downloadnixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar.gz
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar.bz2
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar.lz
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar.xz
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.tar.zst
nixlib-5583ecf361c839bbe2d0bd9e9ad89f796d596cf1.zip
mongodb: 3.0.7 -> 3.2.1
Fixes #12639
Diffstat (limited to 'pkgs/servers/nosql')
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix34
-rw-r--r--pkgs/servers/nosql/mongodb/valgrind-include.patch25
2 files changed, 46 insertions, 13 deletions
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
index 60a37456b4bb..2ea255e4432d 100644
--- a/pkgs/servers/nosql/mongodb/default.nix
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -2,17 +2,21 @@
 , zlib, libyamlcpp, sasl, openssl, libpcap, wiredtiger
 }:
 
+# Note:
+# The command line tools are written in Go as part of a different package (mongodb-tools)
+
 with stdenv.lib;
 
-let version = "3.0.7";
+let version = "3.2.1";
     system-libraries = [
       "pcre"
+      #"asio" -- XXX use package?
       #"wiredtiger"
       "boost"
       "snappy"
       "zlib"
-      # "v8"
-      # "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs)
+      #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
+      #"stemmer"  -- not nice to package yet (no versioning, no makefile, no shared libs).
       "yaml"
     ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
     buildInputs = [
@@ -21,19 +25,17 @@ let version = "3.0.7";
     ]; # ++ optional stdenv.is64bit wiredtiger;
 
     other-args = concatStringsSep " " ([
-      # these are opt-in, lol
-      "--cc-use-shell-environment"
-      "--cxx-use-shell-environment"
-
-      "--c++11=on"
       "--ssl"
       #"--rocksdb" # Don't have this packaged yet
       "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
-      "--js-engine=v8-3.25"
+      "--js-engine=mozjs"
       "--use-sasl-client"
       "--disable-warnings-as-errors"
-      "--variant-dir=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
-      "--extrapath=${concatStringsSep "," buildInputs}"
+      "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
+      "CC=$CC"
+      "CXX=$CXX"
+      "CCFLAGS=\"${concatStringsSep " " (map (input: "-I${input}/include") buildInputs)}\""
+      "LINKFLAGS=\"${concatStringsSep " " (map (input: "-L${input}/lib") buildInputs)}\""
     ] ++ map (lib: "--use-system-${lib}") system-libraries);
 
 in stdenv.mkDerivation rec {
@@ -41,12 +43,18 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
-    sha256 = "1rx7faqsq733vdriavdfmvx75nhjq9nm5bgwd3hw1cxzqgkvl99d";
+    sha256 = "059gskly8maj2c9iy46gccx7a9ya522pl5aaxl5vss5bllxilhsh";
   };
 
   nativeBuildInputs = [ scons ];
   inherit buildInputs;
 
+  # When not building with the system valgrind, the build should use the
+  # vendored header file - regardless of whether or not we're using the system
+  # tcmalloc - so we need to lift the include path manipulation out of the
+  # conditional.
+  patches = [ ./valgrind-include.patch ];
+
   postPatch = ''
     # fix environment variable reading
     substituteInPlace SConstruct \
@@ -76,7 +84,7 @@ in stdenv.mkDerivation rec {
     homepage = http://www.mongodb.org;
     license = licenses.agpl3;
 
-    maintainers = with maintainers; [ bluescreen303 offline wkennington ];
+    maintainers = with maintainers; [ bluescreen303 offline wkennington cstrahan ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/servers/nosql/mongodb/valgrind-include.patch b/pkgs/servers/nosql/mongodb/valgrind-include.patch
new file mode 100644
index 000000000000..6b401525c080
--- /dev/null
+++ b/pkgs/servers/nosql/mongodb/valgrind-include.patch
@@ -0,0 +1,25 @@
+diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript
+index 6add602..6e232d8 100644
+--- a/src/mongo/util/SConscript
++++ b/src/mongo/util/SConscript
+@@ -241,9 +241,6 @@ if get_option('allocator') == 'tcmalloc':
+         # Add in the include path for our vendored tcmalloc.
+         tcmspEnv.InjectThirdPartyIncludePaths('gperftools')
+ 
+-        # Include valgrind since tcmalloc disables itself while running under valgrind
+-        tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
+-
+         # If our changes to tcmalloc are ever upstreamed, this should become set based on a top
+         # level configure check, though its effects should still be scoped just to these files.
+         tcmspEnv.Append(
+@@ -252,6 +249,10 @@ if get_option('allocator') == 'tcmalloc':
+             ]
+         )
+ 
++    # Include valgrind since tcmalloc disables itself while running under valgrind
++    if not use_system_version_of_library('valgrind'):
++        tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
++
+     tcmspEnv.Library(
+         target='tcmalloc_set_parameter',
+         source=[