# Contributor: Leo # Maintainer: Leo pkgname=spdlog pkgver=1.4.2 pkgrel=2 pkgdesc="Fast C++ logging library" url="https://github.com/gabime/spdlog" arch="all" license="MIT" makedepends="cmake fmt-dev" subpackages="$pkgname-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/gabime/spdlog/archive/v$pkgver.tar.gz cassert.patch " build() { mkdir build cd build 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 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ -DSPDLOG_BUILD_BENCH=OFF \ -DSPDLOG_BUILD_TESTS=ON \ -DSPDLOG_SANITIZE_ADDRESS=OFF \ -DSPDLOG_FMT_EXTERNAL=ON \ -DSPDLOG_BUILD_SHARED=ON \ -DSPDLOG_BUILD_EXAMPLE=OFF \ ${CMAKE_CROSSOPTS} .. make } check() { cd build make test } package() { mkdir -p "$pkgdir" make -C build DESTDIR="$pkgdir" install } dev() { default_dev # Fix path mkdir -p "$subpkgdir"/usr/lib/cmake/spdlog mv "$pkgdir"/usr/lib/spdlog/cmake/* "$subpkgdir"/usr/lib/cmake/spdlog/ rmdir -p "$pkgdir"/usr/lib/spdlog || true } sha512sums="886b489138a1bdf363b5eab65a7d973f570a01c399ff5b910fcfee172ad4ff4d42a45dc2ae24e77b07130df527fb13a86b3e55ac992e72c418aebb232e27eabf spdlog-1.4.2.tar.gz f3db0d78bcb6a3e29a061a67cec1583a2f4aee2ecd3309b29315f5c205482dc271eadac49ff186ec36547ab2e7c429b090da73bead82a8bed15b514af53710d8 cassert.patch"