2013-03-03 18:34:59 +00:00
|
|
|
{stdenv, fetchurl, SDL, SDL_mixer, libvorbis, mesa, gtk, pkgconfig, nasm, libvpx, flac, makeDesktopItem}:
|
2009-05-14 13:48:45 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-07-13 21:19:20 +00:00
|
|
|
name = "eduke32-20130303-3542";
|
2009-05-14 14:42:20 +00:00
|
|
|
|
2011-07-25 10:48:07 +00:00
|
|
|
src = fetchurl {
|
2013-03-03 18:34:59 +00:00
|
|
|
url = http://dukeworld.duke4.net/eduke32/synthesis/20130303-3542/eduke32_src_20130303-3542.tar.bz2;
|
|
|
|
sha256 = "0v1q2bkmpnac5l9x97nnlhrrb95518vmhxx48zv3ncvmpafl1mqc";
|
2009-05-14 13:48:45 +00:00
|
|
|
};
|
2009-05-14 14:42:20 +00:00
|
|
|
|
2013-03-03 18:34:59 +00:00
|
|
|
buildInputs = [ SDL SDL_mixer libvorbis mesa gtk pkgconfig libvpx flac ]
|
2009-05-14 14:42:20 +00:00
|
|
|
++ stdenv.lib.optional (stdenv.system == "i686-linux") nasm;
|
|
|
|
|
2010-02-11 13:34:28 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${SDL}/include/SDL";
|
2011-07-25 11:43:27 +00:00
|
|
|
NIX_LDFLAGS = "-L${SDL}/lib -lgcc_s";
|
2009-05-14 14:42:20 +00:00
|
|
|
|
2009-05-14 13:48:45 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eduke32";
|
|
|
|
exec = "eduke32-wrapper";
|
|
|
|
comment = "Duke Nukem 3D port";
|
|
|
|
desktopName = "EDuke32";
|
|
|
|
genericName = "Duke Nukem 3D port";
|
|
|
|
categories = "Application;Game;";
|
|
|
|
};
|
2010-02-11 13:34:28 +00:00
|
|
|
|
2011-07-25 10:48:07 +00:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e "s|/usr/bin/sdl-config|${SDL}/bin/sdl-config|" build/Makefile.shared
|
|
|
|
'';
|
|
|
|
|
2010-02-11 13:34:28 +00:00
|
|
|
buildPhase = ''
|
|
|
|
make OPTLEVEL=0
|
|
|
|
'';
|
|
|
|
|
2009-05-14 13:48:45 +00:00
|
|
|
installPhase = ''
|
|
|
|
# Install binaries
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2009-05-14 13:48:45 +00:00
|
|
|
cp eduke32 mapster32 $out/bin
|
|
|
|
|
|
|
|
# Make wrapper script
|
|
|
|
cat > $out/bin/eduke32-wrapper <<EOF
|
|
|
|
#!/bin/sh
|
|
|
|
|
2009-05-14 14:05:38 +00:00
|
|
|
if [ "$EDUKE32_DATA_DIR" = "" ]
|
|
|
|
then
|
2011-07-25 10:48:07 +00:00
|
|
|
EDUKE32_DATA_DIR=/var/lib/games/eduke32
|
2009-05-14 14:05:38 +00:00
|
|
|
fi
|
|
|
|
if [ "$EDUKE32_GRP_FILE" = "" ]
|
2009-05-14 13:48:45 +00:00
|
|
|
then
|
2009-05-14 14:05:38 +00:00
|
|
|
EDUKE32_GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP
|
2009-05-14 13:48:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd \$EDUKE32_DATA_DIR
|
2011-07-25 11:43:27 +00:00
|
|
|
eduke32 -g \$EDUKE32_GRP_FILE
|
2009-05-14 13:48:45 +00:00
|
|
|
EOF
|
|
|
|
chmod 755 $out/bin/eduke32-wrapper
|
|
|
|
|
|
|
|
# Install desktop item
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/applications
|
2009-05-14 13:48:45 +00:00
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
'';
|
2010-02-11 13:34:28 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Enhanched port of Duke Nukem 3D for various platforms";
|
2011-07-25 10:48:07 +00:00
|
|
|
license = "GPLv2+ and BUILD license";
|
|
|
|
homepage = http://eduke32.com;
|
2010-02-11 13:34:28 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.sander ];
|
|
|
|
};
|
2009-05-14 13:48:45 +00:00
|
|
|
}
|