lang/cling: Update to 1.2 and assume maintainership

This commit is contained in:
Gleb Popov
2025-03-23 14:53:49 +03:00
parent a4db1fde82
commit 29d4ca63c5
9 changed files with 96 additions and 3032 deletions
+31 -54
View File
@@ -1,68 +1,45 @@
PORTNAME= cling
DISTVERSION= 0.5-2018-08-13
PORTREVISION= 13
DISTVERSIONPREFIX= v
DISTVERSION= 1.2
CATEGORIES= lang devel
MASTER_SITES= https://root.cern.ch/download/cling/
DISTNAME= ${PORTNAME}_${DISTVERSION:C/^[0-9]\.[0-9]-//}_sources
MAINTAINER= ports@FreeBSD.org
MAINTAINER= arrowd@FreeBSD.org
COMMENT= Interactive C++ Interpreter Based on LLVM and Clang Libs
WWW= https://root.cern.ch/cling
WWW= https://root.cern/cling/
LICENSE= LLVM NCSA
LICENSE_COMB= multi
LICENSE_NAME_LLVM= LLVM Release License
LICENSE_FILE_LLVM= ${WRKSRC}/LICENSE.TXT
LICENSE_FILE_NCSA= ${WRKSRC}/tools/cling/LICENSE.TXT
LICENSE_PERMS_LLVM= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
LICENSE= NCSA
LICENSE_FILE= ${WRKSRC}/LICENSE.TXT
BROKEN_armv6= fails to compile: AArch64TargetMachine.cpp: relocation truncated to fit: R_ARM_CALL against symbol '__aeabi_uldivmod'
BROKEN_armv7= fails to compile: AArch64TargetMachine.cpp: relocation truncated to fit: R_ARM_CALL against symbol '__aeabi_uldivmod'
BROKEN_riscv64= fails to build: CMake Error at cmake/config-ix.cmake:407: Unknown architecture riscv64
LIB_DEPENDS= libgtest.so:devel/googletest \
libz3.so:math/z3
USES= cmake compiler:c++11-lib compiler:c11 gnome libedit ncurses python:build shebangfix tar:bzip2
USES= cmake gnome
USE_GNOME= libxml2
CMAKE_ARGS= -DINSTALL_LAYOUT=FREEBSD
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}
CMAKE_OFF= LLVM_BUILD_EXAMPLES LLVM_INCLUDE_TESTS LLVM_INCLUDE_GO_TESTS
CMAKE_ON= BUILD_SHARED_LIBS
LDFLAGS+= -Wl,--undefined-version
USE_LDCONFIG= ${LLVM_PREFIX}/lib
WRKSRC= ${WRKDIR}/src
USE_GITHUB= yes
GH_ACCOUNT= root-project
GH_PROJECT= llvm-project:llvm
GH_TAGNAME= cling-llvm18-20250207-01:llvm
SUB_LIST= LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
PLIST_SUB= LLVM_SUFFIX=${LLVM_SUFFIX} LLVM_RELEASE=${LLVM_RELEASE}
CMAKE_SOURCE_PATH=${WRKSRC}/llvm/llvm
CMAKE_ARGS= -DLLVM_EXTERNAL_PROJECTS=cling \
-DLLVM_EXTERNAL_CLING_SOURCE_DIR=${WRKSRC} \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_TARGETS_TO_BUILD="host;NVPTX"
# cling fails quickly with assertions enabled
CMAKE_ARGS+= -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF
LLVM_RELEASE= 5.0.0
LLVM_SUFFIX= 50_cern-root
LLVM_PREFIX= ${PREFIX}/llvm${LLVM_SUFFIX}
ALL_TARGET= cling
CONFLICTS_INSTALL= llvm zapcc # bin/bugpoint bin/c-index-test bin/clang bin/clang++ bin/clang-5.0 bin/clang-check bin/clang-cl bin/clang-cpp bin/clang-format bin/clang-import-test bin/clang-offload-bundler bin/clang-rename bin/git-clang-format
.include <bsd.port.pre.mk>
SHEBANG_FILES= tools/clang/tools/clang-format/clang-format-diff.py \
tools/clang/tools/clang-format/git-clang-format \
tools/clang/tools/scan-view/bin/scan-view
.if defined(WITH_DEBUG)
CFLAGS= -DNDEBUG -g -O0
CXXFLAGS= -DNDEBUG -g -O0
INSTALL_TARGET= tools/cling/tools/install
.else
INSTALL_TARGET= tools/cling/tools/install/strip
.endif
post-patch:
@${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|g' ${WRKSRC}/tools/cling/lib/Interpreter/CIFactory.cpp ${WRKSRC}/tools/cling/tools/driver/cling.cpp
post-extract:
# for patching purposes
${MV} ${WRKSRC_llvm} ${WRKSRC}/llvm
post-install:
for e in $$(cd ${STAGEDIR}${PREFIX}/llvm50_cern-root/bin && ls *); do \
${RLN} ${STAGEDIR}${PREFIX}/llvm50_cern-root/bin/$${e} ${STAGEDIR}${PREFIX}/bin/$${e}; \
done
${MKDIR} ${STAGEDIR}${PREFIX}/lib/cmake
for m in cling llvm llvm-c clang; do \
${RLN} ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}/include/$${m} ${STAGEDIR}${PREFIX}/include/$${m}; \
done
for m in cling llvm clang; do \
${RLN} ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}/lib/cmake/$${m} ${STAGEDIR}${PREFIX}/lib/cmake/$${m}; \
done
for l in $$(cd ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}/lib && ls *.so* *.a); do \
${RLN} ${STAGEDIR}${PREFIX}/llvm${LLVM_SUFFIX}/lib/$${l} ${STAGEDIR}${PREFIX}/lib/$${l}; \
done
.include <bsd.port.mk>
.include <bsd.port.post.mk>
+5 -3
View File
@@ -1,3 +1,5 @@
TIMESTAMP = 1534225270
SHA256 (cling_2018-08-13_sources.tar.bz2) = f73f1c7e799c71f2fe815539634751bca1d0ac112c0e81f4afd5f84d668c997f
SIZE (cling_2018-08-13_sources.tar.bz2) = 211904908
TIMESTAMP = 1742725525
SHA256 (root-project-cling-v1.2_GH0.tar.gz) = beee8e461424d267ee2dec88b3de57326bc8e3470b4ceae2744de7d3d3aba1eb
SIZE (root-project-cling-v1.2_GH0.tar.gz) = 13695605
SHA256 (root-project-llvm-project-cling-llvm18-20250207-01_GH0.tar.gz) = 7b8fc17e40af6c69d6f33f8cf931c22cc411dccaa210ed53ae3f09dcba591515
SIZE (root-project-llvm-project-cling-llvm18-20250207-01_GH0.tar.gz) = 205643261
@@ -0,0 +1,11 @@
--- lib/Interpreter/CMakeLists.txt.orig 2024-12-10 16:14:05 UTC
+++ lib/Interpreter/CMakeLists.txt
@@ -103,6 +103,8 @@ add_cling_library(clingInterpreter OBJECT
LINK_LIBS
${LIBS}
${CMAKE_DL_LIBS}
+ procstat
+ util
)
@@ -0,0 +1,12 @@
--- lib/Interpreter/Interpreter.cpp.orig 2024-12-10 16:14:05 UTC
+++ lib/Interpreter/Interpreter.cpp
@@ -268,8 +268,7 @@ namespace cling {
Preprocessor& PP = SemaRef.getPreprocessor();
m_LookupHelper.reset(new LookupHelper(new Parser(PP, SemaRef,
- /*SkipFunctionBodies*/false,
- /*isTemp*/true), this));
+ /*SkipFunctionBodies*/false), this));
if (!m_LookupHelper)
return;
@@ -0,0 +1,33 @@
--- llvm/clang/lib/Lex/Pragma.cpp.orig 2025-02-07 08:51:59 UTC
+++ llvm/clang/lib/Lex/Pragma.cpp
@@ -934,9 +934,11 @@ void Preprocessor::AddPragmaHandler(StringRef Namespac
}
// Check to make sure we don't already have a pragma for this identifier.
- assert(!InsertNS->FindHandler(Handler->getName()) &&
- "Pragma handler already exists for this identifier!");
- InsertNS->AddPragma(Handler);
+ // assert(!InsertNS->FindHandler(Handler->getName()) &&
+ // "Pragma handler already exists for this identifier!");
+
+ if (!InsertNS->FindHandler(Handler->getName()))
+ InsertNS->AddPragma(Handler);
}
/// RemovePragmaHandler - Remove the specific pragma handler from the
@@ -950,12 +952,15 @@ void Preprocessor::RemovePragmaHandler(StringRef Names
// If this is specified to be in a namespace, step down into it.
if (!Namespace.empty()) {
PragmaHandler *Existing = PragmaHandlers->FindHandler(Namespace);
+ if (!Existing)
+ return;
assert(Existing && "Namespace containing handler does not exist!");
NS = Existing->getIfNamespace();
assert(NS && "Invalid namespace, registered as a regular pragma handler!");
}
+ if (NS->FindHandler(Handler->getName()))
NS->RemovePragmaHandler(Handler);
// If this is a non-default namespace and it is now empty, remove it.
@@ -1,18 +0,0 @@
--- projects/CMakeLists.txt.orig 2018-08-14 06:56:08 UTC
+++ projects/CMakeLists.txt
@@ -8,7 +8,6 @@ foreach(entry ${entries})
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND
- (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/parallel-libs) AND
(NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp))
@@ -27,7 +26,6 @@ if(${LLVM_BUILD_RUNTIME})
if(NOT MSVC OR LLVM_FORCE_BUILD_RUNTIME)
# Add the projects in reverse order of their dependencies so that the
# dependent projects can see the target names of their dependencies.
- add_llvm_external_project(libunwind)
add_llvm_external_project(libcxxabi)
add_llvm_external_project(libcxx)
endif()
@@ -1,11 +0,0 @@
--- tools/cling/lib/Interpreter/CIFactory.cpp.orig 2018-08-14 07:05:28 UTC
+++ tools/cling/lib/Interpreter/CIFactory.cpp
@@ -187,7 +187,7 @@ namespace {
// Note: Otherwise it uses dladdr().
//
return CompilerInvocation::GetResourcesPath(
- "cling", (void*)intptr_t(GetExecutablePath));
+ "%%LLVM_PREFIX%%/bin/cling", (void*)intptr_t(GetExecutablePath));
} else {
std::string resourcePath;
llvm::SmallString<512> tmp(llvmdir);
@@ -1,11 +0,0 @@
--- tools/cling/tools/driver/cling.cpp.orig 2018-08-14 07:04:11 UTC
+++ tools/cling/tools/driver/cling.cpp
@@ -76,7 +76,7 @@ int main( int argc, char **argv ) {
#endif
// Set up the interpreter
- cling::Interpreter Interp(argc, argv);
+ cling::Interpreter Interp(argc, argv, "%%LLVM_PREFIX%%/");
const cling::InvocationOptions& Opts = Interp.getOptions();
if (!Interp.isValid()) {
+4 -2935
View File
File diff suppressed because it is too large Load Diff