2016-03-07 22:02:32 +00:00
|
|
|
{ lib, stdenv, fetchurl, dosbox, unzip }:
|
2006-10-28 23:28:35 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "keen4";
|
|
|
|
|
2021-11-19 23:48:42 +00:00
|
|
|
src = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://tarballs.nixos.org/keen4.zip";
|
2014-10-12 15:13:21 +01:00
|
|
|
sha256 = "12rnc9ksl7v6l8wsxvr26ylkafzq80dbsa7yafzw9pqc8pafkhx1";
|
2006-10-28 23:31:46 +01:00
|
|
|
};
|
2006-10-28 23:28:35 +01:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2006-10-28 23:28:35 +01:00
|
|
|
|
2021-11-19 23:48:42 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/keen4
|
|
|
|
mv * $out/share/keen4
|
|
|
|
|
|
|
|
mkdir -p $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}/bin/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
|
|
|
|
'';
|
2006-10-28 23:28:35 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Commander Keen Episode 4: Secret of the Oracle";
|
2016-03-07 22:02:32 +00:00
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = [ lib.maintainers.eelco ];
|
2006-10-28 23:28:35 +01:00
|
|
|
};
|
|
|
|
}
|