2018-02-24 13:12:44 +00:00
|
|
|
{ stdenv, fetchurl, flac, gtk2, libvorbis, libvpx, makeDesktopItem, libGLU_combined, nasm
|
2019-02-26 11:45:54 +00:00
|
|
|
, pkgconfig, SDL2, SDL2_mixer, runtimeShell }:
|
2009-05-14 14:48:45 +01:00
|
|
|
|
2015-04-30 11:50:27 +01:00
|
|
|
let
|
2016-03-14 19:38:42 +00:00
|
|
|
year = "2015";
|
2015-04-30 11:50:27 +01:00
|
|
|
date = "20150420";
|
|
|
|
rev = "5160";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "eduke32-${version}";
|
2016-01-25 19:08:34 +00:00
|
|
|
version = "${date}-${rev}";
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2011-07-25 11:48:07 +01:00
|
|
|
src = fetchurl {
|
2016-03-14 19:38:42 +00:00
|
|
|
url = "http://dukeworld.duke4.net/eduke32/synthesis/old/${year}/${version}/eduke32_src_${version}.tar.xz";
|
2015-04-30 11:50:27 +01:00
|
|
|
sha256 = "1nlq5jbglg00c1z1vsyl627fh0mqfxvk5qyxav5vzla2b4svik2v";
|
2009-05-14 14:48:45 +01:00
|
|
|
};
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2018-02-24 13:12:44 +00:00
|
|
|
buildInputs = [ flac gtk2 libvorbis libvpx libGLU_combined SDL2 SDL2_mixer ]
|
2018-08-20 20:11:29 +01:00
|
|
|
++ stdenv.lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm;
|
2015-06-17 18:36:06 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2015-04-30 11:50:27 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace build/src/glbuild.c \
|
2018-02-24 13:12:44 +00:00
|
|
|
--replace libGL.so ${libGLU_combined}/lib/libGL.so \
|
|
|
|
--replace libGLU.so ${libGLU_combined}/lib/libGLU.so
|
2015-04-30 11:50:27 +01:00
|
|
|
'';
|
|
|
|
|
2017-01-12 13:50:38 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2";
|
2015-04-30 11:50:27 +01:00
|
|
|
NIX_LDFLAGS = "-L${SDL2}/lib";
|
|
|
|
|
2015-11-26 17:44:44 +00:00
|
|
|
makeFlags = [
|
|
|
|
"LINKED_GTK=1"
|
|
|
|
"SDLCONFIG=${SDL2}/bin/sdl2-config"
|
|
|
|
"VC_REV=${rev}"
|
|
|
|
];
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2009-05-14 14:48:45 +01:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eduke32";
|
|
|
|
exec = "eduke32-wrapper";
|
|
|
|
comment = "Duke Nukem 3D port";
|
2015-04-30 11:50:27 +01:00
|
|
|
desktopName = "Enhanced Duke Nukem 3D";
|
2009-05-14 14:48:45 +01:00
|
|
|
genericName = "Duke Nukem 3D port";
|
|
|
|
categories = "Application;Game;";
|
|
|
|
};
|
2010-02-11 13:34:28 +00:00
|
|
|
|
2009-05-14 14:48:45 +01:00
|
|
|
installPhase = ''
|
|
|
|
# Make wrapper script
|
2015-04-30 11:50:27 +01:00
|
|
|
cat > eduke32-wrapper <<EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2015-04-30 11:50:27 +01:00
|
|
|
if [ "$EDUKE32_DATA_DIR" = "" ]; then
|
2011-07-25 11:48:07 +01:00
|
|
|
EDUKE32_DATA_DIR=/var/lib/games/eduke32
|
2009-05-14 15:05:38 +01:00
|
|
|
fi
|
2015-04-30 11:50:27 +01:00
|
|
|
if [ "$EDUKE32_GRP_FILE" = "" ]; then
|
2009-05-14 15:05:38 +01:00
|
|
|
EDUKE32_GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP
|
2009-05-14 14:48:45 +01:00
|
|
|
fi
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2009-05-14 14:48:45 +01:00
|
|
|
cd \$EDUKE32_DATA_DIR
|
2015-04-30 11:50:27 +01:00
|
|
|
exec $out/bin/eduke32 -g \$EDUKE32_GRP_FILE
|
2009-05-14 14:48:45 +01:00
|
|
|
EOF
|
2015-04-30 11:50:27 +01:00
|
|
|
|
|
|
|
# Install binaries
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -Dm755 eduke32{,-wrapper} mapster32 $out/bin
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2009-05-14 14:48:45 +01:00
|
|
|
# Install desktop item
|
2015-04-30 11:50:27 +01:00
|
|
|
cp -rv ${desktopItem}/share $out
|
2009-05-14 14:48:45 +01:00
|
|
|
'';
|
2014-11-06 00:44:33 +00:00
|
|
|
|
2015-04-30 11:50:27 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-02-11 13:34:28 +00:00
|
|
|
description = "Enhanched port of Duke Nukem 3D for various platforms";
|
2015-05-28 18:20:29 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2011-07-25 11:48:07 +01:00
|
|
|
homepage = http://eduke32.com;
|
2018-01-16 21:59:13 +00:00
|
|
|
maintainers = with maintainers; [ sander ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; linux;
|
2010-02-11 13:34:28 +00:00
|
|
|
};
|
2009-05-14 14:48:45 +01:00
|
|
|
}
|