2019-09-16 21:46:26 +01:00
|
|
|
{ cargo, fetchFromGitHub, makeWrapper, pkgconfig, rustPlatform, 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";
|
2020-11-12 16:47:39 +00:00
|
|
|
version = "0.6.0";
|
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}";
|
2020-11-12 16:47:39 +00:00
|
|
|
sha256 = "sha256-QpUhUE65/IuT/VenziPX6z+CbJswbPPIv/ZnTthZpEU=";
|
2019-04-28 03:08:23 +01:00
|
|
|
};
|
|
|
|
|
2020-11-12 16:47:39 +00:00
|
|
|
cargoSha256 = "sha256-iUzVd4XtD+41yTV/BmqWLenzAUNPfS7vIHm1KfuPe9A=";
|
|
|
|
|
|
|
|
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
2019-04-28 03:08:23 +01:00
|
|
|
|
2019-09-16 21:46:26 +01: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 18:06:43 +01:00
|
|
|
rm $out/bin/testing_runtime
|
|
|
|
'';
|
2019-04-28 03:08:23 +01:00
|
|
|
|
2019-09-16 21:46:26 +01:00
|
|
|
meta = with stdenv.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
|
|
|
};
|
|
|
|
}
|