summaryrefslogtreecommitdiff
path: root/ccache/Pkgfile
blob: b885cad00558ed0432c43b3277423b58a0e92254 (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: clang-ccache-bindings asciidoc zstd
    6 
    7 name=ccache
    8 version=4.2
    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 	[[ -e '/usr/bin/ninja' ]] && PKGMK_CCACHE+=' -G Ninja'
   15 
   16 	cmake -S $name-$version -B build $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 ZSTD_FROM_INTERNET="$(prt-get isinst zstd &> /dev/null && echo OFF || echo ON)"
   23 
   24 	cmake --build build
   25 	DESTDIR=$PKG cmake --install build
   26 
   27 	# install bundled man page else generate it with asciidoc
   28 	if [ ! -e '/usr/bin/asciidoc' ]; then
   29 		install -d $PKG/usr/share/man/man1
   30 		install -m 644 $SRC/ccache.1 $PKG/usr/share/man/man1/
   31 	fi
   32 
   33 	install -d $PKG/usr/lib/ccache
   34 
   35 	for c in cc gcc g++ cpp c++; do
   36 		ln -s /usr/bin/ccache $PKG/usr/lib/ccache/$c
   37 	done
   38 }

Generated by cgit