aboutsummaryrefslogtreecommitdiffstats
path: root/community/spdlog/APKBUILD
blob: e335a122890b27f6cdbfc2eb825cba5d190ca72f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=spdlog
pkgver=1.7.0
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() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-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 -C build
}

check() {
	make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" install
	sed -e 's|.*#define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|' \
		-i "$pkgdir"/usr/include/spdlog/tweakme.h
}

sha512sums="e15d461ac7a6d3d3186fe4283e4fbaf56b2ce3011babf892e3b2d3dbdd7e999a861f1f6f67a9d88a5cf488a440add087ea78e96131f49b52ed6c7815a972799a  spdlog-1.7.0.tar.gz"