* An example of supporting legacy applications using dosbox ;-)

svn path=/nixpkgs/trunk/; revision=6895
This commit is contained in:
Eelco Dolstra
2006-10-28 22:28:35 +00:00
parent f95a93197a
commit c391e5855b
4 changed files with 60 additions and 8 deletions
+31
View File
@@ -0,0 +1,31 @@
source $stdenv/setup
ensureDir $out/share/keen4
unzip -j $dist -d $out/share/keen4
ensureDir $out/bin
cat > $out/bin/keen4 <<EOF
#! $SHELL -e
if test -z "\$HOME"; then
echo "HOME directory not set"
exit 1
fi
# Game wants to write in the current directory, but of course we can't
# let it write in the Nix store. So create symlinks to the game files
# in ~/.keen4 and execute game from there.
mkdir -p \$HOME/.keen4
cd \$HOME/.keen4
ln -sf $out/share/keen4/* .
dosbox ./KEEN4E.EXE -fullscreen -exit || true
# Cleanup the symlinks.
for i in *; do
if test -L "\$i"; then
rm "\$i"
fi
done
EOF
chmod +x $out/bin/keen4