Skip to content

Commit e905913

Browse files
authored
uv: use stdenv.hostPlatform.emulator to generate the shell completion unconditionally (#367851)
2 parents 94a55bc + 023eba0 commit e905913

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

pkgs/by-name/uv/uv/package.nix

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
lib,
33
stdenv,
4-
cmake,
4+
rustPlatform,
55
fetchFromGitHub,
6+
7+
# nativeBuildInputs
8+
cmake,
69
installShellFiles,
710
pkg-config,
8-
rustPlatform,
11+
12+
buildPackages,
913
versionCheckHook,
1014
python3Packages,
1115
nix-update-script,
@@ -41,13 +45,16 @@ rustPlatform.buildRustPackage rec {
4145
# Tests require python3
4246
doCheck = false;
4347

44-
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
45-
export HOME=$TMPDIR
46-
installShellCompletion --cmd uv \
47-
--bash <($out/bin/uv --generate-shell-completion bash) \
48-
--fish <($out/bin/uv --generate-shell-completion fish) \
49-
--zsh <($out/bin/uv --generate-shell-completion zsh)
50-
'';
48+
postInstall =
49+
let
50+
emulator = stdenv.hostPlatform.emulator buildPackages;
51+
in
52+
''
53+
installShellCompletion --cmd uv \
54+
--bash <(${emulator} $out/bin/uv generate-shell-completion bash) \
55+
--fish <(${emulator} $out/bin/uv generate-shell-completion fish) \
56+
--zsh <(${emulator} $out/bin/uv generate-shell-completion zsh)
57+
'';
5158

5259
nativeInstallCheckInputs = [
5360
versionCheckHook

0 commit comments

Comments
 (0)