diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0003-Remove-unsupported-src-root-flag.patch b/pkgs/applications/editors/jupyter-kernels/xeus-cling/0003-Remove-unsupported-src-root-flag.patch new file mode 100644 index 000000000000..8a44919e47d5 --- /dev/null +++ b/pkgs/applications/editors/jupyter-kernels/xeus-cling/0003-Remove-unsupported-src-root-flag.patch @@ -0,0 +1,85 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 43718f5..d0d8670 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,8 +63,7 @@ if(LLVM_CONFIG) + "--bindir" + "--libdir" + "--includedir" +- "--prefix" +- "--src-root") ++ "--prefix") + execute_process(COMMAND ${CONFIG_COMMAND} + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT) +diff --git a/src/xmagics/executable.cpp b/src/xmagics/executable.cpp +index 391c8c9..aba5e03 100644 +--- a/src/xmagics/executable.cpp ++++ b/src/xmagics/executable.cpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -25,7 +26,7 @@ + #include "clang/AST/ASTContext.h" + #include "clang/AST/DeclGroup.h" + #include "clang/AST/RecursiveASTVisitor.h" +-#include "clang/Basic/DebugInfoOptions.h" ++#include "llvm/Frontend/Debug/Options.h" + #include "clang/Basic/Sanitizers.h" + #include "clang/Basic/TargetInfo.h" + #include "clang/CodeGen/BackendUtil.h" +@@ -115,7 +116,7 @@ namespace xcpp + // Filter out functions added by Cling. + if (auto Identifier = D->getIdentifier()) + { +- if (Identifier->getName().startswith("__cling")) ++ if (Identifier->getName().starts_with("__cling")) + { + return true; + } +@@ -153,12 +154,13 @@ namespace xcpp + if (EnableDebugInfo) + { + CodeGenOpts.setDebugInfo( +- clang::codegenoptions::DebugInfoKind::FullDebugInfo); ++ llvm::codegenoptions::DebugInfoKind::FullDebugInfo); + } + + std::unique_ptr CG(clang::CreateLLVMCodeGen( +- CI->getDiagnostics(), "object", HeaderSearchOpts, +- CI->getPreprocessorOpts(), CodeGenOpts, *Context)); ++ CI->getDiagnostics(), "object", ++ llvm::IntrusiveRefCntPtr(&CI->getVirtualFileSystem()), ++ HeaderSearchOpts, CI->getPreprocessorOpts(), CodeGenOpts, *Context)); + CG->Initialize(AST); + + FindTopLevelDecls Visitor(CG.get()); +@@ -186,7 +188,9 @@ namespace xcpp + EmitBackendOutput(CI->getDiagnostics(), HeaderSearchOpts, + CodeGenOpts, CI->getTargetOpts(), + CI->getLangOpts(), DataLayout, CG->GetModule(), +- clang::Backend_EmitObj, std::move(OS)); ++ clang::Backend_EmitObj, ++ llvm::IntrusiveRefCntPtr(&CI->getVirtualFileSystem()), ++ std::move(OS)); + return true; + } + +@@ -222,10 +226,10 @@ namespace xcpp + + llvm::StringRef OutputFileStr(OutputFile); + llvm::StringRef ErrorFileStr(ErrorFile); +- llvm::SmallVector, 16> Redirects = {llvm::NoneType::None, OutputFileStr, ErrorFileStr}; ++ llvm::SmallVector, 16> Redirects = {std::nullopt, OutputFileStr, ErrorFileStr}; + + // Finally run the linker. +- int ret = llvm::sys::ExecuteAndWait(Compiler, Args, llvm::NoneType::None, ++ int ret = llvm::sys::ExecuteAndWait(Compiler, Args, std::nullopt, + Redirects); + + // Read back output and error streams. diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix b/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix index af0c5cce88f3..843f4a07b71d 100644 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix +++ b/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix @@ -3,7 +3,7 @@ clangStdenv, cmake, fetchFromGitHub, - llvmPackages_13, + llvmPackages_18, # Libraries argparse, cling, @@ -65,6 +65,7 @@ clangStdenv.mkDerivation rec { patches = [ ./0001-Fix-bug-in-extract_filename.patch ./0002-Don-t-pass-extra-includes-configure-this-with-flags.patch + ./0003-Remove-unsupported-src-root-flag.patch ]; nativeBuildInputs = [ cmake ]; @@ -73,7 +74,7 @@ clangStdenv.mkDerivation rec { cling.unwrapped cppzmq libuuid - llvmPackages_13.llvm + llvmPackages_18.llvm ncurses openssl pugixml