3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/games/eduke32/default.nix

76 lines
2.1 KiB
Nix
Raw Normal View History

2021-01-17 02:04:36 +00:00
{ lib, stdenv, fetchurl, makeWrapper, pkg-config, nasm, makeDesktopItem
, alsa-lib, flac, gtk2, libvorbis, libvpx, libGLU, libGL
, SDL2, SDL2_mixer }:
2015-04-30 11:50:27 +01:00
let
desktopItem = makeDesktopItem {
name = "eduke32";
exec = "@out@/bin/${wrapper}";
comment = "Duke Nukem 3D port";
desktopName = "Enhanced Duke Nukem 3D";
genericName = "Duke Nukem 3D port";
categories = "Game;";
};
wrapper = "eduke32-wrapper";
2021-06-22 22:44:58 +01:00
in stdenv.mkDerivation rec {
2019-08-13 22:52:01 +01:00
pname = "eduke32";
2021-07-25 21:04:24 +01:00
version = "20210722";
rev = "9484";
revExtra = "f3fea8c15";
src = fetchurl {
2021-07-25 21:04:24 +01:00
url = "http://dukeworld.duke4.net/eduke32/synthesis/${version}-${rev}-${revExtra}/eduke32_src_${version}-${rev}-${revExtra}.tar.xz";
sha256 = "0fdl2i465cl5x7129772ksx97lvim98m9009q5cfmf6scagj9pvz";
};
buildInputs = [ alsa-lib flac gtk2 libvorbis libvpx libGL libGLU SDL2 SDL2_mixer ];
2021-01-17 02:04:36 +00:00
nativeBuildInputs = [ makeWrapper pkg-config ]
2021-01-15 04:31:39 +00:00
++ lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm;
2015-04-30 11:50:27 +01:00
postPatch = ''
substituteInPlace source/build/src/glbuild.cpp \
2019-11-10 16:44:34 +00:00
--replace libGLU.so ${libGLU}/lib/libGLU.so
for f in glad.c glad_wgl.c ; do
substituteInPlace source/glad/src/$f \
2019-11-10 16:44:34 +00:00
--replace libGL.so ${libGL}/lib/libGL.so
done
2015-04-30 11:50:27 +01:00
'';
2019-10-30 01:29:30 +00:00
NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2";
2015-04-30 11:50:27 +01:00
makeFlags = [
"SDLCONFIG=${SDL2}/bin/sdl2-config"
];
enableParallelBuilding = true;
installPhase = ''
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 11:50:27 +01:00
cp -rv ${desktopItem}/share $out
substituteInPlace $out/share/applications/eduke32.desktop \
--subst-var out
runHook postInstall
'';
meta = with lib; {
description = "Enhanched port of Duke Nukem 3D for various platforms";
homepage = "http://eduke32.com";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sander ];
# Darwin is untested (supported by upstream)
platforms = platforms.all;
};
}