From 2827e49596af06d0de9adab2245e995a6c9b5336 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 3 Apr 2019 21:15:50 +0800 Subject: [PATCH] eduke32: 20150420 -> 20190330 Also: - use makeWrapper instead of a custom binary wrapper - general minor cleanups --- pkgs/games/eduke32/default.nix | 106 +++++++++++++++++---------------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index c51f014b179d..3407659d977b 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -1,76 +1,78 @@ -{ stdenv, fetchurl, flac, gtk2, libvorbis, libvpx, makeDesktopItem, libGLU_combined, nasm -, pkgconfig, SDL2, SDL2_mixer, runtimeShell }: +{ stdenv, fetchurl, makeWrapper, pkgconfig, nasm, makeDesktopItem +, flac, gtk2, libvorbis, libvpx, libGLU_combined +, SDL2, SDL2_mixer }: let - year = "2015"; - date = "20150420"; - rev = "5160"; -in stdenv.mkDerivation rec { - name = "eduke32-${version}"; - version = "${date}-${rev}"; - - src = fetchurl { - url = "http://dukeworld.duke4.net/eduke32/synthesis/old/${year}/${version}/eduke32_src_${version}.tar.xz"; - sha256 = "1nlq5jbglg00c1z1vsyl627fh0mqfxvk5qyxav5vzla2b4svik2v"; - }; - - buildInputs = [ flac gtk2 libvorbis libvpx libGLU_combined SDL2 SDL2_mixer ] - ++ stdenv.lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; - nativeBuildInputs = [ pkgconfig ]; - - postPatch = '' - substituteInPlace build/src/glbuild.c \ - --replace libGL.so ${libGLU_combined}/lib/libGL.so \ - --replace libGLU.so ${libGLU_combined}/lib/libGLU.so - ''; - - NIX_CFLAGS_COMPILE = "-I${SDL2.dev}/include/SDL2 -I${SDL2_mixer}/include/SDL2"; - NIX_LDFLAGS = "-L${SDL2}/lib"; - - makeFlags = [ - "LINKED_GTK=1" - "SDLCONFIG=${SDL2}/bin/sdl2-config" - "VC_REV=${rev}" - ]; + version = "20190330"; + rev = "7470"; desktopItem = makeDesktopItem { name = "eduke32"; - exec = "eduke32-wrapper"; + 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 { + name = "eduke32-${version}"; + + src = fetchurl { + url = "http://dukeworld.duke4.net/eduke32/synthesis/latest/eduke32_src_${version}-${rev}.tar.xz"; + sha256 = "09a7l23i6sygicc82w1in9hjw0jvivlf7q0vw8kcx9j98lm23mkn"; + }; + + buildInputs = [ flac gtk2 libvorbis libvpx libGLU_combined SDL2 SDL2_mixer ]; + + nativeBuildInputs = [ makeWrapper pkgconfig ] + ++ stdenv.lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; + + postPatch = '' + substituteInPlace source/build/src/glbuild.cpp \ + --replace libGLU.so ${libGLU_combined}/lib/libGLU.so + + for f in glad.c glad_wgl.c ; do + substituteInPlace source/glad/src/$f \ + --replace libGL.so ${libGLU_combined}/lib/libGL.so + done + ''; + + NIX_CFLAGS_COMPILE = [ + "-I${SDL2.dev}/include/SDL2" + "-I${SDL2_mixer}/include/SDL2" + ]; + + makeFlags = [ + "SDLCONFIG=${SDL2}/bin/sdl2-config" + ]; + + enableParallelBuilding = true; + installPhase = '' - # Make wrapper script - cat > eduke32-wrapper <