parent
9e743fd151
commit
5583ecf361
@ -2,17 +2,21 @@
|
|||||||
, zlib, libyamlcpp, sasl, openssl, libpcap, wiredtiger
|
, 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;
|
with stdenv.lib;
|
||||||
|
|
||||||
let version = "3.0.7";
|
let version = "3.2.1";
|
||||||
system-libraries = [
|
system-libraries = [
|
||||||
"pcre"
|
"pcre"
|
||||||
|
#"asio" -- XXX use package?
|
||||||
#"wiredtiger"
|
#"wiredtiger"
|
||||||
"boost"
|
"boost"
|
||||||
"snappy"
|
"snappy"
|
||||||
"zlib"
|
"zlib"
|
||||||
# "v8"
|
#"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)
|
#"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
|
||||||
"yaml"
|
"yaml"
|
||||||
] ++ optionals stdenv.isLinux [ "tcmalloc" ];
|
] ++ optionals stdenv.isLinux [ "tcmalloc" ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
@ -21,19 +25,17 @@ let version = "3.0.7";
|
|||||||
]; # ++ optional stdenv.is64bit wiredtiger;
|
]; # ++ optional stdenv.is64bit wiredtiger;
|
||||||
|
|
||||||
other-args = concatStringsSep " " ([
|
other-args = concatStringsSep " " ([
|
||||||
# these are opt-in, lol
|
|
||||||
"--cc-use-shell-environment"
|
|
||||||
"--cxx-use-shell-environment"
|
|
||||||
|
|
||||||
"--c++11=on"
|
|
||||||
"--ssl"
|
"--ssl"
|
||||||
#"--rocksdb" # Don't have this packaged yet
|
#"--rocksdb" # Don't have this packaged yet
|
||||||
"--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
|
"--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
|
||||||
"--js-engine=v8-3.25"
|
"--js-engine=mozjs"
|
||||||
"--use-sasl-client"
|
"--use-sasl-client"
|
||||||
"--disable-warnings-as-errors"
|
"--disable-warnings-as-errors"
|
||||||
"--variant-dir=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
|
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
|
||||||
"--extrapath=${concatStringsSep "," buildInputs}"
|
"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);
|
] ++ map (lib: "--use-system-${lib}") system-libraries);
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
@ -41,12 +43,18 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
|
url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
|
||||||
sha256 = "1rx7faqsq733vdriavdfmvx75nhjq9nm5bgwd3hw1cxzqgkvl99d";
|
sha256 = "059gskly8maj2c9iy46gccx7a9ya522pl5aaxl5vss5bllxilhsh";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ scons ];
|
nativeBuildInputs = [ scons ];
|
||||||
inherit buildInputs;
|
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 = ''
|
postPatch = ''
|
||||||
# fix environment variable reading
|
# fix environment variable reading
|
||||||
substituteInPlace SConstruct \
|
substituteInPlace SConstruct \
|
||||||
@ -76,7 +84,7 @@ in stdenv.mkDerivation rec {
|
|||||||
homepage = http://www.mongodb.org;
|
homepage = http://www.mongodb.org;
|
||||||
license = licenses.agpl3;
|
license = licenses.agpl3;
|
||||||
|
|
||||||
maintainers = with maintainers; [ bluescreen303 offline wkennington ];
|
maintainers = with maintainers; [ bluescreen303 offline wkennington cstrahan ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
25
pkgs/servers/nosql/mongodb/valgrind-include.patch
Normal file
25
pkgs/servers/nosql/mongodb/valgrind-include.patch
Normal file
@ -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=[
|
Loading…
x
Reference in New Issue
Block a user