aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-05-20 20:31:17 -0500
committerJack Nagel2013-05-20 20:37:05 -0500
commit92a033411a976e91c79e5a7fb7e01373c5c7726b (patch)
tree436ad562204800087729aefe959cec12c28eeed8
parent659bfa4c97b952e2c92b3e4675a6a8f33f065f39 (diff)
downloadhomebrew-92a033411a976e91c79e5a7fb7e01373c5c7726b.tar.bz2
zeromq: apply patch for strndup on 10.6
Fixes #19877.
-rw-r--r--Library/Formula/zeromq.rb48
1 files changed, 45 insertions, 3 deletions
diff --git a/Library/Formula/zeromq.rb b/Library/Formula/zeromq.rb
index 2ffce9f4a..7496639b1 100644
--- a/Library/Formula/zeromq.rb
+++ b/Library/Formula/zeromq.rb
@@ -7,6 +7,9 @@ class Zeromq < Formula
head 'https://github.com/zeromq/libzmq.git'
+ option :universal
+ option 'with-pgm', 'Build with PGM extension'
+
depends_on 'pkg-config' => :build
depends_on 'libpgm' if build.include? 'with-pgm'
@@ -20,8 +23,9 @@ class Zeromq < Formula
cause "Segfault while linking"
end
- option :universal
- option 'with-pgm', 'Build with PGM extension'
+ # Address lack of strndup on 10.6, fixed upstream
+ # https://github.com/zeromq/zeromq3-x/commit/400cbc208a768c4df5039f401dd2688eede6e1ca
+ def patches; DATA; end
def install
ENV.universal_binary if build.universal?
@@ -44,10 +48,48 @@ class Zeromq < Formula
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
you may need to do:
- ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=#{HOMEBREW_PREFIX}
+ ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=#{opt_prefix}
If you want to build the Java bindings from https://github.com/zeromq/jzmq
you will need the Java Developer Package from http://connect.apple.com/
EOS
end
end
+
+__END__
+diff --git a/tests/test_disconnect_inproc.cpp b/tests/test_disconnect_inproc.cpp
+index 7875083..d6b68c6 100644
+--- a/tests/test_disconnect_inproc.cpp
++++ b/tests/test_disconnect_inproc.cpp
+@@ -40,16 +40,14 @@ int main(int argc, char** argv) {
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+ zmq_msg_recv (&msg, pubSocket, 0);
+- int msgSize = zmq_msg_size(&msg);
+ char* buffer = (char*)zmq_msg_data(&msg);
+
+ if (buffer[0] == 0) {
+ assert(isSubscribed);
+- printf("unsubscribing from '%s'\n", strndup(buffer + 1, msgSize - 1));
+ isSubscribed = false;
+- } else {
++ }
++ else {
+ assert(!isSubscribed);
+- printf("subscribing on '%s'\n", strndup(buffer + 1, msgSize - 1));
+ isSubscribed = true;
+ }
+
+@@ -66,11 +64,6 @@ int main(int argc, char** argv) {
+ zmq_msg_t msg;
+ zmq_msg_init (&msg);
+ zmq_msg_recv (&msg, subSocket, 0);
+- int msgSize = zmq_msg_size(&msg);
+- char* buffer = (char*)zmq_msg_data(&msg);
+-
+- printf("received on subscriber '%s'\n", strndup(buffer, msgSize));
+-
+ zmq_getsockopt (subSocket, ZMQ_RCVMORE, &more, &more_size);
+ zmq_msg_close (&msg);
+
+