mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
thrift: build with CMake; add pkgsStatic support
This commit is contained in:
parent
a244885c63
commit
0a21b32234
@ -1,6 +1,5 @@
|
|||||||
{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkgconfig, bison
|
{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkgconfig
|
||||||
, flex, twisted
|
, bison, flex, twisted, static ? false }:
|
||||||
}:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "thrift";
|
pname = "thrift";
|
||||||
@ -11,27 +10,36 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0yai9c3bdsrkkjshgim7zk0i7malwfprg00l9774dbrkh2w4ilvs";
|
sha256 = "0yai9c3bdsrkkjshgim7zk0i7malwfprg00l9774dbrkh2w4ilvs";
|
||||||
};
|
};
|
||||||
|
|
||||||
#enableParallelBuilding = true; problems on hydra
|
|
||||||
|
|
||||||
# Workaround to make the python wrapper not drop this package:
|
# Workaround to make the python wrapper not drop this package:
|
||||||
# pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
|
# pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
|
||||||
pythonPath = [];
|
pythonPath = [];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ cmake pkgconfig ];
|
||||||
buildInputs = [
|
buildInputs = [ boost zlib libevent openssl python bison flex ]
|
||||||
boost zlib libevent openssl python bison flex twisted
|
++ stdenv.lib.optional (!static) twisted;
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = "export PY_PREFIX=$out";
|
preConfigure = "export PY_PREFIX=$out";
|
||||||
|
|
||||||
# TODO: package boost-test, so we can run the test suite. (Currently it fails
|
cmakeFlags = [
|
||||||
# to find libboost_unit_test_framework.a.)
|
# FIXME: Fails to link in static mode with undefined reference to
|
||||||
configureFlags = [ "--enable-tests=no" ];
|
# `boost::unit_test::unit_test_main(bool (*)(), int, char**)'
|
||||||
doCheck = false;
|
"-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; {
|
meta = with stdenv.lib; {
|
||||||
description = "Library for scalable cross-language services";
|
description = "Library for scalable cross-language services";
|
||||||
homepage = http://thrift.apache.org/;
|
homepage = "http://thrift.apache.org/";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
maintainers = [ maintainers.bjornfor ];
|
maintainers = [ maintainers.bjornfor ];
|
||||||
|
@ -55,7 +55,7 @@ self: super: let
|
|||||||
removeUnknownConfigureFlags = f: with self.lib;
|
removeUnknownConfigureFlags = f: with self.lib;
|
||||||
remove "--disable-shared"
|
remove "--disable-shared"
|
||||||
(remove "--enable-static" f);
|
(remove "--enable-static" f);
|
||||||
|
|
||||||
ocamlFixPackage = b:
|
ocamlFixPackage = b:
|
||||||
b.overrideAttrs (o: {
|
b.overrideAttrs (o: {
|
||||||
configurePlatforms = [ ];
|
configurePlatforms = [ ];
|
||||||
@ -63,7 +63,7 @@ self: super: let
|
|||||||
buildInputs = o.buildInputs ++ o.nativeBuildInputs or [ ];
|
buildInputs = o.buildInputs ++ o.nativeBuildInputs or [ ];
|
||||||
propagatedNativeBuildInputs = o.propagatedBuildInputs or [ ];
|
propagatedNativeBuildInputs = o.propagatedBuildInputs or [ ];
|
||||||
});
|
});
|
||||||
|
|
||||||
ocamlStaticAdapter = _: super:
|
ocamlStaticAdapter = _: super:
|
||||||
self.lib.mapAttrs
|
self.lib.mapAttrs
|
||||||
(_: p: if p ? overrideAttrs then ocamlFixPackage p else p)
|
(_: p: if p ? overrideAttrs then ocamlFixPackage p else p)
|
||||||
@ -170,6 +170,10 @@ in {
|
|||||||
# --disable-shared flag
|
# --disable-shared flag
|
||||||
stdenv = super.stdenv;
|
stdenv = super.stdenv;
|
||||||
};
|
};
|
||||||
|
thrift = super.thrift.override {
|
||||||
|
static = true;
|
||||||
|
twisted = null;
|
||||||
|
};
|
||||||
double-conversion = super.double-conversion.override {
|
double-conversion = super.double-conversion.override {
|
||||||
static = true;
|
static = true;
|
||||||
};
|
};
|
||||||
@ -227,7 +231,7 @@ in {
|
|||||||
kmod = super.kmod.override {
|
kmod = super.kmod.override {
|
||||||
withStatic = true;
|
withStatic = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
curl = super.curl.override {
|
curl = super.curl.override {
|
||||||
# a very sad story: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
|
# a very sad story: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
|
||||||
gssSupport = false;
|
gssSupport = false;
|
||||||
@ -263,6 +267,6 @@ in {
|
|||||||
ocaml-ng = self.lib.mapAttrs (_: set:
|
ocaml-ng = self.lib.mapAttrs (_: set:
|
||||||
if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set
|
if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set
|
||||||
) super.ocaml-ng;
|
) super.ocaml-ng;
|
||||||
|
|
||||||
python27 = super.python27.override { static = true; };
|
python27 = super.python27.override { static = true; };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user