nixpkgs-suyu/pkgs/development/interpreters/evcxr/default.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2021-05-15 12:37:17 +02:00
{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, lib, stdenv
, gcc, cmake, libiconv, CoreServices, Security }:
2019-04-28 04:08:23 +02:00
rustPlatform.buildRustPackage rec {
pname = "evcxr";
version = "0.10.0";
2019-04-28 04:08:23 +02:00
src = fetchFromGitHub {
owner = "google";
repo = "evcxr";
rev = "v${version}";
sha256 = "sha256-EPxWLPw+V5eIm+eL8m8Xw14adgshthJSDRyWohsJH88=";
2019-04-28 04:08:23 +02:00
};
cargoSha256 = "sha256-5jGrv0YRVMo2X9p/WPgjYV3z193hl2+NiFTZr3v0Iik=";
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
2019-04-28 04:08:23 +02:00
nativeBuildInputs = [ pkg-config makeWrapper cmake ];
2021-05-15 12:37:17 +02:00
buildInputs = lib.optionals stdenv.isDarwin
[ libiconv CoreServices Security ];
postInstall = let
wrap = exe: ''
wrapProgram $out/bin/${exe} \
--prefix PATH : ${lib.makeBinPath [ cargo gcc ]} \
--set-default RUST_SRC_PATH "$RUST_SRC_PATH"
'';
in ''
${wrap "evcxr"}
${wrap "evcxr_jupyter"}
rm $out/bin/testing_runtime
'';
2019-04-28 04:08:23 +02:00
meta = with lib; {
description = "An evaluation context for Rust";
2019-04-28 04:08:23 +02:00
homepage = "https://github.com/google/evcxr";
license = licenses.asl20;
maintainers = with maintainers; [ protoben ma27 ];
2019-04-28 04:08:23 +02:00
};
}