From b01bb9f5e23479f858a6dbfcb010bfc3fcd3cfd7 Mon Sep 17 00:00:00 2001 From: Yao Zi Date: Fri, 10 Apr 2026 10:22:32 +0000 Subject: [PATCH] [libfyaml] 0.9.6-1: new upstream version, build with CMake and test --- 0001-Look-for-shared-check-library.patch | 18 ++++++++ ...on-number-for-libtool-ABI-versioning.patch | 13 ------ PKGBUILD | 45 +++++++++++-------- 3 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 0001-Look-for-shared-check-library.patch delete mode 100644 0001-Use-version-number-for-libtool-ABI-versioning.patch diff --git a/0001-Look-for-shared-check-library.patch b/0001-Look-for-shared-check-library.patch new file mode 100644 index 000000000..f1bf38fed --- /dev/null +++ b/0001-Look-for-shared-check-library.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef0c3ae38c16..afd19a9f8ef8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -239,10 +239,10 @@ if(BUILD_TESTING AND (NOT CMAKE_CROSSCOMPILING OR HAVE_WINE)) + if(check_FOUND) + set(HAVE_CHECK 1) + set(CHECK_LIBRARIES check) +- if(TARGET Check::check) +- set(CHECK_TARGET Check::check) ++ if(TARGET Check::checkShared) ++ set(CHECK_TARGET Check::checkShared) + else() +- set(CHECK_TARGET check) ++ set(CHECK_TARGET checkShared) + endif() + get_target_property(CHECK_INCLUDE_DIRS ${CHECK_TARGET} INTERFACE_INCLUDE_DIRECTORIES) + # Get library location to extract directory diff --git a/0001-Use-version-number-for-libtool-ABI-versioning.patch b/0001-Use-version-number-for-libtool-ABI-versioning.patch deleted file mode 100644 index 443a0ebe0..000000000 --- a/0001-Use-version-number-for-libtool-ABI-versioning.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/Makefile.am b/src/Makefile.am -index 141209fa1b47..58bc5e627d44 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -47,7 +47,7 @@ libfyaml_la_CPPFLAGS = $(AM_CPPFLAGS) \ - -I$(top_srcdir)/src/thread - libfyaml_la_CFLAGS = $(AM_CFLAGS) - libfyaml_la_LDFLAGS = -no-undefined $(AM_LDFLAGS) $(AM_LIBLDFLAGS) \ -- -version $(LIBTOOL_VERSION) -+ -version-number $(LIBTOOL_VERSION) - libfyaml_la_LIBADD = - - # blake3 section diff --git a/PKGBUILD b/PKGBUILD index 84aea3527..833e239cb 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ # Contributor: Antonio Rojas pkgname=libfyaml -pkgver=0.9.3 +pkgver=0.9.6 pkgrel=1 pkgdesc='Fully feature complete YAML parser and emitter' arch=(x86_64 aarch64 riscv64 loongarch64) @@ -10,32 +10,41 @@ url='https://pantoniou.github.io/libfyaml/' license=(MIT) depends=(musl) makedepends=(git linux-headers) +checkdepends=(check) provides=(libfyaml.so) -# 0001: Downstream, upstream Makefile.am passes invalid argument to libtool for -# ABI versioning, breaking build with slibtool. -# Reference: https://github.com/pantoniou/libfyaml/issues/148 +# 0001: Downstream, look for shared target Check::checkShared instead of the +# static Check::check during configuration, since eweOS doesn't ship the +# static version. source=("git+https://github.com/pantoniou/libfyaml#tag=v$pkgver" - 0001-Use-version-number-for-libtool-ABI-versioning.patch) -sha256sums=('ff9f7b7defe589dda095a4796fdeb098bbd3886242bc573a6ed5b65014f4e7b0' - 'e55cafd16ddc700b217fcc0baa32b8a0b56f5445dd38f63aea44688694fb2611') + "git+https://github.com/yaml/yaml-test-suite" + "git+https://github.com/nst/JSONTestSuite" + 0001-Look-for-shared-check-library.patch) +sha256sums=('6e3066fc231e83fe7899c3ccd8ed8931cb46461ffb25e73fcab89a35affaeccd' + 'SKIP' + 'SKIP' + '2c902bb72243928f2978fe14e4809608a485d3306afe0b3e6ead406442ec63b3') prepare() { _patch_ $pkgname - - cd $pkgname - autoreconf -fiv } build() { - cd $pkgname - ./configure \ - --prefix=/usr \ - --without-libclang - make + cmake -S $pkgname -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_LIBCLANG=OFF \ + -DBUILD_TESTING=ON \ + -DTESTSUITEURL="$srcdir/yaml-test-suite" \ + -DJSONTESTSUITEURL="$srcdir/JSONTestSuite" + cmake --build build +} + +check() { + ctest --test-dir build -j"$JOBS" --verbose } package() { - cd $pkgname - make DESTDIR="$pkgdir" install - _install_license_ LICENSE + DESTDIR="$pkgdir" cmake --install build + _install_license_ $pkgname/LICENSE }