make changes needed to build mongodb

This commit is contained in:
Jude Taylor 2015-07-23 15:47:16 -07:00
parent 748da7e541
commit 4fab7321bf
6 changed files with 41 additions and 1 deletions

View file

@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
buildInputs = [ unzip ] ++ stdenv.lib.optional stdenv.isLinux libunwind;
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile.am --replace stdc++ c++
substituteInPlace Makefile.in --replace stdc++ c++
substituteInPlace libtool --replace stdc++ c++
'';
# some packages want to link to the static tcmalloc_minimal
# to drop the runtime dependency on gperftools
dontDisableStatic = true;

View file

@ -8,6 +8,18 @@ stdenv.mkDerivation rec {
sha256 = "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1";
};
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace kccommon.h \
--replace tr1/unordered_map unordered_map \
--replace tr1/unordered_set unordered_set \
--replace tr1::hash std::hash \
--replace tr1::unordered_map std::unordered_map \
--replace tr1::unordered_set std::unordered_set
substituteInPlace lab/kcdict/Makefile --replace stdc++ c++
substituteInPlace configure --replace stdc++ c++
'';
buildInputs = [ zlib ];
meta = with stdenv.lib; {

View file

@ -17,6 +17,10 @@ stdenv.mkDerivation rec {
else if stdenv.isDarwin then [ "--with-pcap=bpf" ]
else [];
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace configure --replace " -arch i386" ""
'';
preInstall = ''mkdir -p $out/bin'';
crossAttrs = {

View file

@ -19,7 +19,8 @@ stdenv.mkDerivation rec {
# -DNDEBUG for speed
configureFlags = [ "CXXFLAGS=-DNDEBUG" ];
doCheck = true;
# SIGILL on darwin
doCheck = !stdenv.isDarwin;
meta = with stdenv.lib; {
homepage = http://code.google.com/p/snappy/;

View file

@ -58,6 +58,12 @@ stdenv.mkDerivation rec {
./autogen.sh
'';
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace api/leveldb/leveldb_wt.h --replace \
'#include "wiredtiger.h"' \
''$'#include "wiredtiger.h"\n#include "pthread.h"'
'';
meta = {
homepage = http://wiredtiger.com/;
description = "";

View file

@ -21,6 +21,10 @@ let version = "3.0.4";
] ++ 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
@ -47,6 +51,13 @@ in stdenv.mkDerivation rec {
# fix environment variable reading
substituteInPlace SConstruct \
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2cap.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2latlng.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2latlngrect.cc --replace drem remainder
'';
buildPhase = ''