From 5d960b51c66f7dff154a9ddda76296269bf922ee Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sat, 9 Jun 2018 05:56:48 +0000 Subject: [PATCH] serf: update scons patch, enable kerberos on darwin NIX_CFLAGS_COMPILE set by the old patch is long not recognized by cc wrappers. --- pkgs/development/libraries/serf/default.nix | 35 +++++++++++---------- pkgs/development/libraries/serf/scons.patch | 12 +++++++ 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 pkgs/development/libraries/serf/scons.patch diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 62d8bcccfe36..dfaf1c679dd7 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -13,31 +13,32 @@ stdenv.mkDerivation rec { buildInputs = [ apr scons openssl aprutil zlib libiconv ] ++ 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"]})' \ - -i SConstruct - ''; + patches = [ ./scons.patch ]; buildPhase = '' - scons PREFIX="$out" OPENSSL="${openssl}" ZLIB="${zlib}" APR="$(echo "${apr.dev}"/bin/*-config)" CFLAGS="-I${zlib.dev}/include" \ - LINKFLAGS="-L${zlib.out}/lib -L${openldap}/lib -L${libiconv}/lib" \ - APU="$(echo "${aprutil.dev}"/bin/*-config)" CC=$CC ${ - if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos.dev}\"" - } + scons \ + -j $NIX_BUILD_CORES \ + APR="$(echo ${apr.dev}/bin/*-config)" \ + APU="$(echo ${aprutil.dev}/bin/*-config)" \ + CC=$CC \ + OPENSSL=${openssl} \ + PREFIX="$out" \ + ZLIB=${zlib} \ + ${ + if stdenv.isCygwin then "" else "GSSAPI=${kerberos.dev}" + } ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-L/usr/lib"; - installPhase = '' scons install ''; - meta = { + enableParallelBuilding = true; + + meta = with stdenv.lib; { description = "HTTP client library based on APR"; - license = stdenv.lib.licenses.asl20; - maintainers = [stdenv.lib.maintainers.raskin]; - platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + license = licenses.asl20; + maintainers = with maintainers; [ orivej raskin ]; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/development/libraries/serf/scons.patch b/pkgs/development/libraries/serf/scons.patch new file mode 100644 index 000000000000..a7eefe7d5c1f --- /dev/null +++ b/pkgs/development/libraries/serf/scons.patch @@ -0,0 +1,12 @@ +diff --git a/SConstruct b/SConstruct +index 4358a23..0d862e7 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -155,6 +155,7 @@ if sys.platform == 'win32': + env = Environment(variables=opts, + tools=('default', 'textfile',), + CPPPATH=['.', ], ++ ENV=os.environ, + ) + + env.Append(BUILDERS = {