From 741c6ce23ac78c574533b6a048cd43fdde29a606 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sat, 2 Mar 2024 17:01:32 -0500 Subject: [PATCH 1/3] eduke32: 20230926 -> 0-unstable-2024-02-17 --- pkgs/games/eduke32/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 051e097eb3a3..1e4ce032a9f2 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -1,6 +1,6 @@ { lib , stdenv -, fetchurl +, fetchFromGitLab , makeWrapper , pkg-config , nasm @@ -34,13 +34,14 @@ let in stdenv.mkDerivation rec { pname = "eduke32"; - version = "20230926"; - rev = "10459"; - revExtra = "8feaf6c25"; + version = "0-unstable-2024-02-17"; - src = fetchurl { - url = "https://dukeworld.com/eduke32/synthesis/${version}-${rev}-${revExtra}/eduke32_src_${version}-${rev}-${revExtra}.tar.xz"; - hash = "sha256-GQOpDQm2FeaOMyYu9L5zhrM6XFvZAHMAwn1tSK7RCB8="; + src = fetchFromGitLab { + domain = "voidpoint.io"; + owner = "terminx"; + repo = "eduke32"; + rev = "8afa42e388e0434b38979fdddc763363717a2727"; + hash = "sha256-dyZ4JtDBxsTDe9uQDWxJe7M74X7m+5wpEHm+i+s9hwo="; }; buildInputs = [ From 555b8c640cf2fc60fb2c11b878d59e1c7545b661 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sun, 25 Feb 2024 21:52:25 -0500 Subject: [PATCH 2/3] eduke32: refactor --- pkgs/games/eduke32/default.nix | 35 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 1e4ce032a9f2..38d34b6a2b28 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -10,7 +10,6 @@ , gtk2 , libvorbis , libvpx -, libGLU , libGL , SDL2 , SDL2_mixer @@ -32,7 +31,7 @@ let wrapper = "eduke32-wrapper"; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (finalAttrs: { pname = "eduke32"; version = "0-unstable-2024-02-17"; @@ -54,7 +53,6 @@ in stdenv.mkDerivation rec { alsa-lib gtk2 libGL - libGLU ] ++ lib.optionals stdenv.isDarwin [ AGL Cocoa @@ -62,21 +60,24 @@ in stdenv.mkDerivation rec { OpenGL ]; - nativeBuildInputs = [ makeWrapper pkg-config ] - ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; + nativeBuildInputs = [ + makeWrapper + pkg-config + copyDesktopItems + graphicsmagick + ] ++ lib.optionals (stdenv.hostPlatform.system == "i686-linux") [ + nasm + ]; postPatch = '' substituteInPlace source/imgui/src/imgui_impl_sdl2.cpp \ - --replace '#include ' '#include ' \ - --replace '#include ' '#include ' \ - --replace '#include ' '#include ' + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' '' + lib.optionalString stdenv.isLinux '' - substituteInPlace source/build/src/glbuild.cpp \ - --replace libGLU.so ${libGLU}/lib/libGLU.so - for f in glad.c glad_wgl.c ; do substituteInPlace source/glad/src/$f \ - --replace libGL.so ${libGL}/lib/libGL.so + --replace-fail libGL.so ${libGL}/lib/libGL.so done ''; @@ -114,11 +115,11 @@ in stdenv.mkDerivation rec { runHook postInstall ''; - meta = with lib; { + meta = { description = "Enhanched port of Duke Nukem 3D for various platforms"; homepage = "http://eduke32.com"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ mikroskeem sander ]; - platforms = platforms.all; + license = with lib.licenses; [ gpl2Plus ]; + maintainers = with lib.maintainers; [ mikroskeem sander ]; + platforms = lib.platforms.all; }; -} +}) From fbc365e9ecf8e3445a89cae95f3afb85ee57c648 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:34:39 -0500 Subject: [PATCH 3/3] eduke32: build with voidsw VoidSW is a Shadow Warrior source port included with eduke32 --- pkgs/games/eduke32/default.nix | 56 +++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 38d34b6a2b28..1ddcccd27f9d 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -5,6 +5,7 @@ , pkg-config , nasm , makeDesktopItem +, copyDesktopItems , alsa-lib , flac , gtk2 @@ -17,19 +18,12 @@ , Cocoa , GLUT , OpenGL +, graphicsmagick }: 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"; + swWrapper = "voidsw-wrapper"; in stdenv.mkDerivation (finalAttrs: { pname = "eduke32"; @@ -88,29 +82,63 @@ in stdenv.mkDerivation (finalAttrs: { "LTO=0" ]; + buildFlags = [ + "duke3d" + "sw" + ]; + + desktopItems = [ + (makeDesktopItem { + name = "eduke32"; + icon = "eduke32"; + exec = "${wrapper}"; + comment = "Duke Nukem 3D port"; + desktopName = "Enhanced Duke Nukem 3D"; + genericName = "Duke Nukem 3D port"; + categories = [ "Game" ]; + }) + (makeDesktopItem { + name = "voidsw"; + icon = "voidsw"; + exec = "${swWrapper}"; + comment = "Shadow Warrior eduke32 source port"; + desktopName = "VoidSW"; + genericName = "Shadow Warrior source port"; + categories = [ "Game" ]; + }) + ]; + enableParallelBuilding = true; installPhase = '' runHook preInstall - install -Dm755 -t $out/bin eduke32 mapster32 + install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator '' + lib.optionalString stdenv.isLinux '' 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 + makeWrapper $out/bin/voidsw $out/bin/${swWrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-g"$EDUKE32_DATA_DIR/SW.GRP"' + mkdir -p $out/share/icons/hicolor/scalable/apps + gm convert "./source/duke3d/rsrc/game_icon.ico[10]" $out/share/icons/hicolor/scalable/apps/eduke32.png + install -Dm644 ./source/sw/rsrc/game_icon.svg $out/share/icons/hicolor/scalable/apps/voidsw.svg '' + lib.optionalString stdenv.isDarwin '' mkdir -p $out/Applications/EDuke32.app/Contents/MacOS mkdir -p $out/Applications/Mapster32.app/Contents/MacOS + mkdir -p $out/Applications/VoidSW.app/Contents/MacOS + mkdir -p $out/Applications/Wangulator.app/Contents/MacOS cp -r platform/Apple/bundles/EDuke32.app/* $out/Applications/EDuke32.app/ cp -r platform/Apple/bundles/Mapster32.app/* $out/Applications/Mapster32.app/ + cp -r platform/Apple/bundles/VoidSW.app/* $out/Applications/VoidSW.app/ + cp -r platform/Apple/bundles/Wangulator.app/* $out/Applications/Wangulator.app/ ln -sf $out/bin/eduke32 $out/Applications/EDuke32.app/Contents/MacOS/eduke32 ln -sf $out/bin/mapster32 $out/Applications/Mapster32.app/Contents/MacOS/mapster32 + ln -sf $out/bin/voidsw $out/Applications/VoidSW.app/Contents/MacOS/voidsw + ln -sf $out/bin/wangulator $out/Applications/Wangulator.app/Contents/MacOS/wangulator '' + '' runHook postInstall '';