diff --git a/Package.swift b/Package.swift index 28d7d715..66cdbc0b 100644 --- a/Package.swift +++ b/Package.swift @@ -98,7 +98,6 @@ let package = Package( name: "CCryptoBoringSSL", exclude: privacyManifestExclude + [ "hash.txt", - "include/boringssl_prefix_symbols_nasm.inc", "CMakeLists.txt", /* * These files are excluded to support WASI libc which doesn't provide . diff --git a/scripts/vendor-boringssl.sh b/scripts/vendor-boringssl.sh index e6ebd3bd..50fefb4c 100755 --- a/scripts/vendor-boringssl.sh +++ b/scripts/vendor-boringssl.sh @@ -45,6 +45,11 @@ DSTROOT=Sources/CCryptoBoringSSL TMPDIR=$(mktemp -d /tmp/.workingXXXXXX) SRCROOT="${TMPDIR}/src/boringssl.googlesource.com/boringssl" +# BoringSSL revision can be passed as the first argument to this script. +if [ "$#" -gt 0 ]; then + BORINGSSL_REVISION="$1" +fi + # This function namespaces the awkward inline functions declared in OpenSSL # and BoringSSL. function namespace_inlines { @@ -170,9 +175,14 @@ echo "CLONING boringssl" mkdir -p "$SRCROOT" git clone https://boringssl.googlesource.com/boringssl "$SRCROOT" cd "$SRCROOT" -BORINGSSL_REVISION=$(git rev-parse HEAD) +if [ "$BORINGSSL_REVISION" ]; then + echo "CHECKING OUT boringssl@${BORINGSSL_REVISION}" + git checkout "$BORINGSSL_REVISION" +else + BORINGSSL_REVISION=$(git rev-parse HEAD) + echo "CLONED boringssl@${BORINGSSL_REVISION}" +fi cd "$HERE" -echo "CLONED boringssl@${BORINGSSL_REVISION}" echo "OBTAINING submodules" ( @@ -248,7 +258,7 @@ echo "DISABLING assembly on x86 Windows" # x86 Windows builds require nasm for acceleration. SwiftPM can't do that right now, # so we disable the assembly. cd "$DSTROOT" - gsed -i "/#define OPENSSL_HEADER_BASE_H/a#if defined(_WIN32) && (defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(__x86) || defined(__i386) || defined(__i386__) || defined(_M_IX86))\n#define OPENSSL_NO_ASM\n#endif" "include/openssl/base.h" + $sed -i "/#define OPENSSL_HEADER_BASE_H/a#if defined(_WIN32) && (defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(__x86) || defined(__i386) || defined(__i386__) || defined(_M_IX86))\n#define OPENSSL_NO_ASM\n#endif" "include/openssl/base.h" )