-
Notifications
You must be signed in to change notification settings - Fork 209
/
_ci-mac-homebrew.sh
executable file
·41 lines (34 loc) · 1.33 KB
/
_ci-mac-homebrew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Copyright (C) Viktor Szakats. See LICENSE.md
# SPDX-License-Identifier: MIT
# shellcheck disable=SC3040,SC2039
set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
extra=''
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' go'
if [[ "${CW_CONFIG:-}" != *'mac'* ]] || [[ "${CW_CONFIG:-}" = *'llvm'* ]]; then
extra+=' llvm lld'
fi
if [[ "${CW_CONFIG:-}" = *'win'* ]]; then
extra+=' mingw-w64 osslsigncode wine-stable openssh'
if [[ "${CW_CONFIG:-}" = *'boringssl'* ]] || [[ "${CW_CONFIG:-}" = *'awslc'* ]]; then
extra+=' nasm'
fi
elif [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
extra+=' filosottile/musl-cross/musl-cross'
elif [[ "${CW_CONFIG:-}" = *'mac'* ]] && [[ "${CW_CONFIG:-}" = *'gcc'* ]]; then
extra+=' gcc'
fi
if [ -n "${extra}" ]; then
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1
brew update >/dev/null || true
# shellcheck disable=SC2086
# - Using `|| true` to avoid failing due to preinstalled non-Homebrew
# python3: `Could not symlink bin/2to3`
# - Do not call brew install for ninja alone, it can take more time than it saves.
brew install ninja ${extra} || true
fi
[[ "${CW_CONFIG:-}" = *'win'* ]] && wineboot --init
./_build.sh