-
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy path_build-runner.sh
More file actions
executable file
·106 lines (95 loc) · 3.57 KB
/
_build-runner.sh
File metadata and controls
executable file
·106 lines (95 loc) · 3.57 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/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*)
[[ "$(uname -s)" = *'ARM64'* ]] && env='clang-aarch64' || env='x86_64'
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-"${env}"-{clang,cmake,ninja,jq,python-pip,rsync,gettext,osslsigncode} \
zip
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && \
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-"${env}"-go
if [[ "${CW_CONFIG:-}" = *'boringssl'* ]] || [[ "${CW_CONFIG:-}" = *'awslc'* ]]; then
pacman --noconfirm --ask 20 --noprogressbar --sync --needed \
mingw-w64-"${env}"-nasm
fi
;;
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'
if [[ "${CW_CONFIG:-}" = *'boringssl'* ]] || [[ "${CW_CONFIG:-}" = *'awslc'* ]]; then
extra+=' nasm'
fi
[[ "${CW_CONFIG:-}" = *'musl'* ]] && extra+=' musl musl-dev musl-tools'
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
extra+=' checksec'
fi
# shellcheck disable=SC2086
apt-get --option Dpkg::Use-Pty=0 --yes install --no-install-suggests --no-install-recommends \
curl git gpg rsync python3-pip python3-venv make cmake ninja-build \
zip xz-utils time jq secure-delete ${extra}
elif [ "${_DISTRO}" = 'alpine' ]; then
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' go'
if [[ "${CW_CONFIG:-}" = *'boringssl'* ]] || [[ "${CW_CONFIG:-}" = *'awslc'* ]]; then
extra+=' nasm'
fi
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 coreutils ${extra}
fi
;;
Darwin*)
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra+=' go'
if [[ "${CW_CONFIG:-}" = *'boringssl'* ]] || [[ "${CW_CONFIG:-}" = *'awslc'* ]]; then
extra+=' nasm'
fi
[[ "${CW_CONFIG:-}" = *'linux'* ]] && extra+=' filosottile/musl-cross/musl-cross'
# shellcheck disable=SC2086
brew install \
xz gnu-tar gettext jq ninja gnupg ${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 COSIGN_AGE_PASS=
export COSIGN_KEY_PASS=
export MINISIGN_AGE_PASS=
export MINISIGN_KEY_PASS=
export SIGN_CODE_AGE_PASS=
export SIGN_CODE_KEY_PASS=
export SIGN_PKG_KEY_ID=
export SIGN_PKG_AGE_PASS=
export SIGN_PKG_KEY_PASS=
export SIGN_SSH_AGE_PASS=
export SIGN_SSH_KEY_PASS=
export DEPLOY_AGE_PASS=
export DEPLOY_KEY_PASS=
./_build.sh 2>&1 | stdbuf -i0 -o0 -e0 tee "log-$(date '+%s').txt"