Merge pull request #338 from libgit2/cmn/variable-subst
Use variable substitution instead of a wrapper script
This commit is contained in:
commit
4eecbd8d44
|
@ -5,10 +5,6 @@ sudo: required
|
||||||
install: ./script/install-libgit2.sh
|
install: ./script/install-libgit2.sh
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.1
|
|
||||||
- 1.2
|
|
||||||
- 1.3
|
|
||||||
- 1.4
|
|
||||||
- 1.5
|
- 1.5
|
||||||
- 1.6
|
- 1.6
|
||||||
- 1.7
|
- 1.7
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -5,7 +5,7 @@ build-libgit2:
|
||||||
|
|
||||||
test: build-libgit2
|
test: build-libgit2
|
||||||
go run script/check-MakeGitError-thread-lock.go
|
go run script/check-MakeGitError-thread-lock.go
|
||||||
./script/with-static.sh go test ./...
|
go test ./...
|
||||||
|
|
||||||
install: build-libgit2
|
install: build-libgit2
|
||||||
./script/with-static.sh go install ./...
|
go install ./...
|
||||||
|
|
11
README.md
11
README.md
|
@ -22,7 +22,7 @@ to use a version of git2go which will work against libgit2 v0.22 and dynamically
|
||||||
|
|
||||||
import "github.com/libgit2/git2go"
|
import "github.com/libgit2/git2go"
|
||||||
|
|
||||||
to use the version which works against the latest release.
|
to use the 'master' branch, which works against the latest release of libgit2, whichever that one is at the time.
|
||||||
|
|
||||||
### From `next`
|
### From `next`
|
||||||
|
|
||||||
|
@ -44,15 +44,14 @@ libgit2 uses OpenSSL and LibSSH2 for performing encrypted network connections. F
|
||||||
Running the tests
|
Running the tests
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
For the stable version, `go test` will work as usual. For the `next` branch, similarly to installing, running the tests requires linking against the local libgit2 library, so the Makefile provides a wrapper
|
For the stable version, `go test` will work as usual. For the `next` branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built
|
||||||
|
|
||||||
make test
|
make test
|
||||||
|
|
||||||
Alternatively, if you want to pass arguments to `go test`, you can use the script that sets it all up
|
Alternatively, you can build the library manually first and then run the tests
|
||||||
|
|
||||||
./script/with-static.sh go test -v
|
./script/build-libgit2-static.sh
|
||||||
|
go test -v
|
||||||
which will run the specified arguments with the correct environment variables.
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
4
git.go
4
git.go
|
@ -1,6 +1,10 @@
|
||||||
package git
|
package git
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
#cgo CFLAGS: -I${SRCDIR}/vendor/libgit2/include
|
||||||
|
#cgo LDFLAGS: -L${SRCDIR}/vendor/libgit2/build/ -lgit2
|
||||||
|
#cgo windows LDFLAGS: -lwinhttp
|
||||||
|
#cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
#include <git2/sys/openssl.h>
|
#include <git2/sys/openssl.h>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/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"
|
|
||||||
|
|
||||||
$@
|
|
Loading…
Reference in New Issue