@@ -1,4 +1,5 @@
11{ stdenv
2+, lib
23, fetchFromGitHub
34, rustPlatform
45, openssl
@@ -9,36 +10,46 @@
910, AppKit
1011, Security
1112, withStableFeatures ? true
13+, withTestBinaries ? true
1214}:
1315
1416rustPlatform.buildRustPackage rec {
1517 pname = "nushell";
16− version = "0.8.0";
18+ version = "0.9.0";
1719
1820 src = fetchFromGitHub {
1921 owner = pname;
2022 repo = pname;
2123 rev = version;
22− sha256 = "1hw9fazf5m80p39wgjqjcxafkfjxh0rkjmiznn2p66gccjnkddm6";
24+ sha256 = "0p1aykhkz5rixj6x0rskg77q31xw11mirvjhzp7n4nmbx3rfkagc";
2325 };
2426
25− cargoSha256 = "17hx02g9m3l2kgxba0n6wmixdbd9g8443h085v8shd70c6vln2v8";
27+ cargoSha256 = "0143mm9cdswd1azpzzpbfc5x7dy3ryywvq44mwkd6h1027n5idap";
2628
2729 nativeBuildInputs = [ pkg-config ]
28− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
30+ ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
2931
30− buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ]
31− ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]
32− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
33− ++ stdenv.lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
32+ buildInputs = lib.optionals stdenv.isLinux [ openssl ]
33+ ++ lib.optionals stdenv.isDarwin [ libiconv Security ]
34+ ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
35+ ++ lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
3436
35− cargoBuildFlags = stdenv.lib.optional withStableFeatures "--features=stable";
37+ cargoBuildFlags = lib.optional withStableFeatures "--features stable";
38+
39+ cargoTestFlags = lib.optional withTestBinaries "--features test-bins";
3640
3741 preCheck = ''
3842 export HOME=$TMPDIR
3943 '';
4044
41− meta = with stdenv.lib; {
45+ checkPhase = ''
46+ runHook preCheck
47+ echo "Running cargo cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
48+ cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
49+ runHook postCheck
50+ '';
51+
52+ meta = with lib; {
4253 description = "A modern shell written in Rust";
4354 homepage = "https://www.nushell.sh/";
4455 license = licenses.mit;