summary refs log tree commit diff
path: root/pkgs/development/tools/just
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/development/tools/just
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/development/tools/just')
-rw-r--r--pkgs/development/tools/just/default.nix43
1 files changed, 26 insertions, 17 deletions
diff --git a/pkgs/development/tools/just/default.nix b/pkgs/development/tools/just/default.nix
index ebf44d9d699..d7a2e733859 100644
--- a/pkgs/development/tools/just/default.nix
+++ b/pkgs/development/tools/just/default.nix
@@ -1,26 +1,28 @@
-{ stdenv, fetchFromGitHub, rustPlatform, coreutils, bash, installShellFiles }:
+{ lib, fetchFromGitHub, stdenv, rustPlatform, coreutils, bash, installShellFiles, libiconv }:
 
 rustPlatform.buildRustPackage rec {
   pname = "just";
-  version = "0.7.1";
+  version = "0.9.8";
 
   src = fetchFromGitHub {
     owner = "casey";
     repo = pname;
-    rev = "v${version}";
-    sha256 = "07fjixz8y5rxfwpyr1kiimnn27jhc20gacd17i0yvfcpy5qf8z5p";
+    rev = version;
+    sha256 = "sha256-WT3r6qw/lCZy6hdfAJmoAgUqjSLPVT8fKX4DnqDnhOs=";
   };
 
-  cargoSha256 = "1zn0kiqi8p25lscjd661gczay631nwzadl36cfzqnbww6blayy1j";
+  cargoSha256 = "sha256-0R/9VndP/Oh5/yP7NsBC25jiCSRVNEXhbVksElLXeEc=";
 
   nativeBuildInputs = [ installShellFiles ];
+  buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
 
   postInstall = ''
     installManPage man/just.1
 
-    installShellCompletion --bash --name just.bash completions/just.bash
-    installShellCompletion --fish --name just.fish completions/just.fish
-    installShellCompletion --zsh  --name _just     completions/just.zsh
+    installShellCompletion --cmd just \
+      --bash completions/just.bash \
+      --fish completions/just.fish \
+      --zsh  completions/just.zsh
   '';
 
   checkInputs = [ coreutils bash ];
@@ -29,23 +31,30 @@ rustPlatform.buildRustPackage rec {
     # USER must not be empty
     export USER=just-user
     export USERNAME=just-user
+    export JUST_CHOOSER="${coreutils}/bin/cat"
+
+    # Prevent string.rs from being changed
+    cp tests/string.rs $TMPDIR/string.rs
 
     sed -i src/justfile.rs \
         -i tests/*.rs \
         -e "s@/bin/echo@${coreutils}/bin/echo@g" \
-        -e "s@#!/usr/bin/env sh@#!${bash}/bin/sh@g" \
-        -e "s@#!/usr/bin/env cat@#!${coreutils}/bin/cat@g" \
-        -e "s@#!/usr/bin/env bash@#!${bash}/bin/sh@g"
+        -e "s@/usr/bin/env@${coreutils}/bin/env@g"
+
+    # Return unchanged string.rs
+    cp $TMPDIR/string.rs tests/string.rs
   '';
 
-  # Skip "edit" when running "cargo test",
-  # since this test case needs "cat".
-  checkFlagsArray = [ "--skip=edit" ];
+  checkFlags = [
+    "--skip=edit" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched
+    "--skip=run_shebang" # test case very rarely fails with "Text file busy"
+  ];
 
-  meta = with stdenv.lib; {
-    description = "A handy way to save and run project-specific commands";
+  meta = with lib; {
     homepage = "https://github.com/casey/just";
+    changelog = "https://github.com/casey/just/blob/${version}/CHANGELOG.md";
+    description = "A handy way to save and run project-specific commands";
     license = licenses.cc0;
-    maintainers = with maintainers; [ xrelkd ];
+    maintainers = with maintainers; [ xrelkd jk ];
   };
 }