nixpkgs/pkgs/applications/editors/jupyter-kernels/xeus-cling/xeus-cling.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

108 lines
2.3 KiB
Nix

{
lib,
clangStdenv,
cmake,
fetchFromGitHub,
llvmPackages_13,
# 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 rec {
pname = "xeus-cling";
version = "0.15.3";
src = fetchFromGitHub {
owner = "QuantStack";
repo = "xeus-cling";
rev = "${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
];
nativeBuildInputs = [ cmake ];
buildInputs = [
argparse_2_9
cling.unwrapped
cppzmq
libuuid
llvmPackages_13.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()"
'';
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;
};
}