mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-11 06:10:06 +02:00
* Add PATCH() to use Haiku-style directories instead of the defaults: /usr/local/etc/ccache.conf => /boot/system/settings/ccache.conf $HOME/.ccache/ccache.conf => /home/config/cache/ccache/ccache.conf $HOME/.ccache/ => /home/config/cache/ccache/ /usr/local/bin/ => /boot/home/config/non-packaged/bin/ * Create [/boot/system/]settings/ccache.conf as the system-wide configuration file with the "keep-old" label. * Pass "`finddir B_SYSTEM_SETTINGS_DIRECTORY`" as sysconfdir in order to have the short path displayed instead of the long one, in case the system-wide configuration file contains errors.
67 lines
1.7 KiB
Bash
67 lines
1.7 KiB
Bash
SUMMARY="A fast compiler cache"
|
|
DESCRIPTION="ccache speeds up recompilation by caching previous \
|
|
compilations and detecting when same compilation is being done again. \
|
|
Supported languages are C, C++, Objective-C and Objective-C++."
|
|
HOMEPAGE="https://ccache.samba.org/"
|
|
COPYRIGHT="2002-2007 Andrew Tridgell
|
|
2009-2016 Joel Rosdahl"
|
|
LICENSE="GNU GPL v3"
|
|
REVISION="1"
|
|
SOURCE_URI="https://samba.org/ftp/ccache/ccache-$portVersion.tar.bz2"
|
|
CHECKSUM_SHA256="7a553809e90faf9de3a23ee9c5b5f786cfd4836bf502744bedb824a24bee1097"
|
|
|
|
ARCHITECTURES="x86 x86_gcc2 x86_64"
|
|
|
|
GLOBAL_WRITABLE_FILES="settings/ccache.conf keep-old"
|
|
USER_SETTINGS_FILES="settings/ccache.conf"
|
|
|
|
PROVIDES="
|
|
ccache = $portVersion
|
|
cmd:ccache
|
|
"
|
|
REQUIRES="
|
|
haiku
|
|
lib:libz >= 1
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku_devel
|
|
devel:libz
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:awk
|
|
cmd:gcc
|
|
cmd:make
|
|
cmd:xargs
|
|
"
|
|
|
|
PATCH()
|
|
{
|
|
USER_CACHE_DIR="`finddir B_USER_CACHE_DIRECTORY`"
|
|
USER_NONPACKAGED_BIN_DIR="`finddir B_USER_NONPACKAGED_BIN_DIRECTORY`"
|
|
SYSTEM_SETTINGS_DIR="`finddir B_SYSTEM_SETTINGS_DIRECTORY`"
|
|
|
|
sed -i -e "s|\(conf->cache_dir = format(\"%s/\).\(ccache\", \)get_home_directory()\();\)|\1\2\"$USER_CACHE_DIR\"\3|;" \
|
|
conf.c
|
|
|
|
sed -i \
|
|
-e "s|cp ccache /usr/local/bin/|cd ${USER_NONPACKAGED_BIN_DIR//-/\\\\-}|;" \
|
|
-e "s|\(\\-s \)\(ccache \)/usr/local/bin/|\1/bin/\2|;" \
|
|
-e "s|/usr/local/etc/ccache|$SYSTEM_SETTINGS_DIR/ccache|;" \
|
|
-e "s|\$HOME/\\\\&\\.ccache|$USER_CACHE_DIR/ccache|;" \
|
|
ccache.1
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
runConfigure --omit-dirs sysconfDir ./configure \
|
|
--sysconfdir="`finddir B_SYSTEM_SETTINGS_DIRECTORY`"
|
|
make $jobArgs
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install
|
|
echo "# System-wide configuration for ccache" > $settingsDir/ccache.conf
|
|
}
|