# Contributor: Sören Tempel # Maintainer: pkgname=libyang pkgver=2.1.80 pkgrel=1 pkgdesc="YANG data modelling language parser and toolkit" url="https://github.com/CESNET/libyang" arch="all" license="BSD-3-Clause-Clear" makedepends=" bison cmake cmocka-dev expect flex pcre2-dev samurai " checkdepends="bash" subpackages="$pkgname-dev $pkgname-doc" source="$pkgname-$pkgver.tar.gz::https://github.com/CESNET/libyang/archive/v$pkgver.tar.gz" build() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi CFLAGS="$CFLAGS -flto=auto" \ cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_SHARED_LIBS=True \ -DENABLE_TESTS="$(want_check && echo ON || echo OFF)" \ $CMAKE_CROSSOPTS cmake --build build } check() { local skip="yanglint.*" case "$CARCH" in s390x) # fails local skip="$skip|utest_structure" ;; esac ctest --output-on-failure --test-dir build -E "$skip" } package() { DESTDIR="$pkgdir" cmake --install build } sha512sums=" c403eb60edcfccaddfec64ae164cecde7866149c5d410c369879d205c0121b0548876aa186a14100ab9829681a2b533a99b1eb0dd67499ed6efb66608dc9c72a libyang-2.1.80.tar.gz "