mongodb: Fix build

This commit is contained in:
William A. Kennington III 2014-09-14 11:20:10 -07:00
parent 698dfe11a3
commit a1d6c60e2d
2 changed files with 29 additions and 10 deletions

@ -1,4 +1,5 @@
{ stdenv, fetchurl, scons, boost, gperftools, pcre, snappy }:
{ stdenv, fetchurl, scons, boost, gperftools, pcre, snappy
, libyamlcpp, sasl, openssl, libpcap }:
with stdenv.lib;
@ -7,12 +8,20 @@ let version = "2.6.4";
"pcre"
"boost"
"snappy"
# "v8" -- mongo still bundles 3.12 and does not work with 3.15+
# "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs)
# "yaml" -- it seems nixpkgs' yamlcpp (0.5.1) is problematic for mongo
"yaml"
# "v8"
] ++ optionals (!stdenv.isDarwin) [ "tcmalloc" ];
system-lib-args = concatStringsSep " "
(map (lib: "--use-system-${lib}") system-libraries);
buildInputs = [
sasl boost boost.lib gperftools pcre snappy
libyamlcpp sasl openssl libpcap
];
other-args = concatStringsSep " " ([
"--ssl"
"--use-sasl-client"
"--extrapath=${concatStringsSep "," buildInputs}"
] ++ map (lib: "--use-system-${lib}") system-libraries);
in stdenv.mkDerivation rec {
name = "mongodb-${version}";
@ -22,20 +31,28 @@ in stdenv.mkDerivation rec {
sha256 = "1h4rrgcb95234ryjma3fjg50qsm1bnxjx5ib0c3p9nzmc2ji2m07";
};
nativeBuildInputs = [ scons boost gperftools pcre snappy ];
nativeBuildInputs = [ scons ];
inherit buildInputs;
postPatch = ''
# fix yaml-cpp detection
sed -i -e "s/\[\"yaml\"\]/\[\"yaml-cpp\"\]/" SConstruct
# bug #482576
sed -i -e "/-Werror/d" src/third_party/v8/SConscript
# fix environment variable reading
substituteInPlace SConstruct \
--replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR"
'';
buildPhase = ''
scons all --release ${system-lib-args}
scons all --release ${other-args}
'';
installPhase = ''
mkdir -p $out/lib
scons install --release --prefix=$out ${system-lib-args}
scons install --release --prefix=$out ${other-args}
'';
meta = {
@ -43,7 +60,7 @@ in stdenv.mkDerivation rec {
homepage = http://www.mongodb.org;
license = licenses.agpl3;
maintainers = with maintainers; [ bluescreen303 offline ];
maintainers = with maintainers; [ bluescreen303 offline wkennington ];
platforms = platforms.unix;
};
}

@ -7191,7 +7191,9 @@ let
mariadb = callPackage ../servers/sql/mariadb {};
mongodb = callPackage ../servers/nosql/mongodb { };
mongodb = callPackage ../servers/nosql/mongodb {
sasl = cyrus_sasl;
};
riak = callPackage ../servers/nosql/riak/1.3.1.nix { };