diff options
| author | Dominyk Tiller | 2014-12-25 22:43:29 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2015-01-06 17:29:06 +0000 | 
| commit | d1a428a249a0c1a88e03195bb96fc42a4cc1db2c (patch) | |
| tree | 91ea71366c9e7329cb19dcdafb82d256b83e1df1 | |
| parent | 45345682a8dd634e2020688ec8fd5824b05020ba (diff) | |
| download | homebrew-d1a428a249a0c1a88e03195bb96fc42a4cc1db2c.tar.bz2 | |
apr 1.5.1 (new formula)
Migrates Apr from Homebrew/Apache to Homebrew/Homebrew, adds a
requirement to allow people to use this Apr instead of requiring
people to download the full CLT package. Tested against subversion
with consistent success.
Closes #34987.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Formula/apr-util.rb | 31 | ||||
| -rw-r--r-- | Library/Formula/apr.rb | 29 | ||||
| -rw-r--r-- | Library/Homebrew/requirements/apr_dependency.rb | 39 | 
3 files changed, 99 insertions, 0 deletions
| diff --git a/Library/Formula/apr-util.rb b/Library/Formula/apr-util.rb new file mode 100644 index 000000000..058519031 --- /dev/null +++ b/Library/Formula/apr-util.rb @@ -0,0 +1,31 @@ +class AprUtil < Formula +  homepage "https://apr.apache.org/" +  url "http://www.apache.org/dyn/closer.cgi?path=apr/apr-util-1.5.4.tar.bz2" +  sha1 "b00038b5081472ed094ced28bcbf2b5bb56c589d" + +  keg_only :provided_by_osx, "Apple's CLT package contains apr." + +  depends_on "apr" +  depends_on "openssl" +  depends_on "postgresql" => :optional + +  def install +    # Stick it in libexec otherwise it pollutes lib with a .exp file. +    args = %W[ +      --prefix=#{libexec} +      --with-apr=#{Formula["apr"].opt_prefix} +      --with-openssl=#{Formula["openssl"].opt_prefix} +    ] + +    args << "--with-pgsql=#{Formula["postgresql"].opt_prefix}" if build.with? "postgresql" + +    system "./configure", *args +    system "make" +    system "make", "install" +    bin.install_symlink Dir["#{libexec}/bin/*"] +  end + +  test do +    system "#{bin}/apu-1-config", "--link-libtool", "--libs" +  end +end diff --git a/Library/Formula/apr.rb b/Library/Formula/apr.rb new file mode 100644 index 000000000..731ee220e --- /dev/null +++ b/Library/Formula/apr.rb @@ -0,0 +1,29 @@ +class Apr < Formula +  homepage "https://apr.apache.org/" +  url "http://www.apache.org/dyn/closer.cgi?path=apr/apr-1.5.1.tar.bz2" +  sha1 "f94e4e0b678282e0704e573b5b2fe6d48bd1c309" + +  keg_only :provided_by_osx, "Apple's CLT package contains apr." + +  def install +    # Configure switch unconditionally adds the -no-cpp-precomp switch +    # to CPPFLAGS, which is an obsolete Apple-only switch that breaks +    # builds under non-Apple compilers and which may or may not do anything anymore. +    # Reported upstream: https://issues.apache.org/bugzilla/show_bug.cgi?id=48483 +    # Upstream bug report still open and unresolved as of end of 2014 +    inreplace "configure", " -no-cpp-precomp", "" + +    # https://issues.apache.org/bugzilla/show_bug.cgi?id=57359 +    # The internal libtool throws an enormous strop if we don't do... +    ENV.deparallelize + +    # Stick it in libexec otherwise it pollutes lib with a .exp file. +    system "./configure", "--prefix=#{libexec}" +    system "make", "install" +    bin.install_symlink Dir["#{libexec}/bin/*"] +  end + +  test do +    system "#{bin}/apr-1-config", "--link-libtool", "--libs" +  end +end diff --git a/Library/Homebrew/requirements/apr_dependency.rb b/Library/Homebrew/requirements/apr_dependency.rb new file mode 100644 index 000000000..f996b5b79 --- /dev/null +++ b/Library/Homebrew/requirements/apr_dependency.rb @@ -0,0 +1,39 @@ +require "requirement" + +class AprDependency < Requirement +  fatal true +  default_formula "apr" + +  satisfy { MacOS::CLT.installed? || Formula["apr"].installed? } + +  env do +    unless MacOS::CLT.installed? +      ENV.prepend_path "PATH", "#{Formula["apr-util"].opt_prefix}/bin" +      ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["apr"].opt_prefix}/libexec/lib/pkgconfig" +      ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["apr-util"].opt_prefix}/libexec/lib/pkgconfig" +    end +  end + +  def message +    message = <<-EOS.undent +      Due to packaging problems on Apple's part, software that compiles +      against APR requires the standalone Command Line Tools. +    EOS +    if MacOS.version >= :mavericks +      message += <<-EOS.undent +        Either +        `brew install apr-util` +        or +        `xcode-select --install` +        to install APR. +      EOS +    else +      message += <<-EOS.undent +        The standalone package can be obtained from +        https://developer.apple.com/downloads/, +        or it can be installed via Xcode's preferences. +        Or you can `brew install apr-util`. +      EOS +    end +  end +end | 
