summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12058af9759fd4a2e50de4b49520e73bb4f1e51e (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: dr460nf1r3 <dr460nf1r3 at garudalinux dot org>
# Maintainer: Antoine Viallon <antoine@lesviallon.fr>

pkgname=ananicy-cpp-git
_pkgname=ananicy-cpp
pkgver=1.0.0.rc7.r60.g35cab20
pkgrel=1
pkgdesc="Ananicy Cpp is a full rewrite of Ananicy in C++, featuring lower CPU and RAM usage."
url="https://gitlab.com/ananicy-cpp/ananicy-cpp.git"
source=(
	"git+https://gitlab.com/ananicy-cpp/ananicy-cpp.git"
	"git+https://gitlab.com/vnepogodin/std-format.git"
)
md5sums=('SKIP'
         'SKIP')
arch=(x86_64 i386 armv7h)
depends=(fmt spdlog nlohmann-json systemd libelf zlib libbpf)
makedepends=(cmake clang git nlohmann-json bpf)
conflicts=(ananicy-cpp)
provides=(ananicy-cpp)
optdepends=("ananicy-rules-git: community rules"
            "ananicy-rules: Rules based for ananicy-cpp")
pkgver() {
  cd "$_pkgname"
  git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd "$_pkgname"

	git submodule init
	git config submodule."external/std-format".url "${srcdir}/std-format"
	git -c protocol.file.allow=always submodule update

	cmake -B build -S . \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DUSE_EXTERNAL_SPDLOG=ON \
		-DUSE_EXTERNAL_JSON=ON \
		-DUSE_BPF_PROC_IMPL=ON \
		-DBPF_BUILD_LIBBPF=OFF \
		-DUSE_EXTERNAL_FMTLIB=ON
}

build() {
	cd "$_pkgname"
	cmake --build build --target ananicy-cpp
}

package() {
	cd "$_pkgname"
	export DESTDIR="$pkgdir"
	cmake --install build --component Runtime

	install -m755 -d "$pkgdir/etc/ananicy.d"
}