diff options
Diffstat (limited to 'script')
| -rwxr-xr-x | script/build-libgit2-static.sh | 19 | ||||
| -rw-r--r-- | script/check-MakeGitError-thread-lock.go | 2 | ||||
| -rwxr-xr-x | script/install-libgit2.sh | 21 | ||||
| -rwxr-xr-x | script/with-static.sh | 12 |
4 files changed, 54 insertions, 0 deletions
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh new file mode 100755 index 0000000..5723721 --- /dev/null +++ b/script/build-libgit2-static.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -ex + +VENDORED_PATH=vendor/libgit2 + +cd $VENDORED_PATH && +mkdir -p install/lib && +mkdir -p build && +cd build && +cmake -DTHREADSAFE=ON \ + -DBUILD_CLAR=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_C_FLAGS=-fPIC \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_INSTALL_PREFIX=../install \ + .. && + +cmake --build . diff --git a/script/check-MakeGitError-thread-lock.go b/script/check-MakeGitError-thread-lock.go index f6b01b3..77411f7 100644 --- a/script/check-MakeGitError-thread-lock.go +++ b/script/check-MakeGitError-thread-lock.go @@ -1,3 +1,5 @@ +// +build ignore + package main import ( diff --git a/script/install-libgit2.sh b/script/install-libgit2.sh new file mode 100755 index 0000000..9bf6b37 --- /dev/null +++ b/script/install-libgit2.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# +# Install libgit2 to git2go in dynamic mode on Travis +# + +set -ex + +# We don't want to build libgit2 on the next branch, as we carry a +# submodule with the exact version we support +if [ "x$TRAVIS_BRANCH" = "xnext" ]; then + exit 0 +fi + +cd "${HOME}" +wget -O libgit2-0.23.1.tar.gz https://github.com/libgit2/libgit2/archive/v0.23.1.tar.gz +tar -xzvf libgit2-0.23.1.tar.gz +cd libgit2-0.23.1 && mkdir build && cd build +cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DCMAKE_BUILD_TYPE="RelWithDebInfo" .. && make && sudo make install +sudo ldconfig +cd "${TRAVIS_BUILD_DIR}" diff --git a/script/with-static.sh b/script/with-static.sh new file mode 100755 index 0000000..3f60e31 --- /dev/null +++ b/script/with-static.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -ex + +export BUILD="$PWD/vendor/libgit2/build" +export PCFILE="$BUILD/libgit2.pc" + +FLAGS=$(pkg-config --static --libs $PCFILE) || exit 1 +export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD ${FLAGS}" +export CGO_CFLAGS="-I$PWD/vendor/libgit2/include" + +$@ |
