# Contributor: prspkt # Maintainer: prspkt pkgname=brotli pkgver=1.0.5 pkgrel=0 pkgdesc="Generic lossless compressor" url="https://github.com/google/brotli" arch="all" license="MIT" makedepends="cmake" subpackages="$pkgname-doc $pkgname-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/google/brotli/archive/v$pkgver.tar.gz" builddir="$srcdir/$pkgname-$pkgver" prepare() { default_prepare sed -i 's,/usr/bin/env bash,/bin/sh,' tests/*.sh } build() { cd "$builddir" if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_SHARED_LIBS=True \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS="$CFLAGS" \ ${CMAKE_CROSSOPTS} make } check() { cd "$builddir" make test } package() { cd "$builddir" make DESTDIR="$pkgdir" install local man; for man in docs/*.?; do install -D -m644 $man "$pkgdir"/usr/share/man/man${man##*.}/${man##*/} done } sha512sums="703cad94c7f250133d2cfe222f3183612c7649b184bba218907b805f423568046d42695f33acf7da95daf684be118c9d631cfa5706e5a195b611c716db4c839a brotli-1.0.5.tar.gz"