2021-01-23 13:15:07 +00:00
|
|
|
{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, lib, stdenv, gcc, Security, cmake }:
|
2019-04-28 03:08:23 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-24 20:16:41 +01:00
|
|
|
pname = "evcxr";
|
2021-03-11 11:35:18 +00:00
|
|
|
version = "0.8.1";
|
2019-04-28 03:08:23 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "evcxr";
|
2020-07-26 01:43:55 +01:00
|
|
|
rev = "v${version}";
|
2021-03-11 11:35:18 +00:00
|
|
|
sha256 = "sha256-5YbvPDyGaoKPelLep2tVica08SI7Cyo9SLMnE6dmWe4=";
|
2019-04-28 03:08:23 +01:00
|
|
|
};
|
|
|
|
|
2021-03-11 11:35:18 +00:00
|
|
|
cargoSha256 = "sha256-hqVmNBrvagqhGPWTaBXuY8lULolWIoR5ovEhH5k1tz4=";
|
2020-11-12 16:47:39 +00:00
|
|
|
|
|
|
|
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
2019-04-28 03:08:23 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper cmake ];
|
2021-01-23 13:15:07 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2020-11-12 16:47:39 +00:00
|
|
|
postInstall = let
|
|
|
|
wrap = exe: ''
|
|
|
|
wrapProgram $out/bin/${exe} \
|
2021-01-23 13:15:07 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ cargo gcc ]} \
|
2020-11-12 16:47:39 +00:00
|
|
|
--set-default RUST_SRC_PATH "$RUST_SRC_PATH"
|
|
|
|
'';
|
|
|
|
in ''
|
|
|
|
${wrap "evcxr"}
|
|
|
|
${wrap "evcxr_jupyter"}
|
2019-05-03 18:06:43 +01:00
|
|
|
rm $out/bin/testing_runtime
|
|
|
|
'';
|
2019-04-28 03:08:23 +01:00
|
|
|
|
2021-01-23 13:15:07 +00:00
|
|
|
meta = with lib; {
|
2019-05-03 18:06:43 +01:00
|
|
|
description = "An evaluation context for Rust";
|
2019-04-28 03:08:23 +01:00
|
|
|
homepage = "https://github.com/google/evcxr";
|
2019-09-16 21:46:26 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ protoben ma27 ];
|
2019-04-28 03:08:23 +01:00
|
|
|
};
|
|
|
|
}
|