2017-08-08 20:33:33 +02:00
|
|
|
{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, kerberos
|
2017-08-09 23:53:08 +02:00
|
|
|
, pkgconfig, gnused, expat, openldap, libiconv }:
|
2014-08-05 11:41:32 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-02-03 01:56:15 +01:00
|
|
|
name = "serf-1.3.9";
|
2014-08-05 11:41:32 +02:00
|
|
|
|
2013-12-30 20:32:53 +01:00
|
|
|
src = fetchurl {
|
2017-02-03 01:56:15 +01:00
|
|
|
url = "https://www.apache.org/dist/serf/${name}.tar.bz2";
|
|
|
|
sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
|
2013-12-30 20:32:53 +01:00
|
|
|
};
|
|
|
|
|
2017-08-08 20:33:33 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-08-09 23:53:08 +02:00
|
|
|
buildInputs = [ apr scons openssl aprutil zlib libiconv ]
|
2017-08-08 20:33:33 +02:00
|
|
|
++ stdenv.lib.optional (!stdenv.isCygwin) kerberos;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' \
|
|
|
|
-e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' \
|
|
|
|
-e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' \
|
|
|
|
-e 's,$OPENSSL/lib,${openssl.out}/lib,' \
|
|
|
|
-e 's,$OPENSSL/include,${openssl.dev}/include,' \
|
|
|
|
-i SConstruct
|
2013-12-30 20:32:53 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2017-08-08 20:33:33 +02:00
|
|
|
scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr.dev}"/bin/*-config)" CFLAGS="-I${zlib.dev}/include" \
|
2017-08-09 23:53:08 +02:00
|
|
|
LINKFLAGS="-L${zlib.out}/lib -L${expat}/lib -L${openldap}/lib -L${libiconv}/lib" \
|
2016-04-16 18:41:43 +02:00
|
|
|
APU="$(echo "${aprutil.dev}"/bin/*-config)" CC="${
|
FreeBSD: apr-util, cyrus-sasl, berkeley db, glib, gnutls, kerberos, libelf-freebsd, openldap, serf, guile, tet, shishi, gawk, gnugrep
2015-11-28 01:46:00 +01:00
|
|
|
if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc"
|
2015-01-02 21:47:21 +01:00
|
|
|
}" ${
|
2017-12-17 14:51:32 +01:00
|
|
|
if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos.dev}\""
|
2015-01-02 21:47:21 +01:00
|
|
|
}
|
2013-12-30 20:32:53 +01:00
|
|
|
'';
|
|
|
|
|
2014-08-17 22:17:13 +02:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib";
|
|
|
|
|
2013-12-30 20:32:53 +01:00
|
|
|
installPhase = ''
|
|
|
|
scons install
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "HTTP client library based on APR";
|
2014-09-02 12:44:44 +02:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2013-12-30 20:32:53 +01:00
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
2016-08-02 16:50:15 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
2013-12-30 20:32:53 +01:00
|
|
|
};
|
|
|
|
}
|