delta: fix cross compilation
fixes `nix-build -A pkgsCross.aarch64-multiplatform.delta` the pattern to use an emulator when generating shell completions is well-established, see e.g. pkgs/by-name/st/starship/package.nix. it evaluates to a lightweight `exec "$@"` when emulation isn't required.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
buildPackages,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
pkg-config,
|
||||
@@ -42,12 +43,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
RUSTONIG_SYSTEM_LIBONIG = true;
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd delta \
|
||||
--bash <($out/bin/delta --generate-completion bash) \
|
||||
--fish <($out/bin/delta --generate-completion fish) \
|
||||
--zsh <($out/bin/delta --generate-completion zsh)
|
||||
'';
|
||||
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
|
||||
let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in
|
||||
''
|
||||
installShellCompletion --cmd delta \
|
||||
--bash <(${emulator} $out/bin/delta --generate-completion bash) \
|
||||
--fish <(${emulator} $out/bin/delta --generate-completion fish) \
|
||||
--zsh <(${emulator} $out/bin/delta --generate-completion zsh)
|
||||
''
|
||||
);
|
||||
|
||||
# test_env_parsing_with_pager_set_to_bat sets environment variables,
|
||||
# which can be flaky with multiple threads:
|
||||
|
||||
Reference in New Issue
Block a user