1 { lib, stdenv, fetchurl, dosbox, unzip }:
7 url = "http://tarballs.nixos.org/keen4.zip";
8 sha256 = "12rnc9ksl7v6l8wsxvr26ylkafzq80dbsa7yafzw9pqc8pafkhx1";
11 nativeBuildInputs = [ unzip ];
14 mkdir -p $out/share/keen4
18 cat > $out/bin/keen4 <<EOF
20 if test -z "\$HOME"; then
21 echo "HOME directory not set"
25 # Game wants to write in the current directory, but of course we can't
26 # let it write in the Nix store. So create symlinks to the game files
27 # in ~/.keen4 and execute game from there.
28 mkdir -p \$HOME/.keen4
31 ln -sf $out/share/keen4/* .
33 ${dosbox}/bin/dosbox ./KEEN4E.EXE -fullscreen -exit || true
35 # Cleanup the symlinks.
37 if test -L "\$i"; then
42 chmod +x $out/bin/keen4
46 description = "Commander Keen Episode 4: Secret of the Oracle";
47 license = lib.licenses.unfree;
48 maintainers = [ lib.maintainers.eelco ];