aports/main/ccache/APKBUILD

63 lines
1.4 KiB
Text

# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ccache
pkgver=4.11.2
pkgrel=0
pkgdesc="fast C/C++ compiler cache"
url="https://ccache.dev/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
asciidoctor
cmake
doctest-dev
hiredis-dev
linux-headers
perl
samurai
xxhash-dev
zstd-dev
"
checkdepends="bash util-linux-misc python3"
subpackages="$pkgname-doc"
source="https://github.com/ccache/ccache/releases/download/v$pkgver/ccache-$pkgver.tar.xz
"
prepare() {
default_prepare
# The riscv64 builder seems to have setgid bit set,
# which causes tests 2, 22, and 34 to fail.
chmod -v -s .
}
build() {
cmake -B build -G Ninja \
-DCCACHE_DEV_MODE=OFF \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
check() {
case "$CARCH" in
s390x) ctest --test-dir build -E "(unittest)";;
*) ctest --test-dir build;;
esac
}
package() {
DESTDIR="$pkgdir" cmake --install build
local link=
mkdir -p "$pkgdir"/usr/lib/ccache/bin
for link in cc gcc g++ cpp c++ $CHOST-cc $CHOST-gcc \
$CHOST-g++ $CHOST-c++ c89 c99; do
ln -sf ../../../bin/ccache "$pkgdir"/usr/lib/ccache/bin/$link
done
}
sha512sums="
6c0f1243097ee93e7d73d5bdcd4609f771fd19e4b52afc5f9b813663b7d195ec503efb990c3b5205d8e9fa6dd16f78c031d93d5cff47223e6d4c1986ac1d6315 ccache-4.11.2.tar.xz
"