Skip to content

Commit 1f96cc2

Browse files
committed
updated build process
1 parent 8ae7454 commit 1f96cc2

File tree

6 files changed

+61
-10
lines changed

6 files changed

+61
-10
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@ go:
88
- "1.10"
99

1010
before_install:
11-
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo apt-get install -y curl libcurl3 libcurl3-gnutls libcurl4-gnutls-dev; fi
1211
- $GOPATH/src/github.com/git-time-metric/gtm/script/git2go-init.sh
13-
- cd $GOPATH/src/github.com/libgit2/git2go
14-
- make install-static
12+
- $GOPATH/src/github.com/git-time-metric/gtm/script/build-libgit2-${TRAVIS_OS_NAME}.sh
1513
- go get github.com/mattn/goveralls
1614

1715
before_deploy:
1816
- go build -v --tags static -ldflags "-X main.Version=${TRAVIS_TAG}"
1917
- tar -zcf gtm.${TRAVIS_TAG}.${TRAVIS_OS_NAME}.tar.gz gtm
2018

2119
script:
22-
- cd $TRAVIS_BUILD_DIR
2320
- go get -d ./...
2421
- $HOME/gopath/bin/goveralls -v -flags=--tags=static -service=travis-ci
2522

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fmt:
1717

1818
install-git2go:
1919
./script/git2go-init.sh
20-
cd ${GOPATH}/src/github.com/libgit2/git2go && make install-static
20+
./script/build-libgit2-osx.sh
2121

2222
install:
2323
go install --tags static ${LDFLAGS}

script/appveyor-build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
23
set -ex
34

45
export PATH=/c/msys64/mingw64/bin:/c/msys64/usr/bin:/c/Go/bin:/c/gopath/go/bin:$PATH
@@ -20,6 +21,7 @@ cmake -DTHREADSAFE=ON \
2021
-DUSE_BUNDLED_ZLIB=ON \
2122
-DUSE_HTTPS=OFF \
2223
-DUSE_SSH=OFF \
24+
-DCURL=OFF \
2325
-G "MSYS Makefiles" \
2426
.. &&
2527

script/build-libgit2-linux.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
pushd ${PWD}
6+
7+
cd ${GOPATH}/src/github.com/libgit2/git2go/vendor/libgit2 &&
8+
mkdir -p install/lib &&
9+
mkdir -p build &&
10+
cd build &&
11+
cmake -DTHREADSAFE=ON \
12+
-DBUILD_CLAR=OFF \
13+
-DBUILD_SHARED_LIBS=OFF \
14+
-DCMAKE_C_FLAGS=-fPIC \
15+
-DUSE_SSH=OFF \
16+
-DCURL=OFF \
17+
-DUSE_HTTPS=OFF \
18+
-DUSE_BUNDLED_ZLIB=ON \
19+
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
20+
-DCMAKE_INSTALL_PREFIX=../install \
21+
.. &&
22+
23+
cmake --build .
24+
25+
popd

script/build-libgit2-osx.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
pushd ${PWD}
6+
7+
cd ${GOPATH}/src/github.com/libgit2/git2go/vendor/libgit2 &&
8+
mkdir -p install/lib &&
9+
mkdir -p build &&
10+
cd build &&
11+
cmake -DTHREADSAFE=ON \
12+
-DBUILD_CLAR=OFF \
13+
-DBUILD_SHARED_LIBS=OFF \
14+
-DCMAKE_C_FLAGS=-fPIC \
15+
-DUSE_SSH=OFF \
16+
-DCURL=OFF \
17+
-DUSE_HTTPS=OFF \
18+
-DUSE_BUNDLED_ZLIB=ON \
19+
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
20+
-DCMAKE_INSTALL_PREFIX=../install \
21+
.. &&
22+
23+
cmake --build .
24+
25+
popd

script/git2go-init.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
23
set -ex
34

5+
pushd ${PWD}
6+
47
COMMIT_HASH=v27
58
PROJPATH="$GOPATH/src/github.com/libgit2/git2go"
69
[ ! -f "$GOPATH/src/github.com/libgit2/git2go/.git/config" ] && git clone https://github.com/libgit2/git2go.git $PROJPATH
710
cd $PROJPATH
811
git checkout -qf $COMMIT_HASH
912
git submodule update --init
10-
# sed -i -- 's/ZLIB_FOUND/FALSE/g' $PROJPATH/vendor/libgit2/CMakeLists.txt
11-
# sed -i -- 's/OPENSSL_FOUND/FALSE/g' $PROJPATH/vendor/libgit2/CMakeLists.txt
12-
sed -i -- 's/USE_SSH.*"Link with libssh to enable SSH support".*ON/USE_SSH "Link with libssh to enable SSH support" OFF/g' $PROJPATH/vendor/libgit2/CMakeLists.txt
13+
14+
popd

0 commit comments

Comments
 (0)