diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-06-13 12:15:44 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2020-06-13 12:15:44 +0300 |
commit | b0158178925484c058e6175e174b639237532c63 (patch) | |
tree | f981d2d715e6ef7de67c2dab6f3195fd7fa46341 /build | |
parent | fa2e337cbdd88ccd297d25fa9847225211801d3e (diff) |
Squashed 'gitstatus/' changes from 38d62a47..1c74c8db
1c74c8db add linux-ppc64le
968779b5 fix tar invocation
300f657c create anonymous tar archives
a5581d18 force C locale during build (perl complains)
2616cd47 support downloads to usrbin
1e6075dd enable static linking on linux
2975d25f update libgit2 ref
bea6f868 add ppc64le target
git-subtree-dir: gitstatus
git-subtree-split: 1c74c8db0f422aa6f95ced878351e0c6944a9bd6
Diffstat (limited to 'build')
-rwxr-xr-x | build | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -9,6 +9,8 @@ if [ -n "${ZSH_VERSION:-}" ]; then emulate sh -o err_exit -o no_unset fi +export LC_ALL=C + usage="$(command cat <<\END Usage: build [-m ARCH] [-c CPU] [-d CMD] [-i IMAGE] [-s] [-w] @@ -52,7 +54,7 @@ if [ "$(narg $workdir)" != 1 -o -z "${workdir##*:*}" ]; then exit 1 fi -appname=gitstatusd-"$gitstatus_kernel"-"$gitstatus_arch" +appname=gitstatusd libgit2_tmp="$outdir"/deps/"$appname".libgit2.tmp cleanup() { @@ -68,8 +70,16 @@ trap cleanup INT QUIT TERM ILL PIPE if [ -n "$gitstatus_install_tools" ]; then case "$gitstatus_kernel" in linux) - command apk update - command apk add binutils cmake gcc g++ git make musl-dev perl-utils + if command -v apk >/dev/null 2>&1; then + command apk update + command apk add binutils cmake gcc g++ git make musl-dev perl-utils + elif command -v apt-get >/dev/null 2>&1; then + apt-get update + apt-get install -y binutils cmake gcc g++ make wget + else + >&2 echo "[error] -s is not supported on this system" + exit 1 + fi ;; freebsd) command pkg install -y cmake gmake binutils gcc git perl5 @@ -110,8 +120,8 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in - ppc64le) archflag="-mcpu";; - *) archflag="-march";; + powerpc64le) archflag="-mcpu";; + *) archflag="-march";; esac cflags="$archflag=$gitstatus_cpu -fno-plt" @@ -131,9 +141,7 @@ gitstatus_make=make case "$gitstatus_kernel" in linux) - if [ -n "$docker_cmd" ]; then - gitstatus_ldflags="$gitstatus_ldflags -static" - fi + gitstatus_ldflags="$gitstatus_ldflags -static" gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; @@ -446,9 +454,6 @@ case "$gitstatus_kernel" in ;; esac fi - elif [ -n "$gitstatus_install_tools" ]; then - >&2 echo '[error] -s without -d is not supported on linux' - exit 1 fi ;; freebsd|netbsd|darwin) |