diff options
Diffstat (limited to 'script')
| -rwxr-xr-x | script/build-libgit2-static.sh | 18 | ||||
| -rwxr-xr-x | script/build-libgit2.sh | 13 | ||||
| -rwxr-xr-x | script/with-static.sh | 11 |
3 files changed, 29 insertions, 13 deletions
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh new file mode 100755 index 0000000..b4d4241 --- /dev/null +++ b/script/build-libgit2-static.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -ex + +VENDORED_PATH=vendor/libgit2 + +cd $VENDORED_PATH && +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/build-libgit2.sh b/script/build-libgit2.sh deleted file mode 100755 index 8376a15..0000000 --- a/script/build-libgit2.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -set -ex - -git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 libgit2 - -cd libgit2 -cmake -DTHREADSAFE=ON \ - -DBUILD_CLAR=OFF \ - -DCMAKE_INSTALL_PREFIX=$PWD/install \ - . - -make install diff --git a/script/with-static.sh b/script/with-static.sh new file mode 100755 index 0000000..0caed5e --- /dev/null +++ b/script/with-static.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -ex + +export BUILD="$PWD/vendor/libgit2/build" +export PCFILE="$BUILD/libgit2.pc" + +export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD $(pkg-config --static --libs $PCFILE)" +export CGO_CFLAGS="-I$PWD/vendor/libgit2/include" + +$@ |
