From b944b93ab5b8ab79bf64352bf41c657d1839e24a Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Mon, 17 Feb 2020 03:05:26 +0000 Subject: [PATCH] added extra/libcbor --- extra/libcbor/PKGBUILD | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 extra/libcbor/PKGBUILD diff --git a/extra/libcbor/PKGBUILD b/extra/libcbor/PKGBUILD new file mode 100644 index 000000000..7e68b2362 --- /dev/null +++ b/extra/libcbor/PKGBUILD @@ -0,0 +1,51 @@ +# 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: