From 5f3a9d76b86efa91d8f1ee26277484419bc95f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sun, 28 Jun 2015 13:17:14 +0200 Subject: [PATCH] travis: don't install libgit2 for 'next' branch We have our own libgit2 in a submodule, so this is unnecessary. While in the area, update which version of libgit2 would be downloaded and remove unnecessary CMake flags. --- .travis.yml | 9 +-------- script/install-libgit2.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 script/install-libgit2.sh diff --git a/.travis.yml b/.travis.yml index 9341639..fb080b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,7 @@ language: go sudo: false -install: - - cd "${HOME}" - - wget -O libgit2-0.22.1.tar.gz https://github.com/libgit2/libgit2/archive/v0.22.1.tar.gz - - tar -xzvf libgit2-0.22.1.tar.gz - - cd libgit2-0.22.1 && mkdir build && cd build - - cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr/local .. && make && sudo make install - - sudo ldconfig - - cd "${TRAVIS_BUILD_DIR}" +install: ./script/install-libgit2.sh go: - 1.1 diff --git a/script/install-libgit2.sh b/script/install-libgit2.sh new file mode 100644 index 0000000..a6c3202 --- /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.22.3.tar.gz https://github.com/libgit2/libgit2/archive/v0.22.1.tar.gz +tar -xzvf libgit2-0.22.3.tar.gz +cd libgit2-0.22.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}"