File tree Expand file tree Collapse file tree 6 files changed +22
-5
lines changed Expand file tree Collapse file tree 6 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ build-libgit2:
5
5
cat ./vendor/libgit2/libgit2.pc
6
6
cat ./vendor/install/lib/pkgconfig/libgit2.pc
7
7
8
- test : build-libgit2
9
- ./script/with-static.sh go test ./...
8
+ test : install build-libgit2
9
+ ./script/with-static.sh go test
10
+ ./script/with-less-static.sh go test ./settings
10
11
11
12
install : build-libgit2
12
13
./script/with-static.sh go install ./...
Original file line number Diff line number Diff line change 1
1
package git
2
2
3
3
/*
4
- #cgo pkg-config: --static libgit2
5
4
#include <git2.h>
6
5
#include <git2/errors.h>
7
6
*/
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ cd $VENDORED_PATH
9
9
cmake -DTHREADSAFE=ON \
10
10
-DBUILD_CLAR=OFF \
11
11
-DBUILD_SHARED_LIBS=OFF \
12
+ -DCMAKE_C_FLAGS=-fPIC \
12
13
-DCMAKE_INSTALL_PREFIX=../install \
13
14
.
14
15
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -ex
4
+
5
+ export INSTALL_LOCATION=$PWD /vendor/install
6
+ export PKG_CONFIG_PATH=$INSTALL_LOCATION /lib/pkgconfig
7
+
8
+ export PCFILE=" $PWD /vendor/libgit2/libgit2.pc"
9
+
10
+ export CGO_LDFLAGS=" $( pkg-config --static --libs $PCFILE ) "
11
+ export CGO_CFLAGS=" $( pkg-config --static --cflags $PCFILE ) "
12
+
13
+ $@
Original file line number Diff line number Diff line change 4
4
5
5
export INSTALL_LOCATION=$PWD /vendor/install
6
6
export PKG_CONFIG_PATH=$INSTALL_LOCATION /lib/pkgconfig
7
- export CGO_LDFLAGS=' -lrt'
7
+
8
+ export PCFILE=" $PWD /vendor/libgit2/libgit2.pc"
9
+
10
+ export CGO_LDFLAGS=" $PWD /vendor/libgit2/libgit2.a $( pkg-config --static --libs $PCFILE ) "
11
+ export CGO_CFLAGS=" $( pkg-config --static --cflags $PCFILE ) "
8
12
9
13
$@
Original file line number Diff line number Diff line change 1
1
package settings
2
2
3
3
/*
4
- #cgo pkg-config: --static libgit2
5
4
#include <git2.h>
6
5
7
6
int _go_git_opts_get_search_path(int level, git_buf *buf)
You can’t perform that action at this time.
0 commit comments