mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

This reverts commit65a333600d
. 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
90 lines
1.9 KiB
Nix
90 lines
1.9 KiB
Nix
{
|
|
pkgs,
|
|
stdenv,
|
|
lib,
|
|
jre,
|
|
fetchFromGitHub,
|
|
writeShellScript,
|
|
runCommand,
|
|
imagemagick,
|
|
}:
|
|
|
|
# Jupyter console:
|
|
# nix run --impure --expr 'with import <nixpkgs> {}; jupyter-console.withSingleKernel clojupyter.definition'
|
|
|
|
# Jupyter notebook:
|
|
# nix run --impure --expr 'with import <nixpkgs> {}; jupyter.override { definitions.clojure = clojupyter.definition; }'
|
|
|
|
let
|
|
cljdeps = import ./deps.nix { inherit pkgs; };
|
|
classp = cljdeps.makeClasspaths { };
|
|
|
|
shellScript = writeShellScript "clojupyter" ''
|
|
${jre}/bin/java -cp ${classp} clojupyter.kernel.core "$@"
|
|
'';
|
|
|
|
pname = "clojupyter";
|
|
version = "0.3.3";
|
|
|
|
meta = with lib; {
|
|
description = "Jupyter kernel for Clojure";
|
|
homepage = "https://github.com/clojupyter/clojupyter";
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ]; # deps from maven
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ thomasjm ];
|
|
platforms = jre.meta.platforms;
|
|
};
|
|
|
|
sizedLogo =
|
|
size:
|
|
stdenv.mkDerivation {
|
|
name = "clojupyter-logo-${size}x${size}.png";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "clojupyter";
|
|
repo = "clojupyter";
|
|
rev = version;
|
|
sha256 = "sha256-BCzcPnLSonm+ELFU4JIIzLPlVnP0VzlrRSGxOd/LFow=";
|
|
};
|
|
|
|
buildInputs = [ imagemagick ];
|
|
|
|
dontConfigure = true;
|
|
dontInstall = true;
|
|
|
|
buildPhase = ''
|
|
convert ./resources/clojupyter/assets/logo-64x64.png -resize ${size}x${size} $out
|
|
'';
|
|
|
|
inherit meta;
|
|
};
|
|
|
|
in
|
|
|
|
rec {
|
|
launcher =
|
|
runCommand "clojupyter"
|
|
{
|
|
inherit
|
|
pname
|
|
version
|
|
meta
|
|
shellScript
|
|
;
|
|
}
|
|
''
|
|
mkdir -p $out/bin
|
|
ln -s $shellScript $out/bin/clojupyter
|
|
'';
|
|
|
|
definition = {
|
|
displayName = "Clojure";
|
|
argv = [
|
|
"${launcher}/bin/clojupyter"
|
|
"{connection_file}"
|
|
];
|
|
language = "clojure";
|
|
logo32 = sizedLogo "32";
|
|
logo64 = sizedLogo "64";
|
|
};
|
|
}
|