# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=ccls
pkgver=0.20240202
pkgrel=0
pkgdesc="C/C++/Objective-C language server"
url="https://github.com/MaskRay/ccls"
arch="all"
license="Apache-2.0"
makedepends="
	clang-dev
	clang-static
	cmake
	libxml2-dev
	llvm-dev
	llvm-gtest
	llvm-static
	rapidjson-dev
	samurai
	zlib-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/MaskRay/ccls/archive/$pkgver.tar.gz"
options="!check"  # no tests

build() {
	CC=clang \
	CXX=clang++ \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_C_COMPILER=clang \
		-DCMAKE_CXX_COMPILER=clang++ \
		-DCLANG_LINK_CLANG_DYLIB=on \
		-DLLVM_LINK_LLVM_DYLIB=on
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bf30c869b985d7d6c0ecabfcc563b4983616c4f47ba743586a23441575695d87557113cdfd2603185adc454940d9244c331d9dc16444564358c910e2d61e9281  ccls-0.20240202.tar.gz
"
