Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fb16ffd8a287
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e129404b910f
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 3, 2019

  1. eduke32: 20150420 -> 20190330

    Also:
    
     - use makeWrapper instead of a custom binary wrapper
     - general minor cleanups
    peterhoeg committed Apr 3, 2019
    Copy the full SHA
    2827e49 View commit details

Commits on Apr 5, 2019

  1. Merge pull request #58933 from peterhoeg/u/eduke32

    eduke32: 20150420 -> 20190330
    svanderburg authored Apr 5, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e129404 View commit details
Showing with 50 additions and 48 deletions.
  1. +50 −48 pkgs/games/eduke32/default.nix
98 changes: 50 additions & 48 deletions pkgs/games/eduke32/default.nix
Original file line number Diff line number Diff line change
@@ -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 {
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 {
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";
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 ]
buildInputs = [ flac gtk2 libvorbis libvpx libGLU_combined SDL2 SDL2_mixer ];

nativeBuildInputs = [ makeWrapper pkgconfig ]
++ 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
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";
NIX_LDFLAGS = "-L${SDL2}/lib";
NIX_CFLAGS_COMPILE = [
"-I${SDL2.dev}/include/SDL2"
"-I${SDL2_mixer}/include/SDL2"
];

makeFlags = [
"LINKED_GTK=1"
"SDLCONFIG=${SDL2}/bin/sdl2-config"
"VC_REV=${rev}"
];

desktopItem = makeDesktopItem {
name = "eduke32";
exec = "eduke32-wrapper";
comment = "Duke Nukem 3D port";
desktopName = "Enhanced Duke Nukem 3D";
genericName = "Duke Nukem 3D port";
categories = "Application;Game;";
};
enableParallelBuilding = true;

installPhase = ''
# Make wrapper script
cat > eduke32-wrapper <<EOF
#!${runtimeShell}
if [ "$EDUKE32_DATA_DIR" = "" ]; then
EDUKE32_DATA_DIR=/var/lib/games/eduke32
fi
if [ "$EDUKE32_GRP_FILE" = "" ]; then
EDUKE32_GRP_FILE=\$EDUKE32_DATA_DIR/DUKE3D.GRP
fi
cd \$EDUKE32_DATA_DIR
exec $out/bin/eduke32 -g \$EDUKE32_GRP_FILE
EOF
# Install binaries
mkdir -p $out/bin
install -Dm755 eduke32{,-wrapper} mapster32 $out/bin
# Install desktop item
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"'
cp -rv ${desktopItem}/share $out
substituteInPlace $out/share/applications/eduke32.desktop \
--subst-var out
runHook postInstall
'';

meta = with stdenv.lib; {
description = "Enhanched port of Duke Nukem 3D for various platforms";
license = licenses.gpl2Plus;
homepage = http://eduke32.com;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sander ];
platforms = with platforms; linux;
# Darwin is untested (supported by upstream)
platforms = platforms.all;
};
}