-
Notifications
You must be signed in to change notification settings - Fork 207
/
_build-runner.sh
executable file
·86 lines (75 loc) · 2.73 KB
/
_build-runner.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
# Copyright (C) Viktor Szakats. See LICENSE.md
# SPDX-License-Identifier: MIT
# EXPERIMENTAL
# This script makes a local curl (and dependencies) build.
# Start it in a curl-for-win repo sandbox.
# Output is generated in the same directory.
# shellcheck disable=SC3040,SC2039
set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
cd "$(dirname "$0")"
# Customize these
export CW_CONFIG='dev-x64-cares'
#export CURL_REV_='master'
# Install necessary packages
if [ ! -f .cw-initialized ]; then
extra=''
case "$(uname)" in
*_NT*)
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-x86_64-{clang,cmake,ninja,jq,python-pefile,rsync,gettext,osslsigncode} \
zip
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && \
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-x86_64-{go,nasm}
;;
Linux*)
if [ -s /etc/os-release ]; then
_DISTRO="$(grep -a '^ID=' /etc/os-release | cut -c 4- | tr -d '"' || true)"
_DISTRO="${_DISTRO:-unrecognized}"
fi
if [ "${_DISTRO}" = 'debian' ]; then
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' golang nasm'
[[ "${CW_CONFIG:-}" = *'musl'* ]] && extra+=' musl musl-dev musl-tools'
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
extra+=' checksec'
fi
# shellcheck disable=SC2086
apt-get --quiet 2 --option Dpkg::Use-Pty=0 --yes install \
curl git gpg rsync python3-pefile make cmake ninja-build \
zip xz-utils time jq secure-delete ${extra}
elif [ "${_DISTRO}" = 'alpine' ]; then
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' go nasm'
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
apk add --no-cache checksec-rs --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing/
fi
# shellcheck disable=SC2086
apk add --no-cache curl git gpg rsync build-base cmake ninja-build \
zip tar xz jq openssl ${extra}
fi
;;
Darwin*)
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' go nasm'
[[ "${CW_CONFIG:-}" = *'linux'* ]] && extra+=' filosottile/musl-cross/musl-cross'
# shellcheck disable=SC2086
brew install \
xz gnu-tar gettext jq ninja ${extra}
;;
esac
touch .cw-initialized
fi
# Not much to customize here
export CW_LLVM_MINGW_DL=1
export CW_LLVM_MINGW_ONLY=1
export CW_NOTIME=1
export CW_MAP=1
export CW_JOBS=2
export VIRUSTOTAL_APIKEY=
export SIGN_CODE_GPG_PASS=
export SIGN_CODE_KEY_PASS=
export SIGN_PKG_KEY_ID=
export SIGN_PKG_GPG_PASS=
export SIGN_PKG_KEY_PASS=
export DEPLOY_GPG_PASS=
export DEPLOY_KEY_PASS=
./_build.sh 2>&1 | stdbuf -i0 -o0 -e0 tee "log-$(date '+%s').txt"