summary refs log tree commit diff
path: root/pkgs/development/interpreters/evcxr
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-11-12 17:47:39 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2020-11-12 19:41:32 +0100
commite7053a87adf9fd31362a34c79d54d4e1305d31b8 (patch)
tree6a564baf543f584446cf51a461e28623e73aadd6 /pkgs/development/interpreters/evcxr
parent02a1379d454e5749951604035c17ca2651535691 (diff)
downloadnixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar.gz
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar.bz2
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar.lz
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar.xz
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.tar.zst
nixpkgs-e7053a87adf9fd31362a34c79d54d4e1305d31b8.zip
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
Diffstat (limited to 'pkgs/development/interpreters/evcxr')
-rw-r--r--pkgs/development/interpreters/evcxr/default.nix20
1 files changed, 14 insertions, 6 deletions
diff --git a/pkgs/development/interpreters/evcxr/default.nix b/pkgs/development/interpreters/evcxr/default.nix
index 11b9cd1ba50..a97f132b3b2 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
   '';