zeromq: fix errors, use external libpgm, add devel
zeromq gets a makeover to fix build errors and to offer the devel version. This has been tested with clang and llvm from XCode-4.4.1. * Add a devel block * Add a dep on libpgm, a new formula. The internal libpgm is b0rked * Add a `do_config` function that gets run for devel or head builds. * Add ENV.universal_binary for devel and head, it works. * Add conditionals so that the manual lipo to UB is only for stable Fixes Homebrew/homebrew#14210 Closes Homebrew/homebrew#14292. Signed-off-by: Adam Vandenberg <flangy@gmail.com>master
parent
a928797043
commit
43e306f612
|
@ -1,7 +1,7 @@
|
||||||
require 'formula'
|
require 'formula'
|
||||||
|
|
||||||
def pgm_flags
|
def pgm_flags
|
||||||
return ARGV.include?('--with-pgm') ? "--with-pgm" : ""
|
return build.include? '--with-pgm' ? '--with-system-pgm' : ''
|
||||||
end
|
end
|
||||||
|
|
||||||
class Zeromq < Formula
|
class Zeromq < Formula
|
||||||
|
@ -11,6 +11,14 @@ class Zeromq < Formula
|
||||||
|
|
||||||
head 'https://github.com/zeromq/libzmq.git'
|
head 'https://github.com/zeromq/libzmq.git'
|
||||||
|
|
||||||
|
devel do
|
||||||
|
url 'http://download.zeromq.org/zeromq-3.2.0-rc1.tar.gz'
|
||||||
|
sha1 '1a5195a61150c0a653798e5babde70f473a8a3b0'
|
||||||
|
end
|
||||||
|
|
||||||
|
depends_on 'pkg-config' => :build
|
||||||
|
depends_on 'libpgm' if build.include? 'with-pgm'
|
||||||
|
|
||||||
if build.head?
|
if build.head?
|
||||||
depends_on :automake
|
depends_on :automake
|
||||||
depends_on :libtool
|
depends_on :libtool
|
||||||
|
@ -24,6 +32,7 @@ class Zeromq < Formula
|
||||||
option :universal
|
option :universal
|
||||||
option 'with-pgm', 'Build with PGM extension'
|
option 'with-pgm', 'Build with PGM extension'
|
||||||
|
|
||||||
|
# This can be removed at stable >= 3.2.0 because ENV.universal_binary works.
|
||||||
def build_fat
|
def build_fat
|
||||||
# make 32-bit
|
# make 32-bit
|
||||||
system "CFLAGS=\"$CFLAGS -arch i386\" CXXFLAGS=\"$CXXFLAGS -arch i386\" ./configure --disable-dependency-tracking --prefix='#{prefix}' #{pgm_flags}"
|
system "CFLAGS=\"$CFLAGS -arch i386\" CXXFLAGS=\"$CXXFLAGS -arch i386\" ./configure --disable-dependency-tracking --prefix='#{prefix}' #{pgm_flags}"
|
||||||
|
@ -42,15 +51,29 @@ class Zeromq < Formula
|
||||||
"-output", "src/.libs/libzmq.1.dylib"
|
"-output", "src/.libs/libzmq.1.dylib"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def do_config
|
||||||
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
||||||
|
if build.include? 'with-pgm'
|
||||||
|
# Use HB libpgm-5.2 because their internal 5.1 is b0rked.
|
||||||
|
ENV['OpenPGM_CFLAGS'] = %x[pkg-config --cflags openpgm-5.2].chomp
|
||||||
|
ENV['OpenPGM_LIBS'] = %x[pkg-config --libs openpgm-5.2].chomp
|
||||||
|
args << "--with-system-pgm"
|
||||||
|
end
|
||||||
|
system "./configure", *args
|
||||||
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
system "./autogen.sh" if build.head?
|
system "./autogen.sh" if build.head?
|
||||||
|
|
||||||
if ARGV.build_universal?
|
if build.universal?
|
||||||
build_fat
|
if build.devel? or build.head?
|
||||||
|
ENV.universal_binary
|
||||||
|
do_config
|
||||||
else
|
else
|
||||||
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
build_fat
|
||||||
args << "--with-pgm" if build.include? 'with-pgm'
|
end
|
||||||
system "./configure", *args
|
else
|
||||||
|
do_config
|
||||||
end
|
end
|
||||||
|
|
||||||
system "make"
|
system "make"
|
||||||
|
|
Loading…
Reference in New Issue