Skip to content

Commit 9c5fb97

Browse files
committed
Get rid of the with-static.sh script
CGO can perform variable substitution in the directives, so we don't need to use a script to set up the variables; we can let the go tool do it for us.
1 parent 9af9dd3 commit 9c5fb97

4 files changed

Lines changed: 11 additions & 20 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-libgit2:
55

66
test: build-libgit2
77
go run script/check-MakeGitError-thread-lock.go
8-
./script/with-static.sh go test ./...
8+
go test ./...
99

1010
install: build-libgit2
11-
./script/with-static.sh go install ./...
11+
go install ./...

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to use a version of git2go which will work against libgit2 v0.22 and dynamically
2222

2323
import "github.com/libgit2/git2go"
2424

25-
to use the version which works against the latest release.
25+
to use the 'master' branch, which works against the latest release of libgit2, whichever that one is at the time.
2626

2727
### From `next`
2828

@@ -44,15 +44,14 @@ libgit2 uses OpenSSL and LibSSH2 for performing encrypted network connections. F
4444
Running the tests
4545
-----------------
4646

47-
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
47+
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
4848

4949
make test
5050

51-
Alternatively, if you want to pass arguments to `go test`, you can use the script that sets it all up
51+
Alternatively, you can build the library manually first and then run the tests
5252

53-
./script/with-static.sh go test -v
54-
55-
which will run the specified arguments with the correct environment variables.
53+
./script/build-libgit2-static.sh
54+
go test -v
5655

5756
License
5857
-------

git.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package git
22

33
/*
4+
#cgo CFLAGS: -I${SRCDIR}/vendor/libgit2/include
5+
#cgo LDFLAGS: -L${SRCDIR}/vendor/libgit2/build/ -lgit2
6+
#cgo windows LDFLAGS: -lwinhttp
7+
#cgo !windows pkg-config: --static ${SRCDIR}/vendor/libgit2/build/libgit2.pc
48
#include <git2.h>
59
#include <git2/sys/openssl.h>
610

script/with-static.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)