From 3a1d19741efe6daeae00589b280da78efc7d0532 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 23 May 2024 10:14:38 -0700 Subject: [PATCH] Add recipe for haiku-format 18.1.6 --- .../haiku-format/haiku_format-18.1.6.recipe | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sys-devel/haiku-format/haiku_format-18.1.6.recipe diff --git a/sys-devel/haiku-format/haiku_format-18.1.6.recipe b/sys-devel/haiku-format/haiku_format-18.1.6.recipe new file mode 100644 index 000000000..34b6866fb --- /dev/null +++ b/sys-devel/haiku-format/haiku_format-18.1.6.recipe @@ -0,0 +1,63 @@ +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="d715369f5eb9669a1a278ffa3ee9fd47fd8d1aae" +SOURCE_URI="https://github.com/owenca/llvm-project/archive/$srcGitRev.tar.gz" +SOURCE_DIR="llvm-project-$srcGitRev" +CHECKSUM_SHA256="4341226425d3a37c2c85e6aaa11b4d82e453e0e3eaa0e95b9db220aa8e89a172" + +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 +}