Fixed wrapper script to use environment variables from the user profile

svn path=/nixpkgs/trunk/; revision=15602
This commit is contained in:
Sander van der Burg 2009-05-14 14:05:38 +00:00
parent 16ffeaead6
commit 1cfc364e98

View File

@ -26,17 +26,21 @@ stdenv.mkDerivation rec {
cat > $out/bin/eduke32-wrapper <<EOF cat > $out/bin/eduke32-wrapper <<EOF
#!/bin/sh #!/bin/sh
if [ -f ~/.eduke32-settings ] if [ "$EDUKE32_DATA_DIR" = "" ]
then then
. ~/.eduke32-settings EDUKE32_DATA_DIR=/var/games/eduke32
else fi
EDUKE32_DATA_DIR=/var/eduke32 if [ "$EDUKE32_CON_FILE" = "" ]
CON_FILE=\$EDUKE32_DATA_DIR/GAME.CON then
GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP EDUKE32_CON_FILE=\$EDUKE32_DATA_DIR/GAME.CON
fi
if [ "$EDUKE32_GRP_FILE" = "" ]
then
EDUKE32_GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP
fi fi
cd \$EDUKE32_DATA_DIR cd \$EDUKE32_DATA_DIR
eduke32 /x\$CON_FILE /g\$GRP_FILE eduke32 /x\$EDUKE32_CON_FILE /g\$EDUKE32_GRP_FILE
EOF EOF
chmod 755 $out/bin/eduke32-wrapper chmod 755 $out/bin/eduke32-wrapper