Fix http_parser build on darwin

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-05-28 17:37:47 -04:00
parent c982e84df4
commit 2794d74506

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gyp, utillinux }:
{ stdenv, fetchurl, gyp, utillinux, python }:
let
version = "2.1";
@ -16,9 +16,9 @@ in stdenv.mkDerivation {
buildFlags = [ "BUILDTYPE=Release" ];
buildInputs = [ gyp ] ++ stdenv.lib.optional stdenv.isLinux utillinux;
buildInputs = [ gyp ] ++ (stdenv.lib.optional stdenv.isLinux utillinux) ++ stdenv.lib.optional stdenv.isDarwin python;
doCheck = true;
doCheck = !stdenv.isDarwin;
checkPhase = ''
out/Release/test-nonstrict
@ -26,13 +26,18 @@ in stdenv.mkDerivation {
'';
installPhase = ''
mkdir -p $out
mv out/Release/lib.target $out/lib
mkdir -p $out/lib
mv out/Release/${if stdenv.isDarwin then "*.dylib" else "lib.target/*"} $out/lib
mkdir -p $out/include
mv http_parser.h $out/include
'';
postFixup = if stdenv.isDarwin then ''
install_name_tool -id $out/lib/libhttp_parser.dylib $out/lib/libhttp_parser.dylib
install_name_tool -id $out/lib/libhttp_parser_strict.dylib $out/lib/libhttp_parser_strict.dylib
'' else null;
meta = {
description = "An HTTP message parser written in C";