diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0001-Fix-bug-in-extract_filename.patch b/pkgs/applications/editors/jupyter-kernels/xeus-cling/0001-Fix-bug-in-extract_filename.patch deleted file mode 100644 index dac0825b01a1..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0001-Fix-bug-in-extract_filename.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 8bfa594bc37630956f80496106bb1d6070035570 Mon Sep 17 00:00:00 2001 -From: thomasjm -Date: Wed, 2 Aug 2023 18:26:58 -0700 -Subject: [PATCH 1/3] Fix bug in extract_filename - ---- - src/main.cpp | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/main.cpp b/src/main.cpp -index 2ee19be..57294b4 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -61,19 +61,19 @@ bool should_print_version(int argc, char* argv[]) - return false; - } - --std::string extract_filename(int argc, char* argv[]) -+std::string extract_filename(int *argc, char* argv[]) - { - std::string res = ""; -- for (int i = 0; i < argc; ++i) -+ for (int i = 0; i < *argc; ++i) - { -- if ((std::string(argv[i]) == "-f") && (i + 1 < argc)) -+ if ((std::string(argv[i]) == "-f") && (i + 1 < *argc)) - { - res = argv[i + 1]; -- for (int j = i; j < argc - 2; ++j) -+ for (int j = i; j < *argc - 2; ++j) - { - argv[j] = argv[j + 2]; - } -- argc -= 2; -+ *argc -= 2; - break; - } - } -@@ -128,7 +128,7 @@ int main(int argc, char* argv[]) - #endif - signal(SIGINT, stop_handler); - -- std::string file_name = extract_filename(argc, argv); -+ std::string file_name = extract_filename(&argc, argv); - - interpreter_ptr interpreter = build_interpreter(argc, argv); - --- -2.40.1 - diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0002-Don-t-pass-extra-includes-configure-this-with-flags.patch b/pkgs/applications/editors/jupyter-kernels/xeus-cling/0002-Don-t-pass-extra-includes-configure-this-with-flags.patch deleted file mode 100644 index c07e57dfe85d..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0002-Don-t-pass-extra-includes-configure-this-with-flags.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9e6a14bb20567071883563dafb5dfaf512df6243 Mon Sep 17 00:00:00 2001 -From: thomasjm -Date: Wed, 2 Aug 2023 18:27:16 -0700 -Subject: [PATCH 2/3] Don't pass extra includes; configure this with flags - ---- - src/main.cpp | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/src/main.cpp b/src/main.cpp -index 57294b4..0041a55 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -84,7 +84,7 @@ using interpreter_ptr = std::unique_ptr; - - interpreter_ptr build_interpreter(int argc, char** argv) - { -- int interpreter_argc = argc + 1; -+ int interpreter_argc = argc; - const char** interpreter_argv = new const char*[interpreter_argc]; - interpreter_argv[0] = "xeus-cling"; - // Copy all arguments in the new array excepting the process name. -@@ -92,8 +92,6 @@ interpreter_ptr build_interpreter(int argc, char** argv) - { - interpreter_argv[i] = argv[i]; - } -- std::string include_dir = std::string(LLVM_DIR) + std::string("/include"); -- interpreter_argv[interpreter_argc - 1] = include_dir.c_str(); - - interpreter_ptr interp_ptr = interpreter_ptr(new xcpp::interpreter(interpreter_argc, interpreter_argv)); - delete[] interpreter_argv; --- -2.40.1 - 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 deleted file mode 100644 index 8a44919e47d5..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/0003-Remove-unsupported-src-root-flag.patch +++ /dev/null @@ -1,85 +0,0 @@ -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/default.nix b/pkgs/applications/editors/jupyter-kernels/xeus-cling/default.nix deleted file mode 100644 index 9588900f6dc5..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/default.nix +++ /dev/null @@ -1,94 +0,0 @@ -{ - lib, - callPackage, - cling, - fetchurl, - jq, - makeWrapper, - python3, - stdenv, -}: - -# Jupyter console: -# nix run --impure --expr 'with import {}; jupyter-console.withSingleKernel cpp17-kernel' - -# Jupyter notebook: -# nix run --impure --expr 'with import {}; jupyter.override { definitions = { cpp17 = cpp17-kernel; }; }' - -let - xeus-cling-unwrapped = callPackage ./xeus-cling.nix { }; - - xeus-cling = xeus-cling-unwrapped.overrideAttrs (oldAttrs: { - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ makeWrapper ]; - - # xcpp needs a collection of flags to start up properly, so wrap it by default. - # We'll provide the unwrapped version as a passthru - flags = cling.flags ++ [ - "-resource-dir" - "${cling.unwrapped}" - "-L" - "${cling.unwrapped}/lib" - "-l" - "${cling.unwrapped}/lib/cling.so" - ]; - - fixupPhase = '' - runHook preFixup - - wrapProgram $out/bin/xcpp --add-flags "$flags" - - runHook postFixup - ''; - - doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - - # Smoke check: run a test notebook using Papermill by creating a simple kernelspec - mkdir -p kernels/cpp17 - export JUPYTER_PATH="$(pwd)" - cat << EOF > kernels/cpp17/kernel.json - { - "argv": ["$out/bin/xcpp", "-std=c++17", "-f", "{connection_file}"], - "language": "cpp17" - } - EOF - - ${python3.pkgs.papermill}/bin/papermill ${./test.ipynb} out.ipynb - result="$(cat out.ipynb | ${jq}/bin/jq -r '.cells[0].outputs[0].text[0]')" - if [[ "$result" != "Hello world." ]]; then - echo "Kernel test gave '$result'. Expected: 'Hello world.'" - exit 1 - fi - - runHook postInstallCheck - ''; - - passthru = (oldAttrs.passthru or { }) // { - unwrapped = xeus-cling-unwrapped; - }; - }); - - mkKernelSpec = std: { - displayName = builtins.replaceStrings [ "c++" ] [ "C++ " ] std; - argv = [ - "${xeus-cling}/bin/xcpp" - "-std=${std}" - "-f" - "{connection_file}" - ]; - language = "cpp"; - logo32 = "${xeus-cling-unwrapped}/share/jupyter/kernels/xcpp17/logo-32x32.png"; - logo64 = "${xeus-cling-unwrapped}/share/jupyter/kernels/xcpp17/logo-64x64.png"; - }; - -in - -{ - cpp11-kernel = mkKernelSpec "c++11"; - cpp14-kernel = mkKernelSpec "c++14"; - cpp17-kernel = mkKernelSpec "c++17"; - cpp2a-kernel = mkKernelSpec "c++2a"; - - inherit xeus-cling; -} diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/test.ipynb b/pkgs/applications/editors/jupyter-kernels/xeus-cling/test.ipynb deleted file mode 100644 index 27e5932b8c8f..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/test.ipynb +++ /dev/null @@ -1,24 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "574ed398-7bfe-4a34-a7dd-9fa85535aed2", - "metadata": {}, - "outputs": [], - "source": [ - "#include \n", - "std::cout << \"Hello world.\";" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "C++ 17", - "language": "cpp", - "name": "cpp17" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix b/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix deleted file mode 100644 index 50ee8bbd685c..000000000000 --- a/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ - lib, - clangStdenv, - cmake, - fetchFromGitHub, - llvmPackages_18, - # Libraries - argparse, - cling, - cppzmq, - libuuid, - ncurses, - openssl, - pugixml, - xeus, - xeus-zmq, - xtl, - zeromq, - zlib, - # Settings - debug ? false, -}: - -let - # Nixpkgs moved to argparse 3.x, but we need ~2.9 - argparse_2_9 = argparse.overrideAttrs (oldAttrs: { - version = "2.9"; - - src = fetchFromGitHub { - owner = "p-ranav"; - repo = "argparse"; - rev = "v2.9"; - sha256 = "sha256-vbf4kePi5gfg9ub4aP1cCK1jtiA65bUS9+5Ghgvxt/E="; - }; - }); - - # Nixpkgs moved to xeus 5.2.0, but we need 3.2.0 - # https://github.com/jupyter-xeus/xeus-cling/issues/523 - xeus_3_2_0 = xeus.overrideAttrs (oldAttrs: { - version = "3.2.0"; - - src = fetchFromGitHub { - owner = "jupyter-xeus"; - repo = "xeus"; - tag = "3.2.0"; - sha256 = "sha256-D/dJ0SHxTHJw63gHD6FRZS7O2TVZ0voIv2mQASEjLA8="; - }; - - buildInputs = oldAttrs.buildInputs ++ lib.singleton xtl; - }); - -in - -clangStdenv.mkDerivation (finalAttrs: { - pname = "xeus-cling"; - version = "0.15.3"; - - src = fetchFromGitHub { - owner = "QuantStack"; - repo = "xeus-cling"; - rev = "${finalAttrs.version}"; - hash = "sha256-OfZU+z+p3/a36GntusBfwfFu3ssJW4Fu7SV3SMCoo1I="; - }; - - 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 ]; - buildInputs = [ - argparse_2_9 - cling.unwrapped - cppzmq - libuuid - llvmPackages_18.llvm - ncurses - openssl - pugixml - xeus_3_2_0 - xeus-zmq - xtl - zeromq - zlib - ]; - - cmakeBuildType = if debug then "Debug" else "Release"; - - postPatch = '' - substituteInPlace src/xmagics/executable.cpp \ - --replace-fail "getDataLayout" "getDataLayoutString" - substituteInPlace src/xmagics/execution.cpp \ - --replace-fail "simplisticCastAs" "castAs" - substituteInPlace src/xmime_internal.hpp \ - --replace-fail "code.str()" "code.str().str()" - - substituteInPlace CMakeLists.txt \ - --replace-fail "cmake_minimum_required(VERSION 3.4.3)" "cmake_minimum_required(VERSION 3.10)" - ''; - - dontStrip = debug; - - meta = { - description = "Jupyter kernel for the C++ programming language"; - mainProgram = "xcpp"; - homepage = "https://github.com/jupyter-xeus/xeus-cling"; - maintainers = with lib.maintainers; [ thomasjm ]; - platforms = lib.platforms.unix; - license = lib.licenses.mit; - }; -}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index cdab56d218b2..3b8850b987e1 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -578,6 +578,7 @@ mapAliases { coreth = throw "'coreth' has been moved to 'avalanchego' by upstream"; # Added 2026-01-15 cosmic-tasks = throw "'cosmic-tasks' has been renamed to/replaced by 'tasks'"; # Converted to throw 2025-10-27 cotton = throw "'cotton' has been removed since it is vulnerable to CVE-2025-62518 and upstream is unmaintained"; # Added 2025-10-26 + cpp2a-kernel = cpp20-kernel; # Added 2026-06-30, xeus-cling removed in favour of xeus-cpp cpp-ipfs-api = throw "'cpp-ipfs-api' has been renamed to/replaced by 'cpp-ipfs-http-client'"; # Converted to throw 2025-10-27 cpr = warnAlias "'cpr' has been renamed to/replaced by 'libcpr'" libcpr; # Added 2025-11-17 cqrlog = throw "'cqrlog' was removed due to lack of maintenance and relying on gtk2"; # Added 2025-12-02 @@ -2409,6 +2410,7 @@ mapAliases { use the reference implementation 'xdg-terminal-exec' instead. " xdg-terminal-exec; # Added 2026-01-14 xdragon = throw "'xdragon' has been renamed to/replaced by 'dragon-drop'"; # Converted to throw 2025-10-27 + xeus-cling = throw "'xeus-cling' has been removed: it is unmaintained upstream. Use 'xeus-cpp' (a clang-repl/CppInterOp-based successor) instead"; # Added 2026-06-30 xf86-input-cmt = throw "'xf86-input-cmt' has been removed as it was broken and unmaintained upstream"; # Added 2026-05-09 xf86_input_cmt = xf86-input-cmt; # Added 2025-12-12 xf86_input_wacom = xf86-input-wacom; # Added 2025-12-12 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d75b8c4ead12..71c3656ce958 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4409,12 +4409,13 @@ with pkgs; jre = jre8; }; - inherit (callPackage ../applications/editors/jupyter-kernels/xeus-cling { }) + inherit (callPackage ../applications/editors/jupyter-kernels/xeus-cpp { }) cpp11-kernel cpp14-kernel cpp17-kernel - cpp2a-kernel - xeus-cling + cpp20-kernel + cpp23-kernel + xeus-cpp ; dhall = haskell.lib.compose.justStaticExecutables haskellPackages.dhall;