Use a submodule for libgit2

This makes building the static version easier as we know where the repo
is and that it's has a known-good version.
This commit is contained in:
Carlos Martín Nieto 2014-06-07 02:58:28 +02:00
parent 0646294282
commit c734fc2a6b
5 changed files with 13 additions and 11 deletions

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "libgit2"]
path = libgit2
url = ./vendor/libgit2
[submodule "vendor/libgit2"]
path = vendor/libgit2
url = https://github.com/libgit2/libgit2

View File

@ -3,11 +3,6 @@ default: test
build-libgit2: build-libgit2:
./script/build-libgit2-static.sh ./script/build-libgit2-static.sh
update-libgit2:
cd vendor/libgit2 && \
git fetch origin development && \
git checkout -qf FETCH_HEAD
test: build-libgit2 test: build-libgit2
./script/with-static.sh go test ./... ./script/with-static.sh go test ./...

View File

@ -6,7 +6,12 @@ Go bindings for [libgit2](http://libgit2.github.com/). These bindings are for to
Installing Installing
---------- ----------
Just `go get github.com/libgit2/git2go`. You'll need to have top-of-the-branch libgit2 from development installed in your system and available via `pkg-config`. These bindings are in sync with the top of `development`. This project needs libgit2, which is written in C so we need to take an extra step. Run `go get github.com/libgit2/git2go` and go to your `$GOROOT/src/github.com/libgt2/git2go` dir. From there, we need to build the C code and put it into the resulting go binary.
git submodule update --init
make install
will compile libgit2, build it statically into git2go and install the resulting object file where your Go project can use it.
License License
------- -------

View File

@ -4,11 +4,6 @@ set -ex
VENDORED_PATH=vendor/libgit2 VENDORED_PATH=vendor/libgit2
# Make sure we have the latest libgit2
if [ ! -d $VENDORED_PATH ]; then
git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 $VENDORED_PATH
fi
cd $VENDORED_PATH cd $VENDORED_PATH
cmake -DTHREADSAFE=ON \ cmake -DTHREADSAFE=ON \

1
vendor/libgit2 vendored Submodule

@ -0,0 +1 @@
Subproject commit 716e20b47eb82ebd94588fe6c950e661b6fe4f15