# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=zlib-ng pkgver=2.1.3 pkgrel=0 pkgdesc="zlib replacement with optimizations for next generation systems" url="https://github.com/zlib-ng/zlib-ng" arch="all" license="Zlib" makedepends="cmake samurai" checkdepends="gzip xxd zlib-dev" subpackages="$pkgname-dev" source="https://github.com/zlib-ng/zlib-ng/archive/$pkgver/zlib-ng-$pkgver.tar.gz" case "$CARCH" in # broken this release, will be fixed in next ppc64le) options="$options !check" ;; esac # secfixes: # 2.0.6-r0: # - CVE-2022-37434 build() { local crossopts= if [ "$CBUILD" != "$CHOST" ]; then crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi # WITH_UNALIGNED - unaligned access invokes undefined behaviour, # see https://github.com/gentoo/gentoo/pull/17167 for more info. cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWITH_DFLTCC_DEFLATE=ON \ -DWITH_DFLTCC_INFLATE=ON \ -DWITH_UNALIGNED=OFF \ -DZLIB_ENABLE_TESTS="$(want_check && echo ON || echo OFF)" \ -DZLIBNG_ENABLE_TESTS="$(want_check && echo ON || echo OFF)" \ -DWITH_GTEST=OFF \ $crossopts cmake --build build } check() { cd build CTEST_OUTPUT_ON_FAILURE=TRUE ctest } package() { DESTDIR="$pkgdir" cmake --install build } sha512sums=" cb987c0b20a11fca5361dce94e53dead7364e739a984545c38ad4bf0c7fedd83d5d62530d979eca2182da88d7507a9bec8d3f5abff41e92ab5a63ac61001502e zlib-ng-2.1.3.tar.gz "