# Maintainer: Levente Polyak # Contributor: Moritz Kiefer # ALARM: Kevin Mihelich # - remove -flto from CMakeLists pkgname=libcbor pkgver=0.5.0 pkgrel=3 pkgdesc='C library for parsing and generating CBOR, the general-purpose schema-less binary data format' url='https://github.com/PJK/libcbor' arch=('x86_64') license=('MIT') depends=('glibc') makedepends=('cmake' 'cmocka') provides=('libcbor.so') source=(https://github.com/PJK/libcbor/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz) sha256sums=('9bbec94bb385bad3cd2f65482e5d343ddb97e9ffe261123ea0faa3bfea51d320') b2sums=('57e15e648159e7858d9d57a8b4cb7f3682f8153248610c9a3385cf9cbdea8babaf81d596b25d44bf6d59c75de23e76cce462fa7860b294019f46636726206d5a') prepare() { cd ${pkgname}-${pkgver} sed -i 's/-flto//g' CMakeLists.txt } build() { mkdir -p ${pkgname}-${pkgver}/build cd ${pkgname}-${pkgver}/build cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_FLAGS="${CFLAGS} ${CPPFLAGS}" \ -DWITH_TESTS=1 make cbor cbor_shared VERBOSE=1 make -C test VERBOSE=1 } check() { cd ${pkgname}-${pkgver}/build make -C test test } package() { cd ${pkgname}-${pkgver} make -C build DESTDIR="${pkgdir}" install install -Dm 644 README.md CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}" install -Dm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}" } # vim: ts=2 sw=2 et: