serf: fix build

This commit is contained in:
Robin Gloster 2017-08-08 20:33:33 +02:00
parent 0ff782e141
commit f4ca99166a
No known key found for this signature in database
GPG Key ID: 5E4C836C632C2882

View File

@ -1,4 +1,5 @@
{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, kerberos, pkgconfig, gnused }:
{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, kerberos
, pkgconfig, gnused, expat, openldap }:
stdenv.mkDerivation rec {
name = "serf-1.3.9";
@ -8,18 +9,22 @@ stdenv.mkDerivation rec {
sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ apr scons openssl aprutil zlib ]
++ stdenv.lib.optional (!stdenv.isCygwin) kerberos
++ [ pkgconfig ];
++ stdenv.lib.optional (!stdenv.isCygwin) kerberos;
configurePhase = ''
${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"PATH":os.environ["PATH"]})' -i SConstruct
${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_CFLAGS_COMPILE":os.environ["NIX_CFLAGS_COMPILE"]})' -i SConstruct
${gnused}/bin/sed -e '/^env[.]Append(BUILDERS/ienv.Append(ENV={"NIX_LDFLAGS":os.environ["NIX_LDFLAGS"]})' -i SConstruct
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
'';
buildPhase = ''
scons PREFIX="$out" OPENSSL="${openssl.dev}" ZLIB="${zlib.dev}" APR="$(echo "${apr.dev}"/bin/*-config)" \
scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr.dev}"/bin/*-config)" CFLAGS="-I${zlib.dev}/include" \
LINKFLAGS="-L${zlib.out}/lib -L${expat}/lib -L${openldap}/lib" \
APU="$(echo "${aprutil.dev}"/bin/*-config)" CC="${
if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc"
}" ${