depot/third_party/nixpkgs/pkgs/development/interpreters/evcxr/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

48 lines
1.3 KiB
Nix

{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, lib, stdenv
, gcc, cmake, libiconv, CoreServices, Security }:
rustPlatform.buildRustPackage rec {
pname = "evcxr";
version = "0.15.0";
src = fetchFromGitHub {
owner = "google";
repo = "evcxr";
rev = "v${version}";
sha256 = "sha256-s8zM1vxEeJYcRek1rqUmrBfvB2zCAF3iLG8UVA7WABI=";
};
cargoSha256 = "sha256-wMo5Fq6aMiE6kg8mZoz1T3KPwKSdJcej83MB+/GRM5w=";
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
nativeBuildInputs = [ pkg-config makeWrapper cmake ];
buildInputs = lib.optionals stdenv.isDarwin
[ libiconv CoreServices Security ];
checkFlags = [
# test broken with rust 1.69:
# * https://github.com/evcxr/evcxr/issues/294
# * https://github.com/NixOS/nixpkgs/issues/229524
"--skip=check_for_errors"
];
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
'';
meta = with lib; {
description = "An evaluation context for Rust";
homepage = "https://github.com/google/evcxr";
license = licenses.asl20;
maintainers = with maintainers; [ protoben ma27 ];
};
}