2010-03-25 04:45:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Zeromq <Formula
|
2010-11-10 21:21:22 +00:00
|
|
|
url 'http://www.zeromq.org/local--files/area:download/zeromq-2.0.10.tar.gz'
|
2010-10-09 02:16:19 +00:00
|
|
|
head 'git://github.com/zeromq/zeromq2.git'
|
2010-03-25 04:45:05 +00:00
|
|
|
homepage 'http://www.zeromq.org/'
|
2010-11-10 21:21:22 +00:00
|
|
|
md5 'ab794a174210b9e8096a4efd1d1a4d42'
|
2010-03-25 04:45:05 +00:00
|
|
|
|
2010-09-30 08:20:45 +00:00
|
|
|
def options
|
|
|
|
[['--universal', 'Build as a Universal Intel binary.']]
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_fat
|
|
|
|
# make 32-bit
|
|
|
|
arch = "-arch i386"
|
|
|
|
system "CFLAGS=\"$CFLAGS #{arch}\" CXXFLAGS=\"$CXXFLAGS #{arch}\" ./configure --disable-dependency-tracking --prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "mv src/.libs src/libs-32"
|
|
|
|
system "make clean"
|
|
|
|
|
|
|
|
# make 64-bit
|
|
|
|
arch = "-arch x86_64"
|
|
|
|
system "CFLAGS=\"$CFLAGS #{arch}\" CXXFLAGS=\"$CXXFLAGS #{arch}\" ./configure --disable-dependency-tracking --prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "mv src/.libs/libzmq.0.dylib src/.libs/libzmq.64.dylib"
|
|
|
|
|
|
|
|
# merge UB
|
|
|
|
system "lipo", "-create", "src/libs-32/libzmq.0.dylib", "src/.libs/libzmq.64.dylib", "-output", "src/.libs/libzmq.0.dylib"
|
|
|
|
end
|
|
|
|
|
2010-03-25 04:45:05 +00:00
|
|
|
def install
|
2010-08-18 21:20:22 +00:00
|
|
|
fails_with_llvm "Compiling with LLVM gives a segfault while linking."
|
2010-09-30 08:20:45 +00:00
|
|
|
|
2010-10-09 02:16:19 +00:00
|
|
|
system "./autogen.sh" if ARGV.build_head?
|
|
|
|
|
2010-09-30 08:20:45 +00:00
|
|
|
if ARGV.include? '--universal'
|
|
|
|
build_fat
|
|
|
|
else
|
|
|
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
|
|
|
end
|
|
|
|
|
2010-03-25 04:45:05 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2010-09-09 20:17:14 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2010-09-30 08:20:45 +00:00
|
|
|
To install the zmq gem on 10.6 with the system Ruby on a 64-bit machine,
|
|
|
|
you may need to do:
|
2010-09-09 20:17:14 +00:00
|
|
|
$ ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=#{HOMEBREW_PREFIX}
|
2010-11-12 15:43:28 +00:00
|
|
|
|
2010-11-10 21:21:22 +00:00
|
|
|
If you want to later build the Java bindings from https://github.com/zeromq/jzmq,
|
|
|
|
you will need to obtain the Java Developer Package from Apple ADC
|
|
|
|
at http://connect.apple.com/.
|
2010-09-09 20:17:14 +00:00
|
|
|
EOS
|
|
|
|
end
|
2010-09-30 08:20:45 +00:00
|
|
|
end
|