diff options
author | Tobias Mayer <tobim@fastmail.fm> | 2019-12-16 13:39:21 +0100 |
---|---|---|
committer | Tobias Mayer <tobim@fastmail.fm> | 2019-12-31 15:05:13 +0100 |
commit | 0a21b322346977d7413c8cd2a3d834d8f1b03c96 (patch) | |
tree | 13af7bc6714395254195241a1c2450f8e8f29d78 /pkgs/development/libraries/thrift | |
parent | a244885c63adf4d0c21702cd6a370dc656b9f353 (diff) |
thrift: build with CMake; add pkgsStatic support
Diffstat (limited to 'pkgs/development/libraries/thrift')
-rw-r--r-- | pkgs/development/libraries/thrift/default.nix | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/pkgs/development/libraries/thrift/default.nix b/pkgs/development/libraries/thrift/default.nix index ecdb831fcfaf..b1b66ed052fb 100644 --- a/pkgs/development/libraries/thrift/default.nix +++ b/pkgs/development/libraries/thrift/default.nix @@ -1,6 +1,5 @@ -{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkgconfig, bison -, flex, twisted -}: +{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkgconfig +, bison, flex, twisted, static ? false }: stdenv.mkDerivation rec { pname = "thrift"; @@ -11,27 +10,36 @@ stdenv.mkDerivation rec { sha256 = "0yai9c3bdsrkkjshgim7zk0i7malwfprg00l9774dbrkh2w4ilvs"; }; - #enableParallelBuilding = true; problems on hydra - # Workaround to make the python wrapper not drop this package: # pythonFull.buildEnv.override { extraLibs = [ thrift ]; } pythonPath = []; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ - boost zlib libevent openssl python bison flex twisted - ]; + nativeBuildInputs = [ cmake pkgconfig ]; + buildInputs = [ boost zlib libevent openssl python bison flex ] + ++ stdenv.lib.optional (!static) twisted; preConfigure = "export PY_PREFIX=$out"; - # TODO: package boost-test, so we can run the test suite. (Currently it fails - # to find libboost_unit_test_framework.a.) - configureFlags = [ "--enable-tests=no" ]; - doCheck = false; + cmakeFlags = [ + # FIXME: Fails to link in static mode with undefined reference to + # `boost::unit_test::unit_test_main(bool (*)(), int, char**)' + "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}" + ] ++ stdenv.lib.optionals static [ + "-DWITH_STATIC_LIB:BOOL=ON" + "-DOPENSSL_USE_STATIC_LIBS=ON" + ]; + + doCheck = !static; + checkPhase = '' + runHook preCheck + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib ctest -E PythonTestSSLSocket + runHook postCheck + ''; + enableParallelChecking = false; meta = with stdenv.lib; { description = "Library for scalable cross-language services"; - homepage = http://thrift.apache.org/; + homepage = "http://thrift.apache.org/"; license = licenses.asl20; platforms = platforms.linux ++ platforms.darwin; maintainers = [ maintainers.bjornfor ]; |