Subject: [PATCH v2 2/2] gnu: libfido2: Fix cross-compilation.

From: Sébastien Lerique <[email-masked]>
Date: Sun, 27 Mar 2022 22:00:04 +0900

* gnu/packages/security-token.scm (libfido2)[arguments]: Set
PKG_CONFIG_EXECUTABLE variable when cross-compiling.
---
 gnu/packages/security-token.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 6853d5bc9e..db8a8a53d3 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -44,6 +44,7 @@ (define-module (gnu packages security-token)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system python)
+  #:use-module (guix utils)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages curl)
@@ -906,7 +907,15 @@ (define-public libfido2
     (inputs (list zlib eudev libcbor openssl))
     (build-system cmake-build-system)
     (arguments
-     '(#:phases
+     `(#:configure-flags (list ,@(if (%current-target-system)
+                                     `((string-append
+                                        "-DPKG_CONFIG_EXECUTABLE="
+                                        (search-input-file %build-inputs
+                                                           (string-append
+                                                            "/bin/"
+                                                            ,(pkg-config-for-target)))))
+                                     '()))
+       #:phases
        (modify-phases %standard-phases
          ;; regress tests enabled only for debug builds
          (delete 'check))))
-- 
2.34.0