opt/ccache/Pkgfile

42 lines
1.2 KiB
Plaintext
Raw Normal View History

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
2022-10-20 10:17:38 +02:00
# Depends on: cmake
2022-10-23 09:45:25 +02:00
# Optional: asciidoctor hiredis clang-ccache-bindings gcc-fortran-ccache-bindings mingw-ccache-bindings
2006-02-23 16:26:10 +01:00
name=ccache
2023-06-22 10:45:19 +02:00
version=4.8.2
2022-03-05 17:28:35 +01:00
release=1
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() {
2022-10-23 09:45:25 +02:00
prt-get isinst hiredis && PKGMK_CCACHE+=' -D REDIS_STORAGE_BACKEND=ON' || PKGMK_CCACHE+=' -D REDIS_STORAGE_BACKEND=OFF'
2022-10-20 10:17:38 +02:00
2022-10-23 09:45:25 +02:00
cmake -S $name-$version -B build -G Ninja $PKGMK_CCACHE \
2020-11-09 12:34:51 +01:00
-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" \
2023-05-22 21:59:11 +02:00
-D ENABLE_IPO=ON \
2022-10-23 09:45:25 +02:00
-D HIREDIS_FROM_INTERNET=OFF \
-D ZSTD_FROM_INTERNET=OFF \
-D ENABLE_TESTING=OFF
cmake --build build
DESTDIR=$PKG cmake --install build
# install bundled man page else generate it with asciidoctor
if [ ! -e '/usr/bin/asciidoctor' ]; then
install -d $PKG/usr/share/man/man1
install -m 644 $SRC/ccache.1 $PKG/usr/share/man/man1/
fi
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
done
2006-02-23 16:26:10 +01:00
}