CI: scripts: add support to build-ssl.sh to download and build AWS-LC

Relies on a new enviornment variable 'AWS_LC_VERSION' to be set to
the GitHub tag to download and build.
This commit is contained in:
Andrew Hopkins 2023-09-05 16:23:05 -07:00 committed by William Lallemand
parent 4457783ade
commit c677bb840b

View File

@ -86,6 +86,31 @@ download_boringssl () {
fi
}
download_aws_lc () {
if [ ! -f "download-cache/aws-lc-${AWS_LC_VERSION}.tar.gz" ]; then
mkdir -p download-cache
wget -q -O "download-cache/aws-lc-${AWS_LC_VERSION}.tar.gz" \
"https://github.com/aws/aws-lc/archive/refs/tags/v${AWS_LC_VERSION}.tar.gz"
fi
}
build_aws_lc () {
if [ "$(cat ${HOME}/opt/.aws_lc-version)" != "${AWS_LC_VERSION}" ]; then
tar zxf "download-cache/aws-lc-${AWS_LC_VERSION}.tar.gz"
(
cd "aws-lc-${AWS_LC_VERSION}/"
mkdir -p build
cd build
cmake -version
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DDISABLE_GO=1 -DDISABLE_PERL=1 \
-DBUILD_TESTING=0 -DCMAKE_INSTALL_PREFIX=${HOME}/opt ..
make -j$(nproc)
make install
)
echo "${AWS_LC_VERSION}" > "${HOME}/opt/.aws_lc-version"
fi
}
download_quictls () {
if [ ! -d "download-cache/quictls" ]; then
git clone --depth=1 https://github.com/quictls/openssl download-cache/quictls
@ -132,6 +157,11 @@ if [ ! -z ${BORINGSSL+x} ]; then
)
fi
if [ ! -z ${AWS_LC_VERSION+x} ]; then
download_aws_lc
build_aws_lc
fi
if [ ! -z ${QUICTLS+x} ]; then
(
download_quictls