@@ -98,17 +98,20 @@ if [ -n "$gitstatus_install_tools" ]; then
9898 >&2 echo "[error] please run 'xcode-select --install' and retry"
9999 exit 1
100100 fi
101- if ! command -v brew >/dev/null 2>&1; then
102- >&2 echo "[error] please install homebrew from https://brew.sh/ and retry"
101+ if command -v port >/dev/null 2>&1; then
102+ sudo port -N install libiconv cmake wget
103+ elif command -v brew >/dev/null 2>&1; then
104+ for formula in libiconv cmake git wget; do
105+ if command brew list "$formula " &>/dev/null; then
106+ command brew upgrade "$formula "
107+ else
108+ command brew install "$formula "
109+ fi
110+ done
111+ else
112+ >&2 echo "[error] please install MacPorts or Homebrew and retry"
103113 exit 1
104114 fi
105- for formula in libiconv cmake git wget; do
106- if command brew list "$formula " &>/dev/null; then
107- command brew upgrade "$formula "
108- else
109- command brew install "$formula "
110- fi
111- done
112115 ;;
113116 msys*|mingw*)
114117 command pacman -Syu --noconfirm
@@ -165,11 +168,17 @@ case "$gitstatus_kernel" in
165168 ;;
166169 darwin)
167170 command mkdir -- "$workdir "/lib
168- brew_prefix="$( command brew --prefix) "
169- command ln -s -- "$brew_prefix "/opt/libiconv/lib/libiconv.a "$workdir "/lib
171+ if [ -e /opt/local/lib/libiconv.a ]; then
172+ command ln -s -- /opt/local/lib/libiconv.a "$workdir "/lib
173+ libgit2_cflags="$libgit2_cflags -I/opt/local/include"
174+ gitstatus_cxxflags="$gitstatus_cxxflags -I/opt/local/include"
175+ else
176+ brew_prefix="$( command brew --prefix) "
177+ command ln -s -- "$brew_prefix "/opt/libiconv/lib/libiconv.a "$workdir "/lib
178+ libgit2_cflags="$libgit2_cflags -I"$brew_prefix "/opt/libiconv/include"
179+ gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix "/opt/libiconv/include"
180+ fi
170181 libgit2_cmake_flags="$libgit2_cmake_flags -DUSE_ICONV=ON"
171- libgit2_cflags="$libgit2_cflags -I"$brew_prefix "/opt/libiconv/include"
172- gitstatus_cxxflags="$gitstatus_cxxflags -I"$brew_prefix "/opt/libiconv/include"
173182 gitstatus_ldlibs="$gitstatus_ldlibs -liconv"
174183 gitstatus_ldflags="$gitstatus_ldflags -L${workdir} /lib"
175184 libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF"
0 commit comments