diff --git a/common/shlibs b/common/shlibs index 5b2a988e669..0262e1bf310 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4570,3 +4570,4 @@ libresvg.so.0.46 libresvg0-0.46.0_1 libgpiod.so.3 libgpiod-2.2_4 libgpiodcxx.so.2 libgpiod-2.2_4 libigloo.so.0 libigloo-0.9.5_1 +libfyaml.so.0 libfyaml-0.9.6_1 \ No newline at end of file diff --git a/srcpkgs/libfyaml-devel b/srcpkgs/libfyaml-devel new file mode 120000 index 00000000000..9b0cb3478a9 --- /dev/null +++ b/srcpkgs/libfyaml-devel @@ -0,0 +1 @@ +libfyaml \ No newline at end of file diff --git a/srcpkgs/libfyaml/patches/cherry-pick-commit-1026d76.patch b/srcpkgs/libfyaml/patches/cherry-pick-commit-1026d76.patch new file mode 100644 index 00000000000..01e5d1d0d0a --- /dev/null +++ b/srcpkgs/libfyaml/patches/cherry-pick-commit-1026d76.patch @@ -0,0 +1,88 @@ +From 45faa819b6c3eb54b2d63b46d4c7690fa1e8e8ff Mon Sep 17 00:00:00 2001 +From: Nanda H Krishna +Date: Sun, 15 Mar 2026 17:56:13 -0400 +Subject: [PATCH] Fix C11 atomics detection and buggy macros for C++ + compatibility + +--- + include/libfyaml/libfyaml-atomics.h | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/include/libfyaml/libfyaml-atomics.h b/include/libfyaml/libfyaml-atomics.h +index 54d88ae7..64142a83 100644 +--- a/include/libfyaml/libfyaml-atomics.h ++++ b/include/libfyaml/libfyaml-atomics.h +@@ -78,7 +78,7 @@ extern "C" { + #if !defined(FY_HAVE_C11_ATOMICS) + #undef FY_HAVE_STDATOMIC_H + +-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) ++#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(__cplusplus) + #define FY_HAVE_C11_ATOMICS + #elif defined(__clang__) && defined(__has_extension) + #if __has_extension(c_atomic) +@@ -123,7 +123,7 @@ typedef bool atomic_flag; + + #define atomic_store(_ptr, _val) \ + do { \ +- *(_obj) = (_val); \ ++ *(_ptr) = (_val); \ + } while(0) + + #define atomic_exchange(_ptr, _v) \ +@@ -152,6 +152,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_add(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr += (_v); \ + __old; \ +@@ -159,6 +160,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_sub(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr -= (_v); \ + __old; \ +@@ -166,6 +168,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_or(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr |= (_v); \ + __old; \ +@@ -173,6 +176,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_xor(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr ^= (_v); \ + __old; \ +@@ -180,6 +184,7 @@ typedef bool atomic_flag; + + #define atomic_fetch_and(_ptr, _v) \ + ({ \ ++ __typeof__(_ptr) __ptr = (_ptr); \ + __typeof__(*(_ptr)) __old = *__ptr; \ + *__ptr &= (_v); \ + __old; \ +@@ -199,13 +204,14 @@ typedef bool atomic_flag; + #define atomic_flag_test_and_set(_ptr) \ + ({ \ + volatile atomic_flag *__ptr = (_ptr); \ ++ bool __ret; \ + if (!*__ptr) { \ + *__ptr = true; \ + __ret = true; \ + } else \ + __ret = false; \ + __ret; \ +- } ++ }) + + #endif + diff --git a/srcpkgs/libfyaml/patches/fix-32bit.patch b/srcpkgs/libfyaml/patches/fix-32bit.patch new file mode 100644 index 00000000000..19e77ce56a7 --- /dev/null +++ b/srcpkgs/libfyaml/patches/fix-32bit.patch @@ -0,0 +1,27 @@ +diff --git a/include/libfyaml/libfyaml-vlsize.h b/include/libfyaml/libfyaml-vlsize.h +index 6ccb7ab..acfd78d 100644 +--- a/include/libfyaml/libfyaml-vlsize.h ++++ b/include/libfyaml/libfyaml-vlsize.h +@@ -810,13 +810,18 @@ fy_decode_size(const uint8_t *start, size_t bufsz, size_t *sizep) + static inline const uint8_t * + fy_decode_size_nocheck(const uint8_t *start, size_t *sizep) + { +- return fy_decode_size32_nocheck(start, sizep); ++ uint64_t sz; ++ const uint8_t *ret; ++ ++ ret = fy_decode_size32_nocheck(start, &sz); ++ *sizep = (size_t)sz; ++ return ret; + } + + static inline const uint8_t * + fy_skip_size(const uint8_t *start, size_t bufsz) + { +- return fy_skip_size32(start, bufsz, &sz); ++ return fy_skip_size32(start, bufsz); + } + + static inline const uint8_t * +-- +2.53.0 diff --git a/srcpkgs/libfyaml/patches/fix-none-required.patch b/srcpkgs/libfyaml/patches/fix-none-required.patch new file mode 100644 index 00000000000..32c4627d778 --- /dev/null +++ b/srcpkgs/libfyaml/patches/fix-none-required.patch @@ -0,0 +1,31 @@ +From 5580df46df9fe48a960474934c82d53dcf070364 Mon Sep 17 00:00:00 2001 +From: Naz +Date: Fri, 17 Apr 2026 16:32:35 +0100 +Subject: [PATCH] build: don't output "none required" to LIBM + +--- + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b03cf24..1ab4897 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -253,10 +253,10 @@ AC_DEFINE_UNQUOTED([HAVE_ASAN], [$HAVE_ASAN], [Define to 1 if ASAN is enabled]) + + # Link libm on platforms where trunc() lives outside libc. + AC_SEARCH_LIBS([trunc], [m]) +-LIBM="$ac_cv_search_trunc" +-if test "x$LIBM" = "xno" || test "x$LIBM" = "xyes" ; then +- LIBM="" +-fi ++case "$ac_cv_search_trunc" in ++ no|yes|"none required") LIBM="" ;; ++ *) LIBM="$ac_cv_search_trunc" ++esac + AC_SUBST(LIBM) + + # check if there's a qsort_r available (musl does not have it) +-- +2.53.0 + diff --git a/srcpkgs/libfyaml/template b/srcpkgs/libfyaml/template new file mode 100644 index 00000000000..ff3b7ad6b80 --- /dev/null +++ b/srcpkgs/libfyaml/template @@ -0,0 +1,40 @@ +# Template file for 'libfyaml' +pkgname=libfyaml +version=0.9.6 +revision=1 +build_style=gnu-configure +configure_args="--disable-network --libdir=/usr/lib" +hostmakedepends="pkg-config autoconf automake libtool git jq + python3-pip" +makedepends="libyaml-devel check-devel" +short_desc="Fully feature complete YAML parser and emitter" +maintainer="Orphaned " +license="MIT" +homepage="https://github.com/pantoniou/libfyaml" +changelog="https://raw.githubusercontent.com/pantoniou/libfyaml/refs/heads/master/CHANGELOG.md" +distfiles="https://github.com/pantoniou/libfyaml/archive/refs/tags/v${version}.tar.gz" +checksum=2d016379a69f6cf6beaf06d12bcefe1ad1784bab28fbb41a6fa8d49d25f1bc0a + +pre_configure() { + case "$XBPS_TARGET_MACHINE" in + armv6l*) export CFLAGS+=" -march=armv6k" ;; + esac + + ./bootstrap.sh +} + +post_install() { + vlicense LICENSE +} + +libfyaml-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + vmove usr/share/man/man3 + } +}