summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2020-12-21 18:19:22 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2020-12-21 18:19:22 +0300
commit9609a835ca2eb3089e35269a05369833e9ec0ba2 (patch)
treef2f71d41e7ee6e74ef42587e2edea2b17e632185 /build
parent29759b7b0a83e08ce52dd240c9463f2c8090c416 (diff)
Squashed 'gitstatus/' changes from 630915cc..6d00edd0
6d00edd0 use a native binary on darwin-arm64 4994f160 add a build server for darwin-arm64 0e922813 invoke port with sudo 576571c7 support macports in addition to homebrew when building on macos b476570a remove trailing whitespace git-subtree-dir: gitstatus git-subtree-split: 6d00edd0bfd1d65a3cbcebfc6e679e8c43726acc
Diffstat (limited to 'build')
-rwxr-xr-xbuild35
1 files changed, 22 insertions, 13 deletions
diff --git a/build b/build
index cbd8ce1f..ad1d1484 100755
--- a/build
+++ b/build
@@ -98,17 +98,20 @@ if [ -n "$gitstatus_install_tools" ]; then
>&2 echo "[error] please run 'xcode-select --install' and retry"
exit 1
fi
- if ! command -v brew >/dev/null 2>&1; then
- >&2 echo "[error] please install homebrew from https://brew.sh/ and retry"
+ if command -v port >/dev/null 2>&1; then
+ sudo port -N install libiconv cmake wget
+ elif command -v brew >/dev/null 2>&1; then
+ for formula in libiconv cmake git wget; do
+ if command brew list "$formula" &>/dev/null; then
+ command brew upgrade "$formula"
+ else
+ command brew install "$formula"
+ fi
+ done
+ else
+ >&2 echo "[error] please install MacPorts or Homebrew and retry"
exit 1
fi
- for formula in libiconv cmake git wget; do
- if command brew list "$formula" &>/dev/null; then
- command brew upgrade "$formula"
- else
- command brew install "$formula"
- fi
- done
;;
msys*|mingw*)
command pacman -Syu --noconfirm
@@ -165,11 +168,17 @@ case "$gitstatus_kernel" in
;;
darwin)
command mkdir -- "$workdir"/lib
- brew_prefix="$(command brew --prefix)"
- command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib
+ if [ -e /opt/local/lib/libiconv.a ]; then
+ command ln -s -- /opt/local/lib/libiconv.a "$workdir"/lib
+ libgit2_cflags="$libgit2_cflags -I/opt/local/include"
+ gitstatus_cxxflags="$gitstatus_cxxflags -I/opt/local/include"
+ else
+ brew_prefix="$(command brew --prefix)"
+ command ln -s -- "$brew_prefix"/opt/libiconv/lib/libiconv.a "$workdir"/lib
+ libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include"
+ gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include"
+ fi
libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON"
- libgit2_cflags="$libgit2_cflags -I"$brew_prefix"/opt/libiconv/include"
- gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix"/opt/libiconv/include"
gitstatus_ldlibs="$gitstatus_ldlibs -liconv"
gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib"
libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF"