age-plugin-fido2prf: fix darwin build by patching hardcoded Homebrew paths (#520963)

This commit is contained in:
Michael Daniels
2026-05-25 03:08:41 +00:00
committed by GitHub
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
libfido2,
@@ -26,6 +27,24 @@ buildGoModule (finalAttrs: {
buildInputs = [ libfido2 ];
postConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
chmod -R +w vendor/github.com/keys-pub/go-libfido2
substituteInPlace vendor/github.com/keys-pub/go-libfido2/fido2_static_arm64.go \
--replace-fail \
'/opt/homebrew/opt/libfido2/lib/libfido2.a /opt/homebrew/opt/openssl@3/lib/libcrypto.a ''${SRCDIR}/darwin/arm64/lib/libcbor.a' \
'-lfido2' \
--replace-fail \
'-I/opt/homebrew/opt/libfido2/include -I/opt/homebrew/opt/openssl@3/include' \
'-I${libfido2.dev}/include'
substituteInPlace vendor/github.com/keys-pub/go-libfido2/fido2_static_amd64.go \
--replace-fail \
'/usr/local/lib/libfido2.a /usr/local/opt/openssl@3/lib/libcrypto.a ''${SRCDIR}/darwin/amd64/lib/libcbor.a' \
'-lfido2' \
--replace-fail \
'-I/usr/local/opt/libfido2/include -I/usr/local/opt/openssl@3/include' \
'-I${libfido2.dev}/include'
'';
meta = {
description = "Age plugin to encrypt files with FIDO2 tokens in a way compatible to typage";
homepage = "https://github.com/FiloSottile/typage/";