From 4af3e47d464915f4c558e06a6fe5cc44ba5844a7 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 29 Sep 2023 15:16:54 +0200 Subject: [PATCH] Install quiche lib in proper location for macOS, and teach pkgconfig about it --- builder-support/helpers/install_quiche.sh | 24 +++++++++++++++++++---- pdns/dnsdistdist/Makefile.am | 1 + 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/builder-support/helpers/install_quiche.sh b/builder-support/helpers/install_quiche.sh index 1c0b559283..908e949f50 100755 --- a/builder-support/helpers/install_quiche.sh +++ b/builder-support/helpers/install_quiche.sh @@ -7,6 +7,17 @@ readonly QUICHE_TARBALL="${QUICHE_VERSION}.tar.gz" readonly QUICHE_TARBALL_URL="https://github.com/cloudflare/quiche/archive/${QUICHE_TARBALL}" readonly QUICHE_TARBALL_HASH='eb242a14c4d801a90b57b6021dd29f7a62099f3a4d7a7ba889e105f8328e6c1f' +INSTALL_PREFIX=/usr +SOEXT=so +if [ $(uname) = Darwin ]; then + if [ $(id -u) = 0 ]; then + echo Do not run as root on macOS + exit 1 + fi + INSTALL_PREFIX="${HOMEBREW_PREFIX}" + SOEXT=dylib +fi + cd /tmp echo $0: Downloading $QUICHE_TARBALL curl -L -o "${QUICHE_TARBALL}" "${QUICHE_TARBALL_URL}" @@ -15,15 +26,20 @@ echo "${QUICHE_TARBALL_HASH}" "${QUICHE_TARBALL}" | sha256sum -c - tar xf "${QUICHE_TARBALL}" cd "quiche-${QUICHE_VERSION}" RUST_BACKTRACE=1 cargo build --release --no-default-features --features ffi,boringssl-boring-crate --package quiche -install -Dm644 quiche/include/quiche.h /usr/include -install -Dm644 target/release/libquiche.so /usr/lib/libdnsdist-quiche.so -install -Dm644 /dev/stdin /usr/lib/pkgconfig/quiche.pc <