From 68087185e36ea4d3b1bf2cb7ccdaebb7d72d31d1 Mon Sep 17 00:00:00 2001 From: Jude Taylor Date: Mon, 19 Oct 2015 18:40:55 -0700 Subject: [PATCH] rethinkdb: build on darwin --- pkgs/development/libraries/protobuf/generic.nix | 3 +++ pkgs/servers/nosql/rethinkdb/default.nix | 15 ++++++++++++--- pkgs/top-level/all-packages.nix | 4 +++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 692891bd5bf2..fc41187a931e 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -12,6 +12,9 @@ stdenv.mkDerivation rec { rm -rf gtest cp -r ${gtest.source} gtest chmod -R a+w gtest + '' + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace src/google/protobuf/testing/googletest.cc \ + --replace 'tmpnam(b)' '"'$TMPDIR'/foo"' ''; buildInputs = [ autoreconfHook zlib ]; diff --git a/pkgs/servers/nosql/rethinkdb/default.nix b/pkgs/servers/nosql/rethinkdb/default.nix index 55f77ce0b5dd..57b0e0abb767 100644 --- a/pkgs/servers/nosql/rethinkdb/default.nix +++ b/pkgs/servers/nosql/rethinkdb/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, which, m4, python -, protobuf, boost, zlib, curl, openssl, icu, jemalloc +, protobuf, boost, zlib, curl, openssl, icu, jemalloc, libtool }: stdenv.mkDerivation rec { @@ -11,17 +11,26 @@ stdenv.mkDerivation rec { sha256 = "03w9fq3wcvwy04b3x6zb3hvwar7b9jfbpq77rmxdlgh5w64vvgwd"; }; + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' external/v8_3.30.33.16/build/gyp/pylib/gyp/xcode_emulation.py + + # very meta + substituteInPlace mk/support/pkg/re2.sh --replace "-i '''" "-i" + ''; + preConfigure = '' export ALLOW_WARNINGS=1 patchShebangs . ''; - configureFlags = [ + configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [ "--with-jemalloc" "--lib-path=${jemalloc}/lib" ]; - buildInputs = [ protobuf boost zlib curl openssl icu jemalloc ]; + buildInputs = [ protobuf boost zlib curl openssl icu ] + ++ stdenv.lib.optional (!stdenv.isDarwin) jemalloc + ++ stdenv.lib.optional stdenv.isDarwin libtool; nativeBuildInputs = [ which m4 python ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3bc1100639e6..bfec472fca89 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9272,7 +9272,9 @@ let restund = callPackage ../servers/restund {}; - rethinkdb = callPackage ../servers/nosql/rethinkdb { }; + rethinkdb = callPackage ../servers/nosql/rethinkdb { + libtool = darwin.cctools; + }; rippled = callPackage ../servers/rippled { boost = boost159;