From 3160ded3c255b7a0e5632dde77394a3ae47c45e5 Mon Sep 17 00:00:00 2001 From: Ludvig Michaelsson Date: Fri, 16 Jun 2023 15:04:05 +0200 Subject: [PATCH] ci: install libfido2 from brew on osx `brew` has for some time packaged libfido2. We can use those builds to simplify our pipeline. Ensure linking to the same OpenSSL version as libfido2 through `brew deps`. --- .github/workflows/macos_builds.yml | 2 +- build-aux/ci/build-osx.sh | 36 ++++++++---------------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 4be3d8c2..515791b6 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: dependencies - run: brew install check cmake help2man mandoc openssl@1.1 pkg-config automake + run: brew install check cmake help2man libfido2 mandoc pkg-config automake - name: build env: CC: ${{ matrix.cc }} diff --git a/build-aux/ci/build-osx.sh b/build-aux/ci/build-osx.sh index 3d1d8240..e637acd2 100755 --- a/build-aux/ci/build-osx.sh +++ b/build-aux/ci/build-osx.sh @@ -1,30 +1,12 @@ #!/usr/bin/env bash set -ex -BUILDROOT="$(git rev-parse --show-toplevel)" - -pushd "/tmp" &>/dev/null - # Build and install libcbor - git clone https://github.com/pjk/libcbor - pushd "/tmp/libcbor" &>/dev/null - git checkout v0.5.0 - cmake -Bbuild -H. - cmake --build build -- --jobs=2 VERBOSE=1 - sudo make -j $(sysctl -n hw.logicalcpu) -C build install - popd &>/dev/null - - # Build and install libfido2 - export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig - git clone https://github.com/Yubico/libfido2 - pushd "/tmp/libfido2" &>/dev/null - cmake -Bbuild -H. - cmake --build build -- --jobs=2 VERBOSE=1 - sudo make -j $(sysctl -n hw.logicalcpu) -C build install - popd &>/dev/null -popd &>/dev/null - -pushd "$BUILDROOT" &>/dev/null - ./autogen.sh - ./configure --disable-silent-rules --disable-man - make -j $(sysctl -n hw.logicalcpu) -popd &>/dev/null +# Link to same OpenSSL version as libfido2. +OPENSSL="$(brew deps --installed libfido2 | grep openssl)" +LIBFIDO2_PKGCONF="$(brew --prefix libfido2)/lib/pkgconfig" +OPENSSL_PKGCONF="$(brew --prefix "${OPENSSL}")/lib/pkgconfig" +export PKG_CONFIG_PATH="${LIBFIDO2_PKGCONF}:${OPENSSL_PKGCONF}" + +./autogen.sh +./configure --disable-silent-rules --disable-man +make -j $(sysctl -n hw.logicalcpu)