CI: scripts/buil-ssl: cleanup the boringssl and quictls build

Put the quictls and boringssl build in their own function instead of
keeping it in the main part of the script.
This commit is contained in:
William Lallemand 2024-05-23 16:54:30 +02:00
parent 5d73643ca3
commit 9c1fa3e411

View File

@ -88,6 +88,10 @@ build_libressl () {
} }
download_boringssl () { download_boringssl () {
# travis-ci comes with go-1.11, while boringssl requires go-1.13
eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.13 bash)"
if [ ! -d "${BUILDSSL_TMPDIR}/boringssl" ]; then if [ ! -d "${BUILDSSL_TMPDIR}/boringssl" ]; then
git clone --depth=1 https://boringssl.googlesource.com/boringssl ${BUILDSSL_TMPDIR}/boringssl git clone --depth=1 https://boringssl.googlesource.com/boringssl ${BUILDSSL_TMPDIR}/boringssl
else else
@ -98,6 +102,24 @@ download_boringssl () {
fi fi
} }
build_boringssl () {
cd ${BUILDSSL_TMPDIR}/boringssl
if [ -d build ]; then rm -rf build; fi
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 ..
ninja
rm -rf ${BUILDSSL_DESTDIR}/lib || exit 0
rm -rf ${BUILDSSL_DESTDIR}/include || exit 0
mkdir -p ${BUILDSSL_DESTDIR}/lib
cp crypto/libcrypto.so ssl/libssl.so ${BUILDSSL_DESTDIR}/lib
mkdir -p ${BUILDSSL_DESTDIR}/include
cp -r ../include/* ${BUILDSSL_DESTDIR}/include
}
download_aws_lc () { download_aws_lc () {
if [ ! -f "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}.tar.gz" ]; then if [ ! -f "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}.tar.gz" ]; then
mkdir -p "${BUILDSSL_TMPDIR}" mkdir -p "${BUILDSSL_TMPDIR}"
@ -135,6 +157,13 @@ download_quictls () {
fi fi
} }
build_quictls () {
cd ${BUILDSSL_TMPDIR}/quictls
./config shared no-tests ${QUICTLS_EXTRA_ARGS:-} --prefix="${BUILDSSL_DESTDIR}" --openssldir="${BUILDSSL_DESTDIR}" --libdir=lib -DPURIFY
make -j$(nproc) build_sw
make install_sw
}
download_wolfssl () { download_wolfssl () {
if [ ! -f "${BUILDSSL_TMPDIR}/wolfssl-${WOLFSSL_VERSION}.tar.gz" ]; then if [ ! -f "${BUILDSSL_TMPDIR}/wolfssl-${WOLFSSL_VERSION}.tar.gz" ]; then
mkdir -p ${BUILDSSL_TMPDIR} mkdir -p ${BUILDSSL_TMPDIR}
@ -177,28 +206,8 @@ if [ ! -z ${OPENSSL_VERSION+x} ]; then
fi fi
if [ ! -z ${BORINGSSL+x} ]; then if [ ! -z ${BORINGSSL+x} ]; then
( download_boringssl
build_boringssl
# travis-ci comes with go-1.11, while boringssl requires go-1.13
eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.13 bash)"
download_boringssl
cd ${BUILDSSL_TMPDIR}/boringssl
if [ -d build ]; then rm -rf build; fi
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 ..
ninja
rm -rf ${BUILDSSL_DESTDIR}/lib || exit 0
rm -rf ${BUILDSSL_DESTDIR}/include || exit 0
mkdir -p ${BUILDSSL_DESTDIR}/lib
cp crypto/libcrypto.so ssl/libssl.so ${BUILDSSL_DESTDIR}/lib
mkdir -p ${BUILDSSL_DESTDIR}/include
cp -r ../include/* ${BUILDSSL_DESTDIR}/include
)
fi fi
if [ ! -z ${AWS_LC_VERSION+x} ]; then if [ ! -z ${AWS_LC_VERSION+x} ]; then
@ -207,15 +216,8 @@ if [ ! -z ${AWS_LC_VERSION+x} ]; then
fi fi
if [ ! -z ${QUICTLS+x} ]; then if [ ! -z ${QUICTLS+x} ]; then
(
download_quictls download_quictls
cd ${BUILDSSL_TMPDIR}/quictls build_quictls
./config shared no-tests ${QUICTLS_EXTRA_ARGS:-} --prefix="${BUILDSSL_DESTDIR}" --openssldir="${BUILDSSL_DESTDIR}" --libdir=lib -DPURIFY
make -j$(nproc) build_sw
make install_sw
)
fi fi
if [ ! -z ${WOLFSSL_VERSION+x} ]; then if [ ! -z ${WOLFSSL_VERSION+x} ]; then