From 064629428296914c4a5875f8da6b557d55f82930 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Tue, 3 Jun 2014 18:35:09 +0200 Subject: Move some logic into the Makefile This should provide a nice compromise between the scripts and comon commands. --- script/build-libgit2-static.sh | 16 +++++++--------- script/build-libgit2.sh | 13 ------------- script/with-static.sh | 6 ++---- 3 files changed, 9 insertions(+), 26 deletions(-) delete mode 100755 script/build-libgit2.sh (limited to 'script') diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh index c896de8..04c649d 100755 --- a/script/build-libgit2-static.sh +++ b/script/build-libgit2-static.sh @@ -2,21 +2,19 @@ set -ex +VENDORED_PATH=vendor/libgit2 + # Make sure we have the latest libgit2 -if [ -d libgit2 ]; then - cd libgit2 - git fetch origin development - git checkout FETCH_HEAD - cd .. -else - git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 libgit2 +if [ ! -d $VENDORED_PATH ]; then + git clone --depth 1 --single-branch git://github.com/libgit2/libgit2 $VENDORED_PATH fi -cd libgit2 +cd $VENDORED_PATH + cmake -DTHREADSAFE=ON \ -DBUILD_CLAR=OFF \ -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_INSTALL_PREFIX=$PWD/install \ + -DCMAKE_INSTALL_PREFIX=../install \ . make install 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 index fe91334..e92edec 100755 --- a/script/with-static.sh +++ b/script/with-static.sh @@ -2,9 +2,7 @@ set -ex -export LIBGIT2_LOCATION=$PWD/libgit2/install -export PKG_CONFIG_PATH=$LIBGIT2_LOCATION/lib/pkgconfig -export LIBGIT2_A=$LIBGIT2_LOCATION/lib/libgit2.a -export CGO_LDFLAGS="$LIBGIT2_A $(pkg-config --static --libs libgit2)" +export INSTALL_LOCATION=$PWD/vendor/install +export PKG_CONFIG_PATH=$INSTALL_LOCATION/lib/pkgconfig $@ -- cgit v1.2.3