2021-05-20 23:08:51 +00:00
|
|
|
{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, lib, stdenv
|
|
|
|
, gcc, cmake, libiconv, CoreServices, Security }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "evcxr";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "0.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "evcxr";
|
2020-08-20 17:08:02 +00:00
|
|
|
rev = "v${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "sha256-89+RZrG/QUo3JY9N5eTiMigUnlUP+wZWRW8PSnCcsrY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
cargoSha256 = "sha256-gZLSTWS5cLfJvk4/tv8FG2I2vH3PKljWbJDOflNDmTQ=";
|
2020-11-12 23:50:31 +00:00
|
|
|
|
|
|
|
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper cmake ];
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin
|
|
|
|
[ libiconv CoreServices Security ];
|
|
|
|
|
2020-11-12 23:50:31 +00:00
|
|
|
postInstall = let
|
|
|
|
wrap = exe: ''
|
|
|
|
wrapProgram $out/bin/${exe} \
|
2021-02-05 17:12:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ cargo gcc ]} \
|
2020-11-12 23:50:31 +00:00
|
|
|
--set-default RUST_SRC_PATH "$RUST_SRC_PATH"
|
|
|
|
'';
|
|
|
|
in ''
|
|
|
|
${wrap "evcxr"}
|
|
|
|
${wrap "evcxr_jupyter"}
|
2020-04-24 23:36:52 +00:00
|
|
|
rm $out/bin/testing_runtime
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An evaluation context for Rust";
|
|
|
|
homepage = "https://github.com/google/evcxr";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ protoben ma27 ];
|
|
|
|
};
|
|
|
|
}
|