2015-02-11 14:02:22 +01:00
|
|
|
# Description: A fast compiler cache.
|
2019-07-27 14:23:08 +02:00
|
|
|
# URL: https://ccache.dev/
|
2014-11-10 13:25:50 +01:00
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
2020-10-28 13:06:41 +01:00
|
|
|
# Depends on: cmake
|
2021-09-19 09:50:30 +02:00
|
|
|
# Optional: clang-ccache-bindings asciidoctor
|
2006-02-23 16:26:10 +01:00
|
|
|
|
|
|
|
name=ccache
|
2021-09-29 15:32:10 +02:00
|
|
|
version=4.4.2
|
2021-09-19 07:24:53 +02:00
|
|
|
release=2
|
2020-10-28 13:06:41 +01:00
|
|
|
source=(https://github.com/$name/$name/releases/download/v$version/$name-$version.tar.xz
|
2020-11-23 14:03:04 +01:00
|
|
|
ccache.1)
|
2006-02-23 16:26:10 +01:00
|
|
|
|
|
|
|
build() {
|
2020-11-09 12:34:51 +01:00
|
|
|
[[ -e '/usr/bin/ninja' ]] && PKGMK_CCACHE+=' -G Ninja'
|
|
|
|
|
|
|
|
cmake -S $name-$version -B build $PKGMK_CCACHE \
|
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
2020-11-23 14:39:13 +01:00
|
|
|
-D CMAKE_INSTALL_LIBDIR=lib \
|
2020-11-09 12:34:51 +01:00
|
|
|
-D CMAKE_BUILD_TYPE=Release \
|
2020-11-23 14:39:13 +01:00
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
|
|
|
|
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
|
2021-08-22 16:10:56 +02:00
|
|
|
-D ZSTD_FROM_INTERNET=ON \
|
|
|
|
-D REDIS_STORAGE_BACKEND=OFF
|
2012-06-14 15:22:38 +02:00
|
|
|
|
2020-10-28 13:06:41 +01:00
|
|
|
cmake --build build
|
|
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
|
2021-09-19 09:50:30 +02:00
|
|
|
# install bundled man page else generate it with asciidoctor
|
|
|
|
if [ ! -e '/usr/bin/asciidoctor' ]; then
|
2020-10-28 13:06:41 +01:00
|
|
|
install -d $PKG/usr/share/man/man1
|
|
|
|
install -m 644 $SRC/ccache.1 $PKG/usr/share/man/man1/
|
|
|
|
fi
|
2012-06-14 15:22:38 +02:00
|
|
|
|
2018-09-07 11:03:12 +02:00
|
|
|
install -d $PKG/usr/lib/ccache
|
2015-02-11 14:02:22 +01:00
|
|
|
|
2018-09-07 11:03:12 +02:00
|
|
|
for c in cc gcc g++ cpp c++; do
|
2015-02-11 14:02:22 +01:00
|
|
|
ln -s /usr/bin/ccache $PKG/usr/lib/ccache/$c
|
2012-06-14 15:22:38 +02:00
|
|
|
done
|
2006-02-23 16:26:10 +01:00
|
|
|
}
|