1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 21:50:55 +00:00
nixpkgs/pkgs/development/interpreters/python/pythonhome-wrapper.nix
Florian Friesdorf 0c32d209ca python wrapper that sets PYTHONHOME to the profile it is in
svn path=/nixpkgs/trunk/; revision=29462
2011-09-23 17:00:13 +00:00

22 lines
334 B
Nix

{ stdenv }:
stdenv.mkDerivation {
name = "pythonhome-wrapper";
unpackPhase = "true";
installPhase = ''
ensureDir $out/bin
echo '
#!/bin/sh
BINDIR=`dirname $0`
PYTHONHOME=`dirname $BINDIR`
PYTHONHOME=`(cd $PYTHONHOME && pwd)`
export PYTHONHOME
$BINDIR/python "$@"
' > $out/bin/py
chmod +x $out/bin/py
'';
}