2009-05-14 16:42:20 +02:00
|
|
|
{stdenv, fetchurl, SDL, SDL_mixer, unzip, libvorbis, mesa, gtk, pkgconfig, nasm, makeDesktopItem}:
|
2009-05-14 15:48:45 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "eduke32";
|
2009-05-14 16:42:20 +02:00
|
|
|
|
2009-05-14 15:48:45 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = http://wiki.eduke32.com/stuff/source_code/eduke32_src_20090131.zip;
|
|
|
|
sha256 = "e6b8cc2c7e0c32a6aa5a64359be8b8c494dcae08dda87e1de718c030426ef74d";
|
|
|
|
};
|
2009-05-14 16:42:20 +02:00
|
|
|
|
|
|
|
buildInputs = [ unzip SDL SDL_mixer libvorbis mesa gtk pkgconfig ]
|
|
|
|
++ stdenv.lib.optional (stdenv.system == "i686-linux") nasm;
|
|
|
|
|
2009-05-14 15:48:45 +02:00
|
|
|
NIX_LDFLAGS = "-lgcc_s";
|
2009-05-14 16:42:20 +02:00
|
|
|
|
2009-05-14 15:48:45 +02:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eduke32";
|
|
|
|
exec = "eduke32-wrapper";
|
|
|
|
comment = "Duke Nukem 3D port";
|
|
|
|
desktopName = "EDuke32";
|
|
|
|
genericName = "Duke Nukem 3D port";
|
|
|
|
categories = "Application;Game;";
|
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# Install binaries
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp eduke32 mapster32 $out/bin
|
|
|
|
|
|
|
|
# Make wrapper script
|
|
|
|
cat > $out/bin/eduke32-wrapper <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
|
2009-05-14 16:05:38 +02:00
|
|
|
if [ "$EDUKE32_DATA_DIR" = "" ]
|
|
|
|
then
|
|
|
|
EDUKE32_DATA_DIR=/var/games/eduke32
|
|
|
|
fi
|
|
|
|
if [ "$EDUKE32_CON_FILE" = "" ]
|
|
|
|
then
|
|
|
|
EDUKE32_CON_FILE=\$EDUKE32_DATA_DIR/GAME.CON
|
|
|
|
fi
|
|
|
|
if [ "$EDUKE32_GRP_FILE" = "" ]
|
2009-05-14 15:48:45 +02:00
|
|
|
then
|
2009-05-14 16:05:38 +02:00
|
|
|
EDUKE32_GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP
|
2009-05-14 15:48:45 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd \$EDUKE32_DATA_DIR
|
2009-05-14 16:05:38 +02:00
|
|
|
eduke32 /x\$EDUKE32_CON_FILE /g\$EDUKE32_GRP_FILE
|
2009-05-14 15:48:45 +02:00
|
|
|
EOF
|
|
|
|
chmod 755 $out/bin/eduke32-wrapper
|
|
|
|
|
|
|
|
# Install desktop item
|
|
|
|
ensureDir $out/share/applications
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
'';
|
|
|
|
}
|