]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: scripts: add support to build-ssl.sh to download and build AWS-LC
authorAndrew Hopkins <andhop@amazon.com>
Tue, 5 Sep 2023 23:23:05 +0000 (16:23 -0700)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 6 Sep 2023 11:41:36 +0000 (13:41 +0200)
Relies on a new enviornment variable 'AWS_LC_VERSION' to be set to
the GitHub tag to download and build.

scripts/build-ssl.sh

index a1935dd1ed480b087148fd1bc944044df4006048..8cd3769aace09f33f1e737fb4a47eca2c7384ab7 100755 (executable)
@@ -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