mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
Merge pull request #3495 from geerds/virtualenvwrapper
Fix virtualenvwrapper shell scripts
This commit is contained in:
commit
8f34fda081
@ -8206,6 +8206,27 @@ rec {
|
||||
substituteInPlace "virtualenvwrapper_lazy.sh" --replace "which" "${pkgs.which}/bin/which"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# This might look like a dirty hack but we can't use the makeWrapper function because
|
||||
# the wrapped file were then called via "exec". The virtualenvwrapper shell scripts
|
||||
# aren't normal executables. Instead, the user has to evaluate them.
|
||||
|
||||
for file in "virtualenvwrapper.sh" "virtualenvwrapper_lazy.sh"; do
|
||||
local wrapper="$out/bin/$file"
|
||||
local wrapped="$out/bin/.$file-wrapped"
|
||||
mv "$wrapper" "$wrapped"
|
||||
|
||||
cat > "$wrapper" <<- EOF
|
||||
export PATH=$PATH:\$PATH
|
||||
export PYTHONPATH=$PYTHONPATH:$(toPythonPath $out):\$PYTHONPATH
|
||||
source "$wrapped"
|
||||
EOF
|
||||
|
||||
chmod -x "$wrapped"
|
||||
chmod +x "$wrapper"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Enhancements to virtualenv";
|
||||
homepage = "https://pypi.python.org/pypi/virtualenvwrapper";
|
||||
|
Loading…
Reference in New Issue
Block a user