From a1d6c60e2d06045cf0ee706f5357f7fbb00f94f7 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 14 Sep 2014 11:20:10 -0700 Subject: [PATCH] mongodb: Fix build --- pkgs/servers/nosql/mongodb/default.nix | 35 +++++++++++++++++++------- pkgs/top-level/all-packages.nix | 4 ++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix index 40c255d59214..651b84b7afea 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/default.nix @@ -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; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f3882c45f991..03115b13b31a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };