Skip to content

Commit

Permalink
ci: install libfido2 from brew on osx
Browse files Browse the repository at this point in the history
`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`.
  • Loading branch information
LDVG committed Oct 11, 2023
1 parent 7ae4196 commit 3160ded
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: dependencies
run: brew install check cmake help2man mandoc [email protected] pkg-config automake
run: brew install check cmake help2man libfido2 mandoc pkg-config automake
- name: build
env:
CC: ${{ matrix.cc }}
Expand Down
36 changes: 9 additions & 27 deletions build-aux/ci/build-osx.sh
Original file line number Diff line number Diff line change
@@ -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/[email protected]/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)

0 comments on commit 3160ded

Please sign in to comment.