about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/as/ast-grep/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/as/ast-grep/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/as/ast-grep/package.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/by-name/as/ast-grep/package.nix b/nixpkgs/pkgs/by-name/as/ast-grep/package.nix
index 9a80ef6751f2..3334e7128bd4 100644
--- a/nixpkgs/pkgs/by-name/as/ast-grep/package.nix
+++ b/nixpkgs/pkgs/by-name/as/ast-grep/package.nix
@@ -2,31 +2,36 @@
 , rustPlatform
 , fetchFromGitHub
 , stdenv
+, installShellFiles
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "ast-grep";
-  version = "0.19.3";
+  version = "0.19.4";
 
   src = fetchFromGitHub {
     owner = "ast-grep";
     repo = "ast-grep";
     rev = version;
-    hash = "sha256-nqKDBRH2/YsSmirxJ84BgUTLfgPzZ/EQxqy6Fa7Mfxs=";
+    hash = "sha256-hKqj3LVu/3ndGoZQYyH1yCm5vF0/Ck5bkTKjLIkcUys=";
   };
 
-  cargoHash = "sha256-48ZVbRJkpMO+kJE5Kz96McjXhMtu4TzzjfyYdggNWkQ=";
+  cargoHash = "sha256-Fli97ANWHZvvBC6hImymELkpBqqrAOm006LROj3R3sM=";
 
-  # Work around https://github.com/NixOS/nixpkgs/issues/166205.
-  env = lib.optionalAttrs stdenv.cc.isClang {
-    NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
-  };
+  nativeBuildInputs = [ installShellFiles ];
 
   # error: linker `aarch64-linux-gnu-gcc` not found
   postPatch = ''
     rm .cargo/config.toml
   '';
 
+  postInstall = ''
+    installShellCompletion --cmd sg \
+      --bash <($out/bin/sg completions bash) \
+      --fish <($out/bin/sg completions fish) \
+      --zsh <($out/bin/sg completions zsh)
+  '';
+
   checkFlags = [
     # disable flaky test
     "--skip=test::test_load_parser_mac"