libgit2: universal option

Adds an universal option to libgit2.

Closes Homebrew/homebrew#35154.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Dominyk Tiller 2014-12-20 19:55:57 +00:00 committed by Jack Nagel
parent 892ec233c4
commit 9e3ba4c598

View file

@ -1,7 +1,7 @@
require "formula"
class Libgit2 < Formula
homepage "http://libgit2.github.com/"
homepage "https://libgit2.github.com/"
url "https://github.com/libgit2/libgit2/archive/v0.21.3.tar.gz"
sha1 "d116cb15f76edf2283c85da40389e4fecc8d5aeb"
@ -14,16 +14,24 @@ class Libgit2 < Formula
sha1 "059ee25e0a3d46ad685b3d55394ae1c8a007da70" => :mountain_lion
end
option :universal
depends_on "cmake" => :build
depends_on "libssh2" => :optional
depends_on "openssl"
def install
args = std_cmake_args
args << "-DBUILD_TESTS=NO"
if build.universal?
ENV.universal_binary
args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.universal_archs.as_cmake_arch_flags}"
end
mkdir "build" do
system "cmake", "..",
"-DBUILD_TESTS=NO",
*std_cmake_args
system "make install"
system "cmake", "..", *args
system "make", "install"
end
end
end