# Contributor: Leo # Maintainer: Leo pkgname=spdlog pkgver=1.4.2 pkgrel=0 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" 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 mv "$pkgdir"/usr/lib/spdlog/cmake "$subpkgdir"/usr/lib/cmake rmdir -p "$pkgdir"/usr/lib/spdlog || true } sha512sums="886b489138a1bdf363b5eab65a7d973f570a01c399ff5b910fcfee172ad4ff4d42a45dc2ae24e77b07130df527fb13a86b3e55ac992e72c418aebb232e27eabf spdlog-1.4.2.tar.gz"