#!/usr/bin/env bash set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" third_party="$root/native/third-party" mkdir -p "$third_party" if [[ ! -d "$third_party/liboqs/.git" ]]; then git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git \ "$third_party/liboqs" fi cmake -S "$third_party/liboqs" -B "$third_party/liboqs/build" -GNinja \ -DBUILD_SHARED_LIBS=OFF \ -DOQS_BUILD_ONLY_LIB=ON \ -DOQS_MINIMAL_BUILD="SIG_falcon_padded_512" ninja -C "$third_party/liboqs/build" if [[ ! -d "$third_party/liboqs-php/.git" ]]; then git clone --depth 1 https://github.com/Muzosh/liboqs-php.git \ "$third_party/liboqs-php" fi ( cd "$third_party/liboqs-php" if git apply --check "$root/oqsphp-contractless.patch"; then git apply "$root/oqsphp-contractless.patch" elif ! git apply --reverse --check "$root/oqsphp-contractless.patch"; then echo "The Contractless liboqs-php patch cannot be applied cleanly." >&2 exit 1 fi LIBOQS_ROOT="$third_party/liboqs" bash build.sh ) if [[ ! -d "$third_party/php-skein/.git" ]]; then git clone --depth 1 https://github.com/jedisct1/PHP-Skein-Hash.git \ "$third_party/php-skein" fi ( cd "$third_party/php-skein" phpize ./configure make ) cat <