diff options
| author | MinRK | 2010-09-30 01:20:45 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-02 08:25:48 -0700 |
| commit | 3e7a07b9c2642a08691a1260986de62e97ff4f84 (patch) | |
| tree | 961509a70220154aab06395f080fb6a3ee532875 /Library/Formula | |
| parent | 4a67f2d8cc9e462beb6fe1182ac364921cac2534 (diff) | |
| download | homebrew-3e7a07b9c2642a08691a1260986de62e97ff4f84.tar.bz2 | |
zeromq universal build with "--universal"
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/zeromq.rb | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/Library/Formula/zeromq.rb b/Library/Formula/zeromq.rb index 4c03bba14..db678782e 100644 --- a/Library/Formula/zeromq.rb +++ b/Library/Formula/zeromq.rb @@ -5,15 +5,44 @@ class Zeromq <Formula homepage 'http://www.zeromq.org/' md5 'eadda72ecc5bcfa50a521436e6d92252' + 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 + def install fails_with_llvm "Compiling with LLVM gives a segfault while linking." - system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" + + if ARGV.include? '--universal' + build_fat + else + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" + end + system "make install" end def caveats; <<-EOS.undent - To install the zmq gem on Snow Leopard, on a 64-bit machine: + 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} EOS end -end +end
\ No newline at end of file |
