diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2006-10-28 22:28:35 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2006-10-28 22:28:35 +0000 |
commit | c391e5855bb518bf9a21f979991be82f0dcd86f2 (patch) | |
tree | f5db6ff3690e77d14d539448586da7d5898b72c1 /pkgs/games | |
parent | f95a93197a5db531b12bd50510efb50bdacdf656 (diff) |
* An example of supporting legacy applications using dosbox ;-)
svn path=/nixpkgs/trunk/; revision=6895
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/keen4/builder.sh | 31 | ||||
-rw-r--r-- | pkgs/games/keen4/default.nix | 16 |
2 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/games/keen4/builder.sh b/pkgs/games/keen4/builder.sh new file mode 100644 index 0000000000000..bb7643f04648b --- /dev/null +++ b/pkgs/games/keen4/builder.sh @@ -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 \ No newline at end of file diff --git a/pkgs/games/keen4/default.nix b/pkgs/games/keen4/default.nix new file mode 100644 index 0000000000000..ca9aafa6d03fa --- /dev/null +++ b/pkgs/games/keen4/default.nix @@ -0,0 +1,16 @@ +{stdenv, fetchurl, dosbox, unzip}: + +stdenv.mkDerivation { + name = "keen4"; + builder = ./builder.sh; + + dist = /home/eelco/keen4.zip; + + buildInputs = [unzip]; + + inherit dosbox; + + meta = { + description = "Commander Keen Episode 4: Secret of the Oracle"; + }; +} |