From e7053a87adf9fd31362a34c79d54d4e1305d31b8 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 12 Nov 2020 17:47:39 +0100 Subject: [PATCH] evcxr: 0.5.3 -> 0.6.0 Since version `0.6.0` the `rust-src` component (or declaring `RUST_SRC_PATH`) is needed. Just like in `rust-analyzer`, this is solved by setting `RUST_SRC_PATH` to `rustPlatform.rustLibSrc` for tests and wrapped executables. ChangeLog: https://github.com/google/evcxr/blob/v0.6.0/RELEASE_NOTES.md#version-060 --- .../interpreters/evcxr/default.nix | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/evcxr/default.nix b/pkgs/development/interpreters/evcxr/default.nix index 11b9cd1ba505..a97f132b3b2f 100644 --- a/pkgs/development/interpreters/evcxr/default.nix +++ b/pkgs/development/interpreters/evcxr/default.nix @@ -2,22 +2,30 @@ rustPlatform.buildRustPackage rec { pname = "evcxr"; - version = "0.5.3"; + version = "0.6.0"; src = fetchFromGitHub { owner = "google"; repo = "evcxr"; rev = "v${version}"; - sha256 = "144xqi19d2nj9qgmhpx6d1kfhx9vfkmk7rnq6nzybpx4mbbl3ki2"; + sha256 = "sha256-QpUhUE65/IuT/VenziPX6z+CbJswbPPIv/ZnTthZpEU="; }; - cargoSha256 = "07lzxh0wh6azrlzfaacg29zmkn8jdnkdqbwgd5ajy79y8nii3c7z"; + cargoSha256 = "sha256-iUzVd4XtD+41yTV/BmqWLenzAUNPfS7vIHm1KfuPe9A="; + + RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; nativeBuildInputs = [ pkgconfig makeWrapper cmake ]; buildInputs = stdenv.lib.optional stdenv.isDarwin Security; - postInstall = '' - wrapProgram $out/bin/evcxr --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]} - wrapProgram $out/bin/evcxr_jupyter --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]} + 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 '';