@@ -1,4 +1,5 @@
2, fetchFromGitHub
3, fetchFromGitHub
3, rustPlatform
4, rustPlatform
@@ -9,36 +10,46 @@
11, withStableFeatures ? true
12, withStableFeatures ? true
13+, withTestBinaries ? true
14rustPlatform.buildRustPackage rec {
16rustPlatform.buildRustPackage rec {
15 pname = "nushell";
17 pname = "nushell";
16− version = "0.8.0";
18+ version = "0.9.0";
18 src = fetchFromGitHub {
20 src = fetchFromGitHub {
19 owner = pname;
21 owner = pname;
20 repo = pname;
22 repo = pname;
21 rev = version;
23 rev = version;
22− sha256 = "1hw9fazf5m80p39wgjqjcxafkfjxh0rkjmiznn2p66gccjnkddm6";
24+ sha256 = "0p1aykhkz5rixj6x0rskg77q31xw11mirvjhzp7n4nmbx3rfkagc";
25− cargoSha256 = "17hx02g9m3l2kgxba0n6wmixdbd9g8443h085v8shd70c6vln2v8";
27+ cargoSha256 = "0143mm9cdswd1azpzzpbfc5x7dy3ryywvq44mwkd6h1027n5idap";
27 nativeBuildInputs = [ pkg-config ]
29 nativeBuildInputs = [ pkg-config ]
28− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
30+ ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
30− buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ]
32+ buildInputs = lib.optionals stdenv.isLinux [ openssl ]
31− ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]
33+ ++ lib.optionals stdenv.isDarwin [ libiconv Security ]
32− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
34+ ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
33− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
35+ ++ lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
35− cargoBuildFlags = stdenv.lib.optional withStableFeatures "--features=stable";
37+ cargoBuildFlags = lib.optional withStableFeatures "--features stable";
39+ cargoTestFlags = lib.optional withTestBinaries "--features test-bins";
37 preCheck = ''
41 preCheck = ''
38 export HOME=$TMPDIR
42 export HOME=$TMPDIR
47+ echo "Running cargo cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
48+ cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
41− meta = with stdenv.lib; {
52+ meta = with lib; {
42 description = "A modern shell written in Rust";
53 description = "A modern shell written in Rust";
43 homepage = "https://www.nushell.sh/";
54 homepage = "https://www.nushell.sh/";
44 license = licenses.mit;
55 license = licenses.mit;