2011-03-10 05:11:03 +00:00
|
|
|
class Gearman < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Application framework to farm out work to other machines or processes"
|
2014-10-18 20:31:13 +00:00
|
|
|
homepage "http://gearman.org/"
|
|
|
|
url "https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz"
|
2015-04-02 14:57:56 +00:00
|
|
|
sha256 "973d7a3523141a84c7b757c6f243febbc89a3631e919b532c056c814d8738acb"
|
2014-09-12 07:30:17 +00:00
|
|
|
|
2014-09-14 15:08:35 +00:00
|
|
|
bottle do
|
2015-04-02 15:48:11 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "a3eaa2cb9241381c6679fe9f9547c0477ba0f1b860f97a405b4f4d8d8b0d7c81" => :yosemite
|
|
|
|
sha256 "a843fcbaf51130d36e86362fd832444de1815c1e546b3590b257eada0e6c6597" => :mavericks
|
|
|
|
sha256 "0637f412fcb5d0c324c9d63120bd8ea4809d826e729d1c357438c690f95ae954" => :mountain_lion
|
2014-09-14 15:08:35 +00:00
|
|
|
end
|
|
|
|
|
2014-10-18 20:31:13 +00:00
|
|
|
option "with-mysql", "Compile with MySQL persistent queue enabled"
|
|
|
|
option "with-postgresql", "Compile with Postgresql persistent queue enabled"
|
2014-09-12 07:30:17 +00:00
|
|
|
|
2014-10-18 20:31:13 +00:00
|
|
|
# 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
|
2014-09-12 07:30:17 +00:00
|
|
|
|
2014-10-18 20:31:13 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "boost"
|
|
|
|
depends_on "libevent"
|
|
|
|
depends_on "libpqxx" if build.with? "postgresql"
|
2013-06-26 02:19:59 +00:00
|
|
|
depends_on :mysql => :optional
|
2014-01-12 20:53:13 +00:00
|
|
|
depends_on :postgresql => :optional
|
2014-09-12 07:30:17 +00:00
|
|
|
depends_on "hiredis" => :optional
|
|
|
|
depends_on "libmemcached" => :optional
|
2014-10-18 20:31:13 +00:00
|
|
|
depends_on "openssl" => :optional
|
|
|
|
depends_on "cyassl" => :optional
|
|
|
|
depends_on "tokyo-cabinet" => :optional
|
2009-12-22 05:49:18 +00:00
|
|
|
|
2014-09-12 07:30:17 +00:00
|
|
|
def install
|
2014-10-18 20:31:13 +00:00
|
|
|
# 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"
|
2014-01-12 20:53:13 +00:00
|
|
|
end
|
2014-09-12 07:30:17 +00:00
|
|
|
|
|
|
|
args = [
|
|
|
|
"--prefix=#{prefix}",
|
2015-04-02 14:57:56 +00:00
|
|
|
"--localstatedir=#{var}",
|
2014-10-18 20:31:13 +00:00
|
|
|
"--disable-silent-rules",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--disable-libdrizzle",
|
2015-05-05 13:39:53 +00:00
|
|
|
"--with-boost=#{Formula["boost"].opt_prefix}",
|
2014-09-12 07:30:17 +00:00
|
|
|
"--with-sqlite3"
|
|
|
|
]
|
|
|
|
|
2014-10-18 20:31:13 +00:00
|
|
|
if build.with? "cyassl"
|
|
|
|
args << "--enable-ssl" << "--enable-cyassl"
|
|
|
|
elsif build.with? "openssl"
|
2015-05-05 13:39:53 +00:00
|
|
|
args << "--enable-ssl" << "--with-openssl=#{Formula["openssl"].opt_prefix}" << "--disable-cyassl"
|
2014-10-18 20:31:13 +00:00
|
|
|
else
|
|
|
|
args << "--disable-ssl" << "--disable-cyassl"
|
2014-09-12 07:30:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? "postgresql"
|
2014-10-18 20:31:13 +00:00
|
|
|
args << "--enable-libpq" << "--with-postgresql=#{Formula["postgresql"].opt_bin}/pg_config"
|
2014-09-12 07:30:17 +00:00
|
|
|
else
|
|
|
|
args << "--disable-libpq" << "--without-postgresql"
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? "libmemcached"
|
2014-10-18 20:31:13 +00:00
|
|
|
args << "--enable-libmemcached" << "--with-memcached=#{Formula["memcached"].opt_bin}/memcached"
|
2014-09-12 07:30:17 +00:00
|
|
|
else
|
|
|
|
args << "--disable-libmemcached" << "--without-memcached"
|
|
|
|
end
|
|
|
|
|
2015-04-02 14:57:56 +00:00
|
|
|
args << "--disable-libtokyocabinet" if build.without? "tokyo-cabinet"
|
2014-10-18 20:31:13 +00:00
|
|
|
|
|
|
|
args << (build.with?("mysql") ? "--with-mysql=#{Formula["mysql"].opt_bin}/mysql_config" : "--without-mysql")
|
2014-09-12 07:30:17 +00:00
|
|
|
args << (build.with?("hiredis") ? "--enable-hiredis" : "--disable-hiredis")
|
|
|
|
|
2014-10-18 20:31:13 +00:00
|
|
|
ENV.append_to_cflags "-DHAVE_HTONLL"
|
2015-04-02 14:57:56 +00:00
|
|
|
|
|
|
|
(var/"log").mkpath
|
2013-05-31 11:46:43 +00:00
|
|
|
system "./configure", *args
|
2014-10-18 20:31:13 +00:00
|
|
|
system "make", "install"
|
2011-10-12 14:45:48 +00:00
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
plist_options :manual => "gearmand -d"
|
2011-10-12 14:45:48 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
|
|
|
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>Program</key>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_sbin}/gearmand</string>
|
2012-11-25 15:06:41 +00:00
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
2011-10-12 14:45:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
2009-11-14 09:32:52 +00:00
|
|
|
end
|
2014-10-18 20:31:13 +00:00
|
|
|
|
|
|
|
__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)
|
|
|
|
{
|