lima: fix cross (#356548)

This commit is contained in:
Emily 2024-11-18 08:09:38 +00:00 committed by GitHub
commit a99e640f0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,7 @@ stdenvNoCC.mkDerivation {
chmod +x $out/bin/limactl
wrapProgram $out/bin/limactl \
--prefix PATH : ${lib.makeBinPath [ qemu ]}
'' + lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
# the shell completion only works with a patched $out/bin/limactl and so
# needs to run after the autoPatchelfHook is executed in postFixup.
doShellCompletion() {
@ -67,7 +67,7 @@ stdenvNoCC.mkDerivation {
--zsh <($out/bin/limactl completion zsh)
}
postFixupHooks+=(doShellCompletion)
'' + ''
runHook postInstall
'';

View File

@ -54,10 +54,12 @@ buildGoModule rec {
cp -r _output/* $out
wrapProgram $out/bin/limactl \
--prefix PATH : ${lib.makeBinPath [ qemu ]}
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd limactl \
--bash <($out/bin/limactl completion bash) \
--fish <($out/bin/limactl completion fish) \
--zsh <($out/bin/limactl completion zsh)
'' + ''
runHook postInstall
'';