From 13f585c5a606b3963b243d9f70e0a6a630616491 Mon Sep 17 00:00:00 2001 From: ZHAO Jin-Xiang Date: Sat, 17 May 2025 23:39:21 +0800 Subject: [PATCH] ast-grep: remove emulator support --- pkgs/by-name/as/ast-grep/package.nix | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/as/ast-grep/package.nix b/pkgs/by-name/as/ast-grep/package.nix index 4783207b3a6f..e03894c63e96 100644 --- a/pkgs/by-name/as/ast-grep/package.nix +++ b/pkgs/by-name/as/ast-grep/package.nix @@ -4,7 +4,6 @@ fetchFromGitHub, stdenv, installShellFiles, - buildPackages, versionCheckHook, nix-update-script, enableLegacySg ? false, @@ -35,23 +34,18 @@ rustPlatform.buildRustPackage (finalAttrs: { "--package ast-grep --bin ast-grep" ] ++ lib.optionals enableLegacySg [ "--package ast-grep --bin sg" ]; - postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( - let - emulator = stdenv.hostPlatform.emulator buildPackages; - in - '' - installShellCompletion --cmd ast-grep \ - --bash <(${emulator} $out/bin/ast-grep completions bash) \ - --fish <(${emulator} $out/bin/ast-grep completions fish) \ - --zsh <(${emulator} $out/bin/ast-grep completions zsh) - '' - + lib.optionalString enableLegacySg '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd ast-grep \ + --bash <($out/bin/ast-grep completions bash) \ + --fish <($out/bin/ast-grep completions fish) \ + --zsh <($out/bin/ast-grep completions zsh) + ${lib.optionalString enableLegacySg '' installShellCompletion --cmd sg \ - --bash <(${emulator} $out/bin/sg completions bash) \ - --fish <(${emulator} $out/bin/sg completions fish) \ - --zsh <(${emulator} $out/bin/sg completions zsh) - '' - ); + --bash <($out/bin/sg completions bash) \ + --fish <($out/bin/sg completions fish) \ + --zsh <($out/bin/sg completions zsh) + ''} + ''; nativeInstallCheckInputs = [ versionCheckHook