diff options
author | Cem Keylan <cem@ckyln.com> | 2020-08-16 21:55:52 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-08-16 21:55:52 +0300 |
commit | e3c736853c7b779015378577f982b02e278b96e6 (patch) | |
tree | a0541275f746aea3b535534bfff22e00e4ab50e2 | |
parent | f5bd021afb8accf1ecc185766224325efbd4949b (diff) | |
download | repository-e3c736853c7b779015378577f982b02e278b96e6.tar.gz |
git: build statically
-rwxr-xr-x | extra/git/build | 18 | ||||
-rw-r--r-- | extra/git/depends | 7 |
2 files changed, 22 insertions, 3 deletions
diff --git a/extra/git/build b/extra/git/build index ee3d4ad1..f871efed 100755 --- a/extra/git/build +++ b/extra/git/build @@ -14,6 +14,8 @@ NO_CROSS_DIRECTORY_HARDLINKS=1 NO_INSTALL_HARDLINKS=1 EOF +export LDFLAGS="$LDFLAGS -static" + ./configure \ --prefix=/usr \ --with-curl \ @@ -26,3 +28,19 @@ make DESTDIR="$1" install for man in man1/*.1 man5/*.5 man7/*.7; do install -Dm644 "$man" "$1/usr/share/man/$man" done + + +# Build and install remote-http helper. This doesn't happen by default when +# building static git. +export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -I$PWD -I$PWD/compat/regex -I$PWD/xdiff -include config.h" +for obj in http http-walker; do + # shellcheck disable=2086 + "${CC:=cc}" $CFLAGS -c "$obj.c" +done + +# shellcheck disable=2086 +"$CC" -static $CFLAGS -o "$1/usr/libexec/git-core/git-remote-http" remote-curl.c http.o http-walker.o libgit.a common-main.o xdiff/lib.a $(pkg-config --static --libs zlib libcurl) + +for remote in https ftp ftps; do + ln -sf git-remote-http "$1/usr/libexec/git-core/git-remote-$remote" +done diff --git a/extra/git/depends b/extra/git/depends index bbeee5d6..0a37ab16 100644 --- a/extra/git/depends +++ b/extra/git/depends @@ -1,3 +1,4 @@ -bearssl -curl -zlib +bearssl make +curl make +pkgconf make +zlib make |