From 9609a835ca2eb3089e35269a05369833e9ec0ba2 Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 21 Dec 2020 16:19:22 +0100 Subject: 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 --- build | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'build') 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" -- cgit v1.2.3