mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 03:39:59 +00:00
python3Packages.pip: fix shell completions on cross (#567774)
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
pythonAtLeast,
|
||||
|
||||
# build-system
|
||||
flit-core,
|
||||
installShellFiles,
|
||||
stdenv,
|
||||
buildPackages,
|
||||
python,
|
||||
|
||||
# docs
|
||||
sphinx,
|
||||
@@ -104,14 +106,19 @@ let
|
||||
werkzeug
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installManPage docs/build/man/*
|
||||
|
||||
installShellCompletion --cmd pip \
|
||||
--bash <($out/bin/pip completion --bash --no-cache-dir) \
|
||||
--fish <($out/bin/pip completion --fish --no-cache-dir) \
|
||||
--zsh <($out/bin/pip completion --zsh --no-cache-dir)
|
||||
'';
|
||||
postInstall =
|
||||
let
|
||||
emulator = stdenv.hostPlatform.emulator buildPackages;
|
||||
in
|
||||
''
|
||||
installManPage docs/build/man/*
|
||||
''
|
||||
+ lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
||||
installShellCompletion --cmd pip \
|
||||
--bash <(${emulator} ${python.interpreter} $out/bin/pip completion --bash --no-cache-dir) \
|
||||
--fish <(${emulator} ${python.interpreter} $out/bin/pip completion --fish --no-cache-dir) \
|
||||
--zsh <(${emulator} ${python.interpreter} $out/bin/pip completion --zsh --no-cache-dir)
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit pip-tools;
|
||||
|
||||
Reference in New Issue
Block a user