haiku-format: upgrade to 21.1.8 (#13572)

This commit is contained in:
owenca
2026-01-07 03:05:00 -08:00
committed by GitHub
parent d8e135cd3d
commit 3dca187708
2 changed files with 85 additions and 63 deletions

View File

@@ -1,63 +0,0 @@
SUMMARY="Code formatter for Haiku coding style"
DESCRIPTION="Format C/C++ code following the Haiku Coding Guidelines.
This is a superset of clang-format with extensions that implement the coding style followed by \
Haiku and several applications running on Haiku.
haiku-format looks for a configuration file '.haiku-format', going up the file hierarchy starting \
with the folder of the file you want to format. This optional configuration file can be used to \
override any default Haiku style options."
HOMEPAGE="https://github.com/owenca/haiku-format"
COPYRIGHT="2003-2019 University of Illinois at Urbana-Champaign
2018-2024 Owen Pan"
LICENSE="Apache v2 with LLVM Exception"
REVISION="1"
srcGitRev="haiku-$portVersion"
SOURCE_URI="https://github.com/owenca/llvm-project/archive/refs/tags/$srcGitRev.tar.gz"
CHECKSUM_SHA256="7705d9fbdaf7f0a0e5e8793272e6eef671a27044e8baebea09e204e7fd322c17"
SOURCE_DIR="llvm-project-$srcGitRev"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
haiku_format$secondaryArchSuffix = $portVersion
cmd:git_haiku_format = $portVersion
cmd:haiku_format = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ninja
cmd:python3
cmd:sed
"
BUILD()
{
cmake -S llvm -B build -G Ninja \
-DLLVM_ENABLE_PROJECTS=clang \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=On \
-Wno-dev
ninja -C build clang-format
strip -sv build/bin/clang-format
}
INSTALL()
{
mkdir -pv $prefix/bin
cp -fv build/bin/clang-format $prefix/bin/haiku-format
gitHaikuFormat=$prefix/bin/git-haiku-format
sed s/clang-format/haiku-format/g clang/tools/clang-format/git-clang-format > $gitHaikuFormat
chmod -v +x $gitHaikuFormat
}

View File

@@ -0,0 +1,85 @@
SUMMARY="Code formatter for Haiku coding style"
DESCRIPTION="Format C/C++ code following the Haiku Coding Guidelines.
This is a superset of clang-format with extensions that implement the coding style followed by \
Haiku and several applications running on Haiku.
haiku-format looks for a configuration file '.haiku-format', going up the file hierarchy starting \
with the folder of the file you want to format. This optional configuration file can be used to \
override any default Haiku style options."
HOMEPAGE="https://github.com/owenca/haiku-format"
COPYRIGHT="2003-2019 University of Illinois at Urbana-Champaign
2018-2026 Owen Pan"
LICENSE="Apache v2 with LLVM Exception"
REVISION="1"
baseURI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$portVersion"
SOURCE_DIR="clang-$portVersion.src"
SOURCE_URI="$baseURI/$SOURCE_DIR.tar.xz"
CHECKSUM_SHA256="6090e3f23720d003cdd84483a47d0eec6d01adbb5e0c714ac0c8b58de546aa62"
SOURCE_DIR_2="cmake-$portVersion.src"
SOURCE_URI_2="$baseURI/$SOURCE_DIR_2.tar.xz"
CHECKSUM_SHA256_2="85735f20fd8c81ecb0a09abb0c267018475420e93b65050cc5b7634eab744de9"
SOURCE_DIR_3="llvm-$portVersion.src"
SOURCE_URI_3="$baseURI/$SOURCE_DIR_3.tar.xz"
CHECKSUM_SHA256_3="d9022ddadb40a15015f6b27e6549a7144704ded8828ba036ffe4b8165707de21"
SOURCE_DIR_4="third-party-$portVersion.src"
SOURCE_URI_4="$baseURI/$SOURCE_DIR_4.tar.xz"
CHECKSUM_SHA256_4="7fe99424384aea529ffaeec9cc9dfb8b451fd1852c03fc109e426fe208a1f1a7"
srcGitRev="4458d292953a08b42da15ea558fca748efb9674a"
diffFile="v$portVersion.diff"
SOURCE_URI_5="https://raw.githubusercontent.com/owenca/haiku-format/$srcGitRev/$diffFile#noarchive"
CHECKSUM_SHA256_5="cabb1a3310eff1fae49e5ec8998f3fb7bc265cbd2eb5bb5f9339aa4a295994cb"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
haiku_format$secondaryArchSuffix = $portVersion
cmd:git_haiku_format = $portVersion
cmd:haiku_format = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ninja
cmd:patch
cmd:python3
"
BUILD()
{
patch -p2 -r - < $sourceDir5/$diffFile
cd $sourceDir3/..
ln -fsv $sourceDir clang
ln -fsv $sourceDir2 cmake
ln -fsv $sourceDir3 llvm
ln -fsv $sourceDir4 third-party
cmake -Wno-dev -S llvm -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=On \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_TARGETS_TO_BUILD=X86
ninja -C build clang-format
strip -sv build/bin/clang-format
}
INSTALL()
{
mkdir -pv $binDir
cp -fv $sourceDir3/../build/bin/clang-format $binDir/haiku-format
gitHaikuFormat="$binDir/git-haiku-format"
sed s/clang-format/haiku-format/g tools/clang-format/git-clang-format > $gitHaikuFormat
chmod -v +x $gitHaikuFormat
}