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