blob: 494be255ce4bd3a90b132df6120a1cc40ffc4a3c (
plain)
1 # Description: A fast compiler cache.
2 # URL: https://ccache.dev/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: cmake
5 # Optional: asciidoctor hiredis clang-ccache-bindings gcc-fortran-ccache-bindings mingw-ccache-bindings
6
7 name=ccache
8 version=4.7.4
9 release=1
10 source=(https://github.com/$name/$name/releases/download/v$version/$name-$version.tar.xz
11 ccache.1)
12
13 build() {
14 prt-get isinst hiredis && PKGMK_CCACHE+=' -D REDIS_STORAGE_BACKEND=ON' || PKGMK_CCACHE+=' -D REDIS_STORAGE_BACKEND=OFF'
15
16 cmake -S $name-$version -B build -G Ninja $PKGMK_CCACHE \
17 -D CMAKE_INSTALL_PREFIX=/usr \
18 -D CMAKE_INSTALL_LIBDIR=lib \
19 -D CMAKE_BUILD_TYPE=Release \
20 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
21 -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
22 -D HIREDIS_FROM_INTERNET=OFF \
23 -D ZSTD_FROM_INTERNET=OFF \
24 -D ENABLE_TESTING=OFF
25
26 cmake --build build
27 DESTDIR=$PKG cmake --install build
28
29 # install bundled man page else generate it with asciidoctor
30 if [ ! -e '/usr/bin/asciidoctor' ]; then
31 install -d $PKG/usr/share/man/man1
32 install -m 644 $SRC/ccache.1 $PKG/usr/share/man/man1/
33 fi
34
35 install -d $PKG/usr/lib/ccache
36
37 for c in cc gcc g++ cpp c++; do
38 ln -s /usr/bin/ccache $PKG/usr/lib/ccache/$c
39 done
40 }
|