llvm12: fix packaging

- The use of wildcards in prepareInstalledDevelLibs results in some
  libraries going missing. In this case, the rather important libclang
  was missing, preventing youCompleteMe from finding it.
- Disable static ibrary build of libunwind since there is a shared one.
This commit is contained in:
PulkoMandy
2023-01-14 23:39:29 +01:00
parent 29e60bb883
commit 6bb47f2d8f

View File

@@ -31,7 +31,7 @@ other than the ones listed above.
HOMEPAGE="https://www.llvm.org/"
COPYRIGHT="2003-2019 University of Illinois at Urbana-Champaign"
LICENSE="Apache v2 with LLVM Exception"
REVISION="3"
REVISION="4"
SOURCE_URI="https://github.com/llvm/llvm-project/releases/download/llvmorg-$portVersion/llvm-$portVersion.src.tar.xz"
CHECKSUM_SHA256="7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf"
SOURCE_DIR="llvm-$portVersion.src"
@@ -616,7 +616,7 @@ BUILD()
# such as Mesa
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_SKIP_RPATH=YES $cmakeFlags \
-DLLVM_ENABLE_RTTI=ON -DLLVM_LINK_LLVM_DYLIB=YES \
-DLLVM_ENABLE_RTTI=ON -DLLVM_LINK_LLVM_DYLIB=YES -DLIBUNWIND_ENABLE_STATIC=OFF \
-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=$sourceDir/../clang-tools-extra \
-G Ninja \
..
@@ -648,18 +648,100 @@ INSTALL()
binDir=$prefix/bin
fi
# You can try and be fancy here parsing each arch in a for loop... but
# not all arches contain the same libraries. The inventory for each arch
# also changes between releases... so lets KISS.
echo "before prepare"
ls -l $libDir/libclang*
# FIXME use of wildcards in arguments to prepareInstalledDevelLibs does not work, the libraries
# end up missing from $libDir.
prepareInstalledDevelLibs \
libclang \
libclangAPINotes \
libclangARCMigrate \
libclangAST \
libclangASTMatchers \
libclangAnalysis \
libclangApplyReplacements \
libclangBasic \
libclangChangeNamespace \
libclangCodeGen \
libclangCrossTU \
libclangDaemon \
libclangDaemonTweaks \
libclangDependencyScanning \
libclangDirectoryWatcher \
libclangDoc \
libclangDriver \
libclangDynamicASTMatchers \
libclangEdit \
libclangFormat \
libclangFrontend \
libclangFrontendTool \
libclangHandleCXX \
libclangHandleLLVM \
libclangIncludeFixer \
libclangIncludeFixerPlugin \
libclangIndex \
libclangIndexSerialization \
libclangLex \
libclangMove \
libclangParse \
libclangQuery \
libclangReorderFields \
libclangRewrite \
libclangRewriteFrontend \
libclangSema \
libclangSerialization \
libclangStaticAnalyzerCheckers \
libclangStaticAnalyzerCore \
libclangStaticAnalyzerFrontend \
libclangTesting \
libclangTidy \
libclangTidyAbseilModule \
libclangTidyAlteraModule \
libclangTidyAndroidModule \
libclangTidyBoostModule \
libclangTidyBugproneModule \
libclangTidyCERTModule \
libclangTidyConcurrencyModule \
libclangTidyCppCoreGuidelinesModule \
libclangTidyDarwinModule \
libclangTidyFuchsiaModule \
libclangTidyGoogleModule \
libclangTidyHICPPModule \
libclangTidyLLVMLibcModule \
libclangTidyLLVMModule \
libclangTidyLinuxKernelModule \
libclangTidyMPIModule \
libclangTidyMain \
libclangTidyMiscModule \
libclangTidyModernizeModule \
libclangTidyObjCModule \
libclangTidyOpenMPModule \
libclangTidyPerformanceModule \
libclangTidyPlugin \
libclangTidyPortabilityModule \
libclangTidyReadabilityModule \
libclangTidyUtils \
libclangTidyZirconModule \
libclangTooling \
libclangToolingASTDiff \
libclangToolingCore \
libclangToolingInclusions \
libclangToolingRefactoring \
libclangToolingSyntax \
libclangTransformer \
libclangdRemoteIndex \
libclangdSupport \
libfindAllSymbols \
libLLVM* \
libLTO \
libclang* \
liblld* \
libRemarks \
libunwind
echo "after prepare"
ls -l $libDir/libclang*
# adjust cmake library paths because prepareInstalledDevelLibs moved them
sed -i 's,\${_IMPORT_PREFIX}/lib/,\${_IMPORT_PREFIX}/develop/lib/,' \
$libDir/cmake/clang/ClangTargets-release.cmake \