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