Skip to content

Commit

Permalink
CI: scripts/buil-ssl: cleanup the boringssl and quictls build
Browse files Browse the repository at this point in the history
Put the quictls and boringssl build in their own function instead of
keeping it in the main part of the script.
  • Loading branch information
wlallemand committed May 23, 2024
1 parent 5d73643 commit 9c1fa3e
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions scripts/build-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ build_libressl () {
}

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
git clone --depth=1 https://boringssl.googlesource.com/boringssl ${BUILDSSL_TMPDIR}/boringssl
else
Expand All @@ -98,6 +102,24 @@ download_boringssl () {
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 () {
if [ ! -f "${BUILDSSL_TMPDIR}/aws-lc-${AWS_LC_VERSION}.tar.gz" ]; then
mkdir -p "${BUILDSSL_TMPDIR}"
Expand Down Expand Up @@ -135,6 +157,13 @@ download_quictls () {
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 () {
if [ ! -f "${BUILDSSL_TMPDIR}/wolfssl-${WOLFSSL_VERSION}.tar.gz" ]; then
mkdir -p ${BUILDSSL_TMPDIR}
Expand Down Expand Up @@ -177,28 +206,8 @@ if [ ! -z ${OPENSSL_VERSION+x} ]; then
fi

if [ ! -z ${BORINGSSL+x} ]; then
(

# 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
)
download_boringssl
build_boringssl
fi

if [ ! -z ${AWS_LC_VERSION+x} ]; then
Expand All @@ -207,15 +216,8 @@ if [ ! -z ${AWS_LC_VERSION+x} ]; then
fi

if [ ! -z ${QUICTLS+x} ]; then
(
download_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

)
build_quictls
fi

if [ ! -z ${WOLFSSL_VERSION+x} ]; then
Expand Down

0 comments on commit 9c1fa3e

Please sign in to comment.