@@ -1,6 +1,6 @@
1−{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib
2−, libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool
3−, curl }:
1+{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib,
2+ libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, curl, CoreFoundation, cctools
3+}:
44
55# Note:
66# The command line tools are written in Go as part of a different package (mongodb-tools)
@@ -35,20 +35,9 @@ in stdenv.mkDerivation rec {
3535
3636 nativeBuildInputs = [ scons ];
3737 buildInputs = [
38− sasl
39− boost
40− gperftools
41− pcre-cpp
42− snappy
43− zlib
44− libyamlcpp
45− sasl
46− openssl.dev
47− openssl.out
48− libpcap
49− python
50− curl
51− ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ];
38+ sasl boost gperftools pcre-cpp snappy
39+ zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl
40+ ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security CoreFoundation cctools ];
5241
5342 # MongoDB keeps track of its build parameters, which tricks nix into
5443 # keeping dependencies to build inputs in the final output.
@@ -60,6 +49,9 @@ in stdenv.mkDerivation rec {
6049 substituteInPlace SConstruct \
6150 --replace "env = Environment(" "env = Environment(ENV = os.environ,"
6251 '' + stdenv.lib.optionalString stdenv.isDarwin ''
52+ substituteInPlace src/third_party/asio-master/asio/include/asio/detail/config.hpp --replace ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW ASIO_HAS_STD_STRING_VIEW
53+
54+ substituteInPlace src/third_party/mozjs-45/extract/js/src/jsmath.cpp --replace 'defined(HAVE_SINCOS)' 0
6355
6456 substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
6557 substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder
@@ -80,7 +72,7 @@ in stdenv.mkDerivation rec {
8072 "--release"
8173 "--ssl"
8274 #"--rocksdb" # Don't have this packaged yet
83− "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
75+ "--wiredtiger=on"
8476 "--js-engine=mozjs"
8577 "--use-sasl-client"
8678 "--disable-warnings-as-errors"
@@ -92,6 +84,10 @@ in stdenv.mkDerivation rec {
9284 sconsFlags+=" CXX=$CXX"
9385 '' + optionalString stdenv.isAarch64 ''
9486 sconsFlags+=" CCFLAGS='-march=armv8-a+crc'"
87+ '' + optionalString stdenv.isDarwin ''
88+ sconsFlags+=" CPPPATH=${openssl.dev}/include"
89+ '' + optionalString stdenv.isDarwin ''
90+ sconsFlags+=" LIBPATH=${openssl.out}/lib"
9591 '';
9692
9793 preInstall = ''