summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2018-06-09 05:56:48 +0000
committerOrivej Desh <orivej@gmx.fr>2018-06-09 06:08:15 +0000
commit5d960b51c66f7dff154a9ddda76296269bf922ee (patch)
tree6a6932ec3c74a56207a1f612affbd696947ebdbb /pkgs/development/libraries
parent2b1915b9f6755ef50fadca585d6fc97ab4388bed (diff)
downloadnixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar.gz
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar.bz2
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar.lz
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar.xz
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.tar.zst
nixpkgs-5d960b51c66f7dff154a9ddda76296269bf922ee.zip
serf: update scons patch, enable kerberos on darwin
NIX_CFLAGS_COMPILE set by the old patch is long not recognized by cc wrappers.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/serf/default.nix35
-rw-r--r--pkgs/development/libraries/serf/scons.patch12
2 files changed, 30 insertions, 17 deletions
diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix
index 62d8bcccfe3..dfaf1c679dd 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 00000000000..a7eefe7d5c1
--- /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 = {