2021-04-03 16:16:14 -07:00
|
|
|
{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkg-config
|
2020-12-19 22:11:26 -08:00
|
|
|
, bison, flex, twisted
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2013-12-13 02:16:40 -08:00
|
|
|
|
2014-12-02 23:04:42 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "thrift";
|
2021-04-03 16:16:14 -07:00
|
|
|
version = "0.14.1";
|
2013-12-13 02:16:40 -08:00
|
|
|
|
2014-12-02 23:04:42 -08:00
|
|
|
src = fetchurl {
|
2019-08-15 05:41:18 -07:00
|
|
|
url = "https://archive.apache.org/dist/thrift/${version}/${pname}-${version}.tar.gz";
|
2021-04-03 16:16:14 -07:00
|
|
|
sha256 = "198c855mjy5byqfb941hiyq2j37baz63f0wcfy4vp8y8v4f5xnhk";
|
2013-12-13 02:16:40 -08:00
|
|
|
};
|
|
|
|
|
2014-03-17 08:20:55 -07:00
|
|
|
# Workaround to make the python wrapper not drop this package:
|
2014-10-19 10:54:33 -07:00
|
|
|
# pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
|
2014-03-17 08:20:55 -07:00
|
|
|
pythonPath = [];
|
|
|
|
|
2021-01-18 22:50:56 -08:00
|
|
|
nativeBuildInputs = [ cmake pkg-config bison flex ];
|
2021-01-18 00:03:28 -08:00
|
|
|
buildInputs = [ boost zlib libevent openssl ]
|
2021-01-21 09:00:13 -08:00
|
|
|
++ lib.optionals (!static) [ python twisted ];
|
2013-12-13 02:16:40 -08:00
|
|
|
|
2014-12-02 23:04:42 -08:00
|
|
|
preConfigure = "export PY_PREFIX=$out";
|
|
|
|
|
2019-12-16 04:39:21 -08:00
|
|
|
cmakeFlags = [
|
2021-04-03 16:16:14 -07:00
|
|
|
"-DBUILD_JAVASCRIPT:BOOL=OFF"
|
|
|
|
"-DBUILD_NODEJS:BOOL=OFF"
|
|
|
|
|
2019-12-16 04:39:21 -08:00
|
|
|
# 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"}"
|
2021-01-21 09:00:13 -08:00
|
|
|
] ++ lib.optionals static [
|
2019-12-16 04:39:21 -08:00
|
|
|
"-DWITH_STATIC_LIB:BOOL=ON"
|
|
|
|
"-DOPENSSL_USE_STATIC_LIBS=ON"
|
|
|
|
];
|
|
|
|
|
2021-04-03 16:16:14 -07:00
|
|
|
disabledTests = [
|
|
|
|
"PythonTestSSLSocket"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# tests that hang up in the darwin sandbox
|
|
|
|
"SecurityTest"
|
|
|
|
"SecurityFromBufferTest"
|
|
|
|
"python_test"
|
|
|
|
|
|
|
|
# tests that fail in the darwin sandbox when trying to use network
|
|
|
|
"UnitTests"
|
|
|
|
"TInterruptTest"
|
|
|
|
"TServerIntegrationTest"
|
|
|
|
"processor"
|
|
|
|
"TNonblockingServerTest"
|
|
|
|
"TNonblockingSSLServerTest"
|
|
|
|
"StressTest"
|
|
|
|
"StressTestConcurrent"
|
|
|
|
"StressTestNonBlocking"
|
|
|
|
"PythonThriftTNonblockingServer"
|
|
|
|
];
|
|
|
|
|
2019-12-16 04:39:21 -08:00
|
|
|
doCheck = !static;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2020-01-10 12:19:01 -08:00
|
|
|
|
2021-04-03 16:16:14 -07:00
|
|
|
${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH=$PWD/lib ctest -E "($(echo "$disabledTests" | tr " " "|"))"
|
2020-01-10 12:19:01 -08:00
|
|
|
|
2019-12-16 04:39:21 -08:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
enableParallelChecking = false;
|
2013-12-13 02:16:40 -08:00
|
|
|
|
2021-01-21 09:00:13 -08:00
|
|
|
meta = with lib; {
|
2013-12-13 02:16:40 -08:00
|
|
|
description = "Library for scalable cross-language services";
|
2019-12-16 04:39:21 -08:00
|
|
|
homepage = "http://thrift.apache.org/";
|
2014-03-12 05:14:00 -07:00
|
|
|
license = licenses.asl20;
|
2014-10-09 09:57:18 -07:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2014-03-12 05:14:00 -07:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2013-12-13 02:16:40 -08:00
|
|
|
};
|
|
|
|
}
|