diff options
| author | Dominyk Tiller | 2014-10-18 21:31:13 +0100 |
|---|---|---|
| committer | Jack Nagel | 2014-10-20 21:00:33 -0500 |
| commit | e2f6412829876ecfc52ce9a2aa5f09314ad9f0ff (patch) | |
| tree | bf52120da6a8026978fc3d781d63d2625dfd561c /Library | |
| parent | 90aa77e3d7839774d58ae8ba339b358d1cb82f7f (diff) | |
| download | homebrew-e2f6412829876ecfc52ce9a2aa5f09314ad9f0ff.tar.bz2 | |
gearman 1.1.12
Closes #33246 (and any other remaining Gearman issue).
Closes #33327.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/gearman.rb | 162 |
1 files changed, 110 insertions, 52 deletions
diff --git a/Library/Formula/gearman.rb b/Library/Formula/gearman.rb index bbf2d567f..a61ad2d3f 100644 --- a/Library/Formula/gearman.rb +++ b/Library/Formula/gearman.rb @@ -1,9 +1,9 @@ -require 'formula' +require "formula" class Gearman < Formula - homepage 'http://gearman.org/' - url "https://launchpad.net/gearmand/1.0/1.0.6/+download/gearmand-1.0.6.tar.gz" - sha1 "872d5e13c20a29a20e45df3afa8f3981dc52d363" + homepage "http://gearman.org/" + url "https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz" + sha1 "85b5271ea3ac919d96fff9500993b73c9dc80c6c" bottle do sha1 "b1d76be880294ad7900c18628674c9853b7d6a14" => :mavericks @@ -11,84 +11,72 @@ class Gearman < Formula sha1 "d09770f6262eed1c7ababa6f06e9659e12694e9a" => :lion end - devel do - url "https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz" - sha1 "85b5271ea3ac919d96fff9500993b73c9dc80c6c" + option "with-mysql", "Compile with MySQL persistent queue enabled" + option "with-postgresql", "Compile with Postgresql persistent queue enabled" - depends_on "cyassl" => :optional - depends_on "openssl" => :optional + # https://bugs.launchpad.net/gearmand/+bug/1318151 - Still ongoing as of 1.1.12 + # https://bugs.launchpad.net/gearmand/+bug/1236815 - Still ongoing as of 1.1.12 + # https://github.com/Homebrew/homebrew/issues/33246 - Still ongoing as of 1.1.12 + patch :DATA - patch :p0 do - # https://bugs.launchpad.net/gearmand/+bug/1318151 - url "https://launchpadlibrarian.net/179708850/gearman-1.1.12-client.cc.patch" - sha1 "1217ca4da09fd0a0e6a7333e89545a3707c550e4" - end - end - - option 'with-mysql', 'Compile with MySQL persistent queue enabled' - option 'with-postgresql', 'Compile with Postgresql persistent queue enabled' - - depends_on 'pkg-config' => :build - depends_on 'boost' - depends_on 'libevent' + depends_on "pkg-config" => :build + depends_on "boost" + depends_on "libevent" + depends_on "libpqxx" if build.with? "postgresql" depends_on :mysql => :optional depends_on :postgresql => :optional - depends_on "libpqxx" if build.with? "postgresql" depends_on "hiredis" => :optional depends_on "libmemcached" => :optional + depends_on "openssl" => :optional + depends_on "cyassl" => :optional + depends_on "tokyo-cabinet" => :optional def install - - if build.stable? && MacOS.version >= :mavericks - # https://bugs.launchpad.net/gearmand/+bug/1236815 - inreplace "configure", "<tr1/", "<" - inreplace "libgearman-1.0/gearman.h", "<tr1/", "<" - end - - if build.devel? - # https://bugs.launchpad.net/gearmand/+bug/1236815 - inreplace "libgearman-1.0/gearman.h", "# include <cinttypes>", "# include \"gear_config.h\"" - - # https://bugs.launchpad.net/gearmand/+bug/1368926 - Dir["tests/**/*.cc", "libtest/main.cc"].each do |test_file| - next unless /std::unique_ptr/ === File.read(test_file) - inreplace test_file, "std::unique_ptr", "std::auto_ptr" - end + # https://bugs.launchpad.net/gearmand/+bug/1368926 + Dir["tests/**/*.cc", "libtest/main.cc"].each do |test_file| + next unless /std::unique_ptr/ === File.read(test_file) + inreplace test_file, "std::unique_ptr", "std::auto_ptr" end args = [ "--prefix=#{prefix}", - "--with-boost=#{Formula['boost'].prefix}", + "--disable-silent-rules", + "--disable-dependency-tracking", + "--disable-libdrizzle", + "--with-boost=#{Formula["boost"].prefix}", "--with-sqlite3" ] - if build.devel? - if build.with? "cyassl" - args << "--enable-ssl" << "--enable-cyassl" - elsif build.with? "openssl" - args << "--enable-ssl" << "--with-openssl=#{Formula['openssl'].prefix}" << "--disable-cyassl" - else - args << "--disable-ssl" << "--disable-cyassl" - end + if build.with? "cyassl" + args << "--enable-ssl" << "--enable-cyassl" + elsif build.with? "openssl" + args << "--enable-ssl" << "--with-openssl=#{Formula["openssl"].prefix}" << "--disable-cyassl" + else + args << "--disable-ssl" << "--disable-cyassl" end if build.with? "postgresql" - args << "--enable-libpq" << "--with-postgresql=#{Formula['postgresql'].opt_bin}/pg_config" + args << "--enable-libpq" << "--with-postgresql=#{Formula["postgresql"].opt_bin}/pg_config" else args << "--disable-libpq" << "--without-postgresql" end if build.with? "libmemcached" - args << "--enable-libmemcached" << "--with-memcached=#{Formula['memcached'].opt_bin}/memcached" + args << "--enable-libmemcached" << "--with-memcached=#{Formula["memcached"].opt_bin}/memcached" else args << "--disable-libmemcached" << "--without-memcached" end - args << (build.with?("mysql") ? "--with-mysql=#{Formula['mysql'].opt_bin}/mysql_config" : "--without-mysql") + if build.without? "tokyo-cabinet" + args << "--disable-libtokyocabinet" + end + + args << (build.with?("mysql") ? "--with-mysql=#{Formula["mysql"].opt_bin}/mysql_config" : "--without-mysql") args << (build.with?("hiredis") ? "--enable-hiredis" : "--disable-hiredis") + ENV.append_to_cflags "-DHAVE_HTONLL" system "./configure", *args - system "make install" + system "make", "install" end plist_options :manual => "gearmand -d" @@ -110,3 +98,73 @@ class Gearman < Formula EOS end end + +__END__ +diff --git a/libgearman-1.0/gearman.h b/libgearman-1.0/gearman.h +index 7f6d5e7..8f7a8f0 100644 +--- a/libgearman-1.0/gearman.h ++++ b/libgearman-1.0/gearman.h +@@ -50,7 +50,11 @@ + #endif + + #ifdef __cplusplus ++#ifdef _LIBCPP_VERSION + # include <cinttypes> ++#else ++# include <tr1/cinttypes> ++#endif + # include <cstddef> + # include <cstdlib> + # include <ctime> + +diff --git a/libgearman/byteorder.cc b/libgearman/byteorder.cc +index 674fed9..96f0650 100644 +--- a/libgearman/byteorder.cc ++++ b/libgearman/byteorder.cc +@@ -65,6 +65,8 @@ static inline uint64_t swap64(uint64_t in) + } + #endif + ++#ifndef HAVE_HTONLL ++ + uint64_t ntohll(uint64_t value) + { + return swap64(value); +@@ -74,3 +76,5 @@ uint64_t htonll(uint64_t value) + { + return swap64(value); + } ++ ++#endif +\ No newline at end of file +diff --git a/libgearman/client.cc b/libgearman/client.cc +index 3db2348..4363b36 100644 +--- a/libgearman/client.cc ++++ b/libgearman/client.cc +@@ -599,7 +599,7 @@ gearman_return_t gearman_client_add_server(gearman_client_st *client_shell, + { + Client* client= client_shell->impl(); + +- if (gearman_connection_create(client->universal, host, port) == false) ++ if (gearman_connection_create(client->universal, host, port) == NULL) + { + assert(client->error_code() != GEARMAN_SUCCESS); + return client->error_code(); +@@ -614,7 +614,7 @@ gearman_return_t gearman_client_add_server(gearman_client_st *client_shell, + + gearman_return_t Client::add_server(const char *host, const char* service_) + { +- if (gearman_connection_create(universal, host, service_) == false) ++ if (gearman_connection_create(universal, host, service_) == NULL) + { + assert(error_code() != GEARMAN_SUCCESS); + return error_code(); +@@ -946,7 +946,7 @@ gearman_return_t gearman_client_job_status(gearman_client_st *client_shell, + *denominator= do_task->impl()->denominator; + } + +- if (is_known == false and is_running == false) ++ if (! is_known and ! is_running) + { + if (do_task->impl()->options.is_running) + { |
