2019-04-03 15:15:50 +02:00
|
|
|
{ stdenv, fetchurl, makeWrapper, pkgconfig, nasm, makeDesktopItem
|
2019-11-10 17:44:34 +01:00
|
|
|
, flac, gtk2, libvorbis, libvpx, libGLU, libGL
|
2019-04-03 15:15:50 +02:00
|
|
|
, SDL2, SDL2_mixer }:
|
2009-05-14 15:48:45 +02:00
|
|
|
|
2015-04-30 12:50:27 +02:00
|
|
|
let
|
2019-04-03 15:15:50 +02:00
|
|
|
version = "20190330";
|
|
|
|
rev = "7470";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "eduke32";
|
|
|
|
exec = "@out@/bin/${wrapper}";
|
|
|
|
comment = "Duke Nukem 3D port";
|
|
|
|
desktopName = "Enhanced Duke Nukem 3D";
|
|
|
|
genericName = "Duke Nukem 3D port";
|
|
|
|
categories = "Application;Game;";
|
|
|
|
};
|
|
|
|
|
|
|
|
wrapper = "eduke32-wrapper";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "eduke32";
|
|
|
|
inherit version;
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2011-07-25 12:48:07 +02:00
|
|
|
src = fetchurl {
|
2019-04-03 15:15:50 +02:00
|
|
|
url = "http://dukeworld.duke4.net/eduke32/synthesis/latest/eduke32_src_${version}-${rev}.tar.xz";
|
|
|
|
sha256 = "09a7l23i6sygicc82w1in9hjw0jvivlf7q0vw8kcx9j98lm23mkn";
|
2009-05-14 15:48:45 +02:00
|
|
|
};
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2019-11-10 17:44:34 +01:00
|
|
|
buildInputs = [ flac gtk2 libvorbis libvpx libGL libGLU SDL2 SDL2_mixer ];
|
2019-04-03 15:15:50 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper pkgconfig ]
|
2018-08-20 21:11:29 +02:00
|
|
|
++ stdenv.lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm;
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2015-04-30 12:50:27 +02:00
|
|
|
postPatch = ''
|
2019-04-03 15:15:50 +02:00
|
|
|
substituteInPlace source/build/src/glbuild.cpp \
|
2019-11-10 17:44:34 +01:00
|
|
|
--replace libGLU.so ${libGLU}/lib/libGLU.so
|
2019-04-03 15:15:50 +02:00
|
|
|
|
|
|
|
for f in glad.c glad_wgl.c ; do
|
|
|
|
substituteInPlace source/glad/src/$f \
|
2019-11-10 17:44:34 +01:00
|
|
|
--replace libGL.so ${libGL}/lib/libGL.so
|
2019-04-03 15:15:50 +02:00
|
|
|
done
|
2015-04-30 12:50:27 +02:00
|
|
|
'';
|
|
|
|
|
2019-10-30 02:29:30 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2";
|
2015-04-30 12:50:27 +02:00
|
|
|
|
2015-11-26 18:44:44 +01:00
|
|
|
makeFlags = [
|
|
|
|
"SDLCONFIG=${SDL2}/bin/sdl2-config"
|
|
|
|
];
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2019-04-03 15:15:50 +02:00
|
|
|
enableParallelBuilding = true;
|
2010-02-11 14:34:28 +01:00
|
|
|
|
2009-05-14 15:48:45 +02:00
|
|
|
installPhase = ''
|
2019-04-03 15:15:50 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 -t $out/bin eduke32 mapster32
|
|
|
|
|
|
|
|
makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \
|
|
|
|
--set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \
|
|
|
|
--add-flags '-g "$EDUKE32_DATA_DIR/DUKE3D.GRP"'
|
|
|
|
|
2015-04-30 12:50:27 +02:00
|
|
|
cp -rv ${desktopItem}/share $out
|
2019-04-03 15:15:50 +02:00
|
|
|
substituteInPlace $out/share/applications/eduke32.desktop \
|
|
|
|
--subst-var out
|
|
|
|
|
|
|
|
runHook postInstall
|
2009-05-14 15:48:45 +02:00
|
|
|
'';
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2015-04-30 12:50:27 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-02-11 14:34:28 +01:00
|
|
|
description = "Enhanched port of Duke Nukem 3D for various platforms";
|
2011-07-25 12:48:07 +02:00
|
|
|
homepage = http://eduke32.com;
|
2019-04-03 15:15:50 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2018-01-16 22:59:13 +01:00
|
|
|
maintainers = with maintainers; [ sander ];
|
2019-04-03 15:15:50 +02:00
|
|
|
# Darwin is untested (supported by upstream)
|
|
|
|
platforms = platforms.all;
|
2010-02-11 14:34:28 +01:00
|
|
|
};
|
2009-05-14 15:48:45 +02:00
|
|
|
}
|