From 83235bf1b6ce8f99073546ecf18cbd84ba72b222 Mon Sep 17 00:00:00 2001 From: Dossy Shiobara Date: Fri, 9 Mar 2012 15:18:12 -0500 Subject: gearman: apply patch to fix configure In gearman-0.28, configure.ac has some bad copypasta that ends up breaking the build on platforms that do not have librt, such as MacOS X. configure.ac -- 173 # Check for -lrt 174 AC_CHECK_LIB([rt], [clock_gettime], 175 [ 176 RT_LIB="-lrt" 177 AC_SUBST(RT_LIB) 178 AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime]) 179 ], 180 [ 181 AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime]) 182 ]) 183 184 # Check for -lm 185 AC_CHECK_LIB([m], [floor], 186 [ 187 M_LIB="-lrt" 188 AC_SUBST(M_LIB) 189 AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime]) 190 ], 191 [ 192 AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime]) 193 ]) As the comment on line 184 indicates, it's supposed to be checking for libm, not librt. This commit corrects this, which fixes issue #10222. Closes #10823. Signed-off-by: Jack Nagel --- Library/Formula/gearman.rb | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'Library') diff --git a/Library/Formula/gearman.rb b/Library/Formula/gearman.rb index 85d36ecb8..bb052433e 100644 --- a/Library/Formula/gearman.rb +++ b/Library/Formula/gearman.rb @@ -9,6 +9,12 @@ class Gearman < Formula depends_on 'libevent' depends_on 'ossp-uuid' + def patches + # gearman-0.28 build error "ld: library not found for -lrt" + # see https://bugs.launchpad.net/gearmand/+bug/951198 + DATA + end + def install system "./configure", "--prefix=#{prefix}" system "make install" @@ -54,3 +60,46 @@ class Gearman < Formula EOPLIST end end + +__END__ +--- gearmand-0.28/configure.ac.orig 2012-03-09 14:56:28.000000000 -0500 ++++ gearmand-0.28/configure.ac 2012-03-09 14:56:58.000000000 -0500 +@@ -184,12 +184,12 @@ + # Check for -lm + AC_CHECK_LIB([m], [floor], + [ +- M_LIB="-lrt" ++ M_LIB="-lm" + AC_SUBST(M_LIB) +- AC_DEFINE([HAVE_LIBRT], [ 1 ], [Have clock_gettime]) ++ AC_DEFINE([HAVE_LIBM], [ 1 ], [Have floor]) + ], + [ +- AC_DEFINE([HAVE_LIBRT], [ 0 ], [Have clock_gettime]) ++ AC_DEFINE([HAVE_LIBM], [ 0 ], [Have floor]) + ]) + + AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)]) + +--- gearmand-0.28/configure.orig 2012-03-09 15:06:11.000000000 -0500 ++++ gearmand-0.28/configure 2012-03-09 15:06:45.000000000 -0500 +@@ -25755,16 +25790,16 @@ + $as_echo "$ac_cv_lib_m_floor" >&6; } + if test "x$ac_cv_lib_m_floor" = xyes; then : + +- M_LIB="-lrt" ++ M_LIB="-lm" + + +-$as_echo "#define HAVE_LIBRT 1 " >>confdefs.h ++$as_echo "#define HAVE_LIBM 1 " >>confdefs.h + + + else + + +-$as_echo "#define HAVE_LIBRT 0 " >>confdefs.h ++$as_echo "#define HAVE_LIBM 0 " >>confdefs.h + + + fi -- cgit v1.2.3