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 | 4d14f9e0ba94770c55b28c2839c71dda47f97d9c (patch) | |
tree | 95f588831e52a0eaa61c8d98a19e3c03e44ffd34 /gitstatus/build | |
parent | faa510d54c30b9384ee7f4a95b9d04f5c6a8cf62 (diff) | |
parent | b0158178925484c058e6175e174b639237532c63 (diff) |
Merge commit 'b0158178925484c058e6175e174b639237532c63'
Diffstat (limited to 'gitstatus/build')
-rwxr-xr-x | gitstatus/build | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/gitstatus/build b/gitstatus/build index 78d57ec5..6023c210 100755 --- a/gitstatus/build +++ b/gitstatus/build @@ -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) |