New package: libfido2 1.16.0 (#24169)

* New package: libfido2

* various fixes

---------

Co-authored-by: Tao Zuhong <taozuhong@users.noreply.github.com>
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
This commit is contained in:
Tao Zuhong 2025-07-11 19:06:51 +08:00 committed by GitHub
parent 94812e1c5e
commit 00452abed1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 156 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 5ce2fc7..f87393a 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -309,7 +309,7 @@ macro(define_symlink_target NAME EXT)
list(GET MAN_ALIAS ${i} SRC)
list(GET MAN_ALIAS ${j} DST)
add_custom_command(OUTPUT ${DST}.${EXT}
- COMMAND ln -sf ${SRC}.${EXT} ${DST}.${EXT})
+ COMMAND cp -f ${SRC}.${EXT} ${DST}.${EXT})
list(APPEND ${NAME}_LINK_FILES ${DST}.${EXT})
endforeach()
add_custom_target(${NAME} DEPENDS ${${NAME}_LINK_FILES})

View File

@ -0,0 +1,12 @@
--- libfido2-1.16.0/CMakeLists.txt.orig 2025-05-06 08:40:51.000000000 +0200
+++ libfido2-1.16.0/CMakeLists.txt 2025-07-11 12:14:32.774776300 +0200
@@ -369,8 +369,7 @@
string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}
" -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/fuzz/export.gnu")
else()
- string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}
- " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/export.gnu")
+ list(APPEND FIDO_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/export.def")
endif()
if(NOT WIN32)
string(CONCAT CMAKE_SHARED_LINKER_FLAGS

View File

@ -0,0 +1,46 @@
--- libfido2-1.16.0/CMakeLists.txt.orig 2025-07-11 12:16:37.586223100 +0200
+++ libfido2-1.16.0/CMakeLists.txt 2025-07-11 12:18:25.434110500 +0200
@@ -262,13 +262,6 @@
set(NFC_LINUX OFF)
endif()
- if(MINGW)
- # MinGW is stuck with a flavour of C89.
- add_definitions(-DFIDO_NO_DIAGNOSTIC)
- add_definitions(-DWC_ERR_INVALID_CHARS=0x80)
- add_compile_options(-Wno-unused-parameter)
- endif()
-
if(FUZZ)
set(USE_PCSC ON)
add_definitions(-DFIDO_FUZZ)
--- libfido2-1.16.0/openbsd-compat/openbsd-compat.h.orig 2025-05-06 08:40:51.000000000 +0200
+++ libfido2-1.16.0/openbsd-compat/openbsd-compat.h 2025-07-11 12:19:36.858477500 +0200
@@ -104,7 +104,7 @@
ssize_t getline(char **, size_t *, FILE *);
#endif
-#if defined(_MSC_VER)
+#if defined(WIN32)
#define strerror_r(e, b, l) strerror_s((b), (l), (e))
#endif
--- libfido2-1.16.0/src/extern.h.orig 2025-05-06 08:40:51.000000000 +0200
+++ libfido2-1.16.0/src/extern.h 2025-07-11 12:29:41.337077600 +0200
@@ -164,7 +164,15 @@
#define fido_log_xxd(...) do { /* nothing */ } while (0)
#define fido_log_error(...) do { /* nothing */ } while (0)
#else
-#ifdef __GNUC__
+#ifdef __MINGW32__
+void fido_log_init(void);
+void fido_log_debug(const char *, ...)
+ __MINGW_GNU_PRINTF (1, 2);
+void fido_log_xxd(const void *, size_t, const char *, ...)
+ __MINGW_GNU_PRINTF (3, 4);
+void fido_log_error(int, const char *, ...)
+ __MINGW_GNU_PRINTF (2, 3);
+#elif defined(__GNUC__)
void fido_log_init(void);
void fido_log_debug(const char *, ...)
__attribute__((__format__ (printf, 1, 2)));

View File

@ -0,0 +1,85 @@
# Maintainer: taozuhong <taozuhong@gmail.com>
_realname=libfido2
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.16.0
pkgrel=1
pkgdesc="Library functionality for FIDO 2.0, including communication with a device over USB (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://developers.yubico.com/libfido2/"
license=('BSD-2-Clause')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pkgconf")
depends=("${MINGW_PACKAGE_PREFIX}-libcbor"
"${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-cc-libs")
source=("https://developers.yubico.com/libfido2/Releases/libfido2-${pkgver}.tar.gz"{,.sig}
"001-fixed-link-cmd.patch"
"002-no-version-script.patch"
"003-fix-diagnostic-build.patch")
sha256sums=('8c2b6fb279b5b42e9ac92ade71832e485852647b53607c43baaafbbcecea04e4'
'SKIP'
'3134757a26e80eb1917036d4402551fa517e4e0e678c54dcf6c166b714de2bf2'
'c4592b59f3714803df029b8ae4ced3d1474e90d591a36fc9a84bb1e90888230e'
'91fd17023f143f74af73aabb3452a4a1616fc0f43bf4e466dadfe515bd82e330')
# https://developers.yubico.com/Software_Projects/Software_Signing.html
validpgpkeys=(
'1D7308B0055F5AEF36944A8F27A9C24D9588EA0F' # Aveen Ismail <aveen.ismail@yubico.com>
'7FBB6186957496D58C751AC20E777DD85755AA4A' # Konstantinos Georgantas <kostas@yubico.com>
'78D997D53E9C0A2A205392ED14A19784723C9988' # Ludvig Michaelsson <ludvig.michaelsson@yubico.com>
)
prepare() {
cd "${_realname}-${pkgver}"
patch -p1 -i ${srcdir}/001-fixed-link-cmd.patch
cp src/export.msvc src/export.def
patch -p1 -i ${srcdir}/002-no-version-script.patch
patch -p1 -i ${srcdir}/003-fix-diagnostic-build.patch
}
build() {
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}"
# XXX: avoid mingw-w64 pulling in winpthreads for clock_gettime
export CFLAGS+=" -DIN_WINPTHREAD"
if [[ ${MSYSTEM} == CLANG* ]]; then
export CFLAGS+=" -Wno-error=tautological-constant-out-of-range-compare"
fi
CFLAGS+=" -Wno-int-conversion -Wno-error=unused-parameter -Wno-strict-prototypes" \
MSYS2_ARG_CONV_EXCL=- \
cmake \
-GNinja \
${_extra_config[@]} \
-DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX \
-DCMAKE_DLL_NAME_WITH_SOVERSION=ON \
-DBUILD_TESTS=OFF \
-DBUILD_TOOLS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_SHARED_LIBS=ON \
-DUSE_WINHELLO=ON \
"../${_realname}-${pkgver}"
cmake --build .
}
package() {
cd "build-${MSYSTEM}"
DESTDIR="${pkgdir}" cmake --install .
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}