about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorSerg Nesterov <i.am.cust0dian@gmail.com>2020-01-29 23:03:54 +0300
committerSerg Nesterov <i.am.cust0dian@gmail.com>2020-01-30 14:16:28 +0300
commite8e47ce9455e1efdaf222a44c71532a6be927e9a (patch)
treea32770ed08cb434113673fd60a0700183a15a317 /pkgs/shells
parentafa36de49d6a20adb57976be659f210032f20684 (diff)
downloadnixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar.gz
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar.bz2
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar.lz
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar.xz
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.tar.zst
nixlib-e8e47ce9455e1efdaf222a44c71532a6be927e9a.zip
nushell: 0.8.0 -> 0.9.0
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/nushell/default.nix31
1 files changed, 21 insertions, 10 deletions
diff --git a/pkgs/shells/nushell/default.nix b/pkgs/shells/nushell/default.nix
index de8502618c60..00a27d1d7e37 100644
--- a/pkgs/shells/nushell/default.nix
+++ b/pkgs/shells/nushell/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , rustPlatform
 , openssl
@@ -9,36 +10,46 @@
 , AppKit
 , Security
 , withStableFeatures ? true
+, withTestBinaries ? true
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "nushell";
-  version = "0.8.0";
+  version = "0.9.0";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = version;
-    sha256 = "1hw9fazf5m80p39wgjqjcxafkfjxh0rkjmiznn2p66gccjnkddm6";
+    sha256 = "0p1aykhkz5rixj6x0rskg77q31xw11mirvjhzp7n4nmbx3rfkagc";
   };
 
-  cargoSha256 = "17hx02g9m3l2kgxba0n6wmixdbd9g8443h085v8shd70c6vln2v8";
+  cargoSha256 = "0143mm9cdswd1azpzzpbfc5x7dy3ryywvq44mwkd6h1027n5idap";
 
   nativeBuildInputs = [ pkg-config ]
-    ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
+    ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ python3 ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ]
-    ++ stdenv.lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
-    ++ stdenv.lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
+  buildInputs = lib.optionals stdenv.isLinux [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv Security ]
+    ++ lib.optionals (withStableFeatures && stdenv.isLinux) [ xorg.libX11 ]
+    ++ lib.optionals (withStableFeatures && stdenv.isDarwin) [ AppKit ];
 
-  cargoBuildFlags = stdenv.lib.optional withStableFeatures "--features=stable";
+  cargoBuildFlags = lib.optional withStableFeatures "--features stable";
+
+  cargoTestFlags = lib.optional withTestBinaries "--features test-bins";
 
   preCheck = ''
     export HOME=$TMPDIR
   '';
 
-  meta = with stdenv.lib; {
+  checkPhase = ''
+    runHook preCheck
+    echo "Running cargo cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
+    cargo test ${lib.strings.concatStringsSep " " cargoTestFlags} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
+    runHook postCheck
+  '';
+
+  meta = with lib; {
     description = "A modern shell written in Rust";
     homepage = "https://www.nushell.sh/";
     license = licenses.mit;