# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libdeflate
pkgver=1.20
pkgrel=2
pkgdesc='Heavily optimized library for DEFLATE/zlib/gzip compression and decompression'
arch=(x86_64)
url=https://github.com/ebiggers/libdeflate
license=(MIT)
depends=(glibc)
makedepends=(
  cmake
  git
  ninja
)
provides=(libdeflate.so)
_tag=275aa5141db6eda3587214e0f1d3a134768f557d
source=(git+https://github.com/ebiggers/libdeflate.git#tag=${_tag})
b2sums=(SKIP)

pkgver() {
  cd libdeflate
  git describe --tags | sed 's/^v//'
}

build() {
  cmake -S libdeflate -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIBDEFLATE_BUILD_STATIC_LIB=OFF \
    -DLIBDEFLATE_BUILD_TESTS=ON
  cmake --build build
}

check() {
  ctest --test-dir build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
  install -Dm 644 libdeflate/COPYING -t "${pkgdir}"/usr/share/licenses/libdeflate/
}

# vim ts=2 sw=2 et:
