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