From a600443bb30e4895bf9d05ba309578be6f8ab951 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 3 Feb 2015 23:11:44 -0800 Subject: [PATCH] fix obscure bug in apr on darwin --- .../libraries/apr/darwin_fix_configure.patch | 17 ----------------- pkgs/development/libraries/apr/default.nix | 2 +- .../libraries/apr/is-this-a-compiler-bug.patch | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 pkgs/development/libraries/apr/darwin_fix_configure.patch create mode 100644 pkgs/development/libraries/apr/is-this-a-compiler-bug.patch diff --git a/pkgs/development/libraries/apr/darwin_fix_configure.patch b/pkgs/development/libraries/apr/darwin_fix_configure.patch deleted file mode 100644 index 84d3f207870..00000000000 --- a/pkgs/development/libraries/apr/darwin_fix_configure.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -Nuar apr-1.4.6/configure apr-1.4.6-darwin-fix-configure/configure ---- apr-1.4.6/configure 2012-02-08 00:17:57.000000000 +0100 -+++ apr-1.4.6-darwin-fix-configure/configure 2012-06-06 23:08:56.000000000 +0200 -@@ -6854,10 +6854,10 @@ - *-apple-darwin*) - - if test "x$CPPFLAGS" = "x"; then -- test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp\"" -- CPPFLAGS="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp" -+ test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK\"" -+ CPPFLAGS="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK" - else -- apr_addto_bugger="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp" -+ apr_addto_bugger="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK" - for i in $apr_addto_bugger; do - apr_addto_duplicate="0" - for j in $CPPFLAGS; do diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix index c2737b20eff..3810a47fac3 100644 --- a/pkgs/development/libraries/apr/default.nix +++ b/pkgs/development/libraries/apr/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1b4qw686bwjn19iyb0lg918q23xxd6s2gnyczhjq992d3m1vwjp9"; }; - patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin_fix_configure.patch ]; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ]; configureFlags = # Including the Windows headers breaks unistd.h. diff --git a/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch b/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch new file mode 100644 index 00000000000..bbc10fabb26 --- /dev/null +++ b/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch @@ -0,0 +1,17 @@ +--- apr-1.5.1/file_io/unix/filestat.c 2014-11-01 06:42:50.000000000 -0400 ++++ apr-1.5.1/file_io/unix/filestat.c.new 2014-11-01 07:07:32.000000000 -0400 +@@ -297,9 +297,11 @@ + finfo->pool = pool; + finfo->fname = fname; + fill_out_finfo(finfo, &info, wanted); +- if (wanted & APR_FINFO_LINK) +- wanted &= ~APR_FINFO_LINK; +- return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; ++ if (wanted & APR_FINFO_LINK) { ++ return ((wanted & ~APR_FINFO_LINK) & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; ++ } else { ++ return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS; ++ } + } + else { + #if !defined(ENOENT) || !defined(ENOTDIR)