libgit2: build, install examples.

These example programs can be useful for e.g. comparing `git status`
behaviour between `git` and `libgit2`.

Closes Homebrew/homebrew#47719.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2016-01-05 15:27:45 +00:00
parent a934d84259
commit 55bffb6ace

View file

@ -21,6 +21,7 @@ class Libgit2 < Formula
def install
args = std_cmake_args
args << "-DBUILD_EXAMPLES=YES"
args << "-DBUILD_CLAR=NO" # Don't build tests.
args << "-DUSE_SSH=NO" if build.without? "libssh2"
@ -32,6 +33,13 @@ class Libgit2 < Formula
mkdir "build" do
system "cmake", "..", *args
system "make", "install"
cd "examples" do
(pkgshare/"examples").install "add", "blame", "cat-file", "cgit2",
"describe", "diff", "for-each-ref",
"general", "init", "log", "remote",
"rev-list", "rev-parse", "showindex",
"status", "tag"
end
end
end