1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-23 11:19:04 -04:00
nixpkgs/pkgs/development/interpreters/python/pythonhome-wrapper.nix

22 lines
333 B
Nix
Raw Normal View History

{ stdenv }:
stdenv.mkDerivation {
name = "pythonhome-wrapper";
unpackPhase = "true";
installPhase = ''
mkdir -p $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
'';
}