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

39 lines
1.1 KiB
Nix
Raw Normal View History

{ cargo, fetchFromGitHub, makeWrapper, pkgconfig, rustPlatform, stdenv, gcc, Security, cmake }:
2019-04-28 04:08:23 +02:00
rustPlatform.buildRustPackage rec {
pname = "evcxr";
version = "0.7.0";
2019-04-28 04:08:23 +02:00
src = fetchFromGitHub {
owner = "google";
repo = "evcxr";
rev = "v${version}";
sha256 = "sha256-33XeepqwYmTMcObroPTuxykYuM9qYI1+LV5lZIFSomg=";
2019-04-28 04:08:23 +02:00
};
cargoSha256 = "sha256-tjCID3YeGkxcq/LqJDMHGNpv1MCXKtcLlDnNkFwx1zU=";
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
2019-04-28 04:08:23 +02:00
nativeBuildInputs = [ pkgconfig makeWrapper cmake ];
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
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"}
rm $out/bin/testing_runtime
'';
2019-04-28 04:08:23 +02:00
meta = with stdenv.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
};
}