mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
32bit Haiku does not support AVX2 and it crashes with invalid instruction. See https://dev.haiku-os.org/ticket/19804 This was found by NetSurf developpers as they are setting up a new Haiku builder and tried to use ccache to speed up the build.
110 lines
2.9 KiB
Bash
110 lines
2.9 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-2022 Joel Rosdahl and other contributors"
|
|
LICENSE="GNU GPL v3
|
|
GNU LGPL v3"
|
|
REVISION="2"
|
|
SOURCE_URI="https://github.com/ccache/ccache/releases/download/v$portVersion/ccache-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="d5a340e199977b7b1e89c0add794132c977fdc2ecc7ca5451e03d43627a1b1be"
|
|
PATCHES="ccache-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
GLOBAL_WRITABLE_FILES="settings/ccache.conf keep-old"
|
|
USER_SETTINGS_FILES="settings/ccache.conf"
|
|
|
|
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
|
|
commandSuffix=$secondaryArchSuffix
|
|
commandBinDir=$binDir
|
|
cmakeExtraFlags=""
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
commandSuffix=
|
|
commandBinDir=$prefix/bin
|
|
|
|
# AVX support is broken on 32bit Haiku, see https://dev.haiku-os.org/ticket/19804
|
|
cmakeExtraFlags="-DHAVE_AVX2=0"
|
|
fi
|
|
|
|
PROVIDES="
|
|
ccache$secondaryArchSuffix = $portVersion
|
|
cmd:ccache$commandSuffix
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libfmt$secondaryArchSuffix
|
|
lib:libhiredis$secondaryArchSuffix
|
|
lib:libxxhash$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
lib:libzstd$secondaryArchSuffix
|
|
"
|
|
|
|
defineDebugInfoPackage ccache$secondaryArchSuffix $commandBinDir/ccache
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
libfmt${secondaryArchSuffix}_devel >= 8
|
|
devel:libhiredis$secondaryArchSuffix
|
|
devel:libxxhash$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
devel:libzstd$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cmake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:xargs
|
|
"
|
|
|
|
TEST_REQUIRES="
|
|
cmd:awk
|
|
cmd:cmp
|
|
cmd:dirname
|
|
cmd:head
|
|
cmd:perl
|
|
cmd:sed
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
cmake -B build -S . \
|
|
$cmakeDirArgs \
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
|
|
-DENABLE_TESTING=OFF $cmakeExtraFlags
|
|
make -C build $jobArgs
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make -C build install
|
|
echo "# System-wide configuration for ccache" > $settingsDir/ccache.conf
|
|
}
|
|
|
|
# Be sure to use -DENABLE_TESTING=ON on BUILD(), otherwise "make check" fails.
|
|
#
|
|
# Reference results on beta5 64 bits (workdir in RAMFS):
|
|
# 52% tests passed, 23 tests failed out of 48
|
|
# Total Test time (real) = 39.52 sec
|
|
# (RAMFS usage causes many: "cannot make pipe for process substitution: Operation not supported")
|
|
#
|
|
# Reference results on beta5 64 bits (workdir in SSD):
|
|
# 88% tests passed, 6 tests failed out of 48
|
|
# Total Test time (real) = 355.56 sec
|
|
# The following tests FAILED:
|
|
# 1 - unittest (Failed)
|
|
# 2 - test.base (Failed)
|
|
# 10 - test.debug_prefix_map (Failed)
|
|
# 23 - test.nocpp2 (Failed)
|
|
# 28 - test.pch (Failed)
|
|
# 46 - test.stats_log (Failed)
|
|
TEST()
|
|
{
|
|
make -C build check
|
|
}
|