nixpkgs/pkgs/development/libraries/serf/default.nix

43 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, kerberos, pkgconfig, gnused }:
2014-08-05 11:41:32 +02:00
stdenv.mkDerivation rec {
2014-09-02 12:44:44 +02:00
name = "serf-1.3.7";
2014-08-05 11:41:32 +02:00
src = fetchurl {
2014-08-05 11:41:32 +02:00
url = "http://serf.googlecode.com/svn/src_releases/${name}.tar.bz2";
2014-08-31 16:36:07 +02:00
sha256 = "1bphz616dv1svc50kkm8xbgyszhg3ni2dqbij99sfvjycr7bgk7c";
};
buildInputs = [ apr scons openssl aprutil zlib ]
++ stdenv.lib.optional (!stdenv.isCygwin) kerberos
++ [ pkgconfig ];
2014-08-05 11:41:32 +02:00
configurePhase = ''
2014-08-21 04:30:50 +02:00
${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
'';
buildPhase = ''
scons PREFIX="$out" OPENSSL="${openssl.dev}" ZLIB="${zlib.dev}" APR="$(echo "${apr.dev}"/bin/*-config)" \
APU="$(echo "${aprutil.dev}"/bin/*-config)" CC="${
if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc"
}" ${
if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos}\""
}
'';
2014-08-17 22:17:13 +02:00
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib";
installPhase = ''
scons install
'';
meta = {
description = "HTTP client library based on APR";
2014-09-02 12:44:44 +02:00
license = stdenv.lib.licenses.asl20;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}