Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-03-09 15:33:12 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2024-03-09 15:33:12 +0100
commit2b17e792eb787eea19c552ec14fd2888ab28283d (patch)
tree5fdbb6fdb387b5ab32a4b8947f6b9b85d072630e
parenta4f5c793e72e3b0d3605c55d45e98510f1edc3e4 (diff)
core/libfido2: patched for Werror, man pages and systemd cycles
-rw-r--r--core/libfido2/PKGBUILD77
-rw-r--r--core/libfido2/libfido2-1.14.0-no-werror.patch38
2 files changed, 115 insertions, 0 deletions
diff --git a/core/libfido2/PKGBUILD b/core/libfido2/PKGBUILD
new file mode 100644
index 00000000..ee4d26f4
--- /dev/null
+++ b/core/libfido2/PKGBUILD
@@ -0,0 +1,77 @@
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+# Contributor: Karol Babioch <karol@babioch.de>
+
+pkgname=libfido2
+pkgver=1.14.0
+pkgrel=2
+pkgdesc='Library functionality for FIDO 2.0, including communication with a device over USB'
+url='https://developers.yubico.com/libfido2/'
+arch=(i486 i686 pentium4 'x86_64')
+license=('BSD')
+depends=('glibc' 'openssl' 'libcbor' 'libcbor.so' 'hidapi' 'systemd-libs' 'libudev.so' 'zlib')
+makedepends=('cmake' 'systemd')
+provides=('libfido2.so')
+source=("https://developers.yubico.com/libfido2/Releases/libfido2-${pkgver}.tar.gz"{,.sig})
+sha512sums=('83454b0db0cc8546f377d0dd59f95785fe6b73cf28e499a6182a6ece4b7bce17c3e750155262adf71f339ec0b3b6c3d3d64a07b01c8428b4b91de97ae768f0e6'
+ 'SKIP')
+b2sums=('244ad33f73e7aeb3e4523eeda8402c0fcb9de08d28d15d5881651ca5e05b78b4bec10fe58c33dda08e8b5f7be231bf36a85463ded2733d762e929414e4749765'
+ 'SKIP')
+validpgpkeys=(
+ 'EE90AE0D19774C8386628FAAB428949EF7914718' # pedro martelletto <pedro@yubico.com>
+ '1D7308B0055F5AEF36944A8F27A9C24D9588EA0F' # Aveen Ismail <aveen.ismail@yubico.com>
+ '7FBB6186957496D58C751AC20E777DD85755AA4A' # Konstantinos Georgantas <kostas@yubico.com>
+ '78D997D53E9C0A2A205392ED14A19784723C9988' # Ludvig Michaelsson <ludvig.michaelsson@yubico.com>
+)
+
+build() {
+ cd ${pkgname}-${pkgver}
+ # do not use bundled udev rules superseded by systemd
+ cmake -B build \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ -Wno-dev \
+ -S .
+ make -C build VERBOSE=1
+}
+
+package() {
+ cd ${pkgname}-${pkgver}
+ make -C build DESTDIR="${pkgdir}" install
+ install -Dm 644 NEWS README.adoc -t "${pkgdir}/usr/share/doc/${pkgname}"
+ install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+}
+
+# vim: ts=2 sw=2 et:
+
+# Arch32
+
+# break cycles with systemd
+depends=(${depends[@]//systemd-libs/})
+makedepends=(${makedepends[@]//systemd/})
+
+# somehow -Wno-dev disappeard and we have full -Werror again
+source+=(libfido2-1.14.0-no-werror.patch)
+sha512sums+=(3bc56d2926d5cfc8838d23775254e0d01f68c79a95b94f6787e72b8402c4617cc2a4abf75be6c573e619fd6f94574bdeb2b79f162354230372e935f6e20da709)
+b2sums+=(8a50d473ca2eda54ceaeaae0ce85af1109119949ac5db354b02b726507547f4a9c1f38f9e7d5c598b328ccf3276224a0e5374222dafeaf76e7ebc9aeb891d801)
+
+
+eval "$(
+ {
+ declare -f prepare || \
+ printf 'prepare() {\n}\n'
+ } \
+ | sed '
+ $i cd "${srcdir}/${pkgbase}-${pkgver}" \
+ patch -Np1 -i "$srcdir/libfido2-1.14.0-no-werror.patch"
+ '
+)"
+
+# manpage generators are most likely broken
+eval "$(
+ declare -f build | \
+ sed '
+ s/cmake /cmake -DBUILD_MANPAGES=OFF /
+ '
+)"
diff --git a/core/libfido2/libfido2-1.14.0-no-werror.patch b/core/libfido2/libfido2-1.14.0-no-werror.patch
new file mode 100644
index 00000000..f8bc6f9d
--- /dev/null
+++ b/core/libfido2/libfido2-1.14.0-no-werror.patch
@@ -0,0 +1,38 @@
+diff -rauN libfido2-1.14.0/CMakeLists.txt libfido2-1.14.0-no-werror/CMakeLists.txt
+--- libfido2-1.14.0/CMakeLists.txt 2023-11-13 08:19:20.000000000 +0100
++++ libfido2-1.14.0-no-werror/CMakeLists.txt 2024-03-09 15:26:30.835589345 +0100
+@@ -90,7 +90,7 @@
+ endif()
+
+ check_c_compiler_flag("-Wshorten-64-to-32" HAVE_SHORTEN_64_TO_32)
+-check_c_compiler_flag("-Werror -fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)
++check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)
+
+ check_include_files(cbor.h HAVE_CBOR_H)
+ check_include_files(endian.h HAVE_ENDIAN_H)
+@@ -123,7 +123,7 @@
+ try_compile(HAVE_POSIX_IOCTL
+ "${CMAKE_CURRENT_BINARY_DIR}/posix_ioctl_check.o"
+ "${CMAKE_CURRENT_SOURCE_DIR}/openbsd-compat/posix_ioctl_check.c"
+- COMPILE_DEFINITIONS "-Werror -Woverflow -Wsign-conversion")
++ COMPILE_DEFINITIONS "-Woverflow -Wsign-conversion")
+
+ list(APPEND CHECK_VARIABLES
+ HAVE_ARC4RANDOM_BUF
+@@ -295,7 +295,6 @@
+
+ add_compile_options(-Wall)
+ add_compile_options(-Wextra)
+- add_compile_options(-Werror)
+ add_compile_options(-Wshadow)
+ add_compile_options(-Wcast-qual)
+ add_compile_options(-Wwrite-strings)
+@@ -322,7 +321,7 @@
+
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g2")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-omit-frame-pointer")
+- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2")
++ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
+
+ if(CRYPTO_VERSION VERSION_GREATER_EQUAL 3.0)
+ add_definitions(-DOPENSSL_API_COMPAT=0x10100000L)