From b0887160e48a2d83eadc949e6af60cdc92f57f97 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:58:14 -0400 Subject: [PATCH 1/5] eduke32: migrate to pkgs/by-name --- pkgs/{games => by-name/ed}/eduke32/convert-bmp-to-png.diff | 0 .../eduke32/default.nix => by-name/ed/eduke32/package.nix} | 6 ++---- pkgs/top-level/all-packages.nix | 4 ---- 3 files changed, 2 insertions(+), 8 deletions(-) rename pkgs/{games => by-name/ed}/eduke32/convert-bmp-to-png.diff (100%) rename pkgs/{games/eduke32/default.nix => by-name/ed/eduke32/package.nix} (98%) diff --git a/pkgs/games/eduke32/convert-bmp-to-png.diff b/pkgs/by-name/ed/eduke32/convert-bmp-to-png.diff similarity index 100% rename from pkgs/games/eduke32/convert-bmp-to-png.diff rename to pkgs/by-name/ed/eduke32/convert-bmp-to-png.diff diff --git a/pkgs/games/eduke32/default.nix b/pkgs/by-name/ed/eduke32/package.nix similarity index 98% rename from pkgs/games/eduke32/default.nix rename to pkgs/by-name/ed/eduke32/package.nix index c213a6317b10..7c0f05c79784 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -14,14 +14,12 @@ , libGL , SDL2 , SDL2_mixer -, AGL -, Cocoa -, GLUT -, OpenGL +, darwin , graphicsmagick }: let + inherit (darwin.apple_sdk.frameworks) AGL Cocoa GLUT OpenGL; wrapper = "eduke32-wrapper"; swWrapper = "voidsw-wrapper"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3d80d39bedd7..9d7f987e2f7d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34970,10 +34970,6 @@ with pkgs; ecwolf = callPackage ../games/ecwolf { }; - eduke32 = callPackage ../games/eduke32 { - inherit (darwin.apple_sdk.frameworks) AGL Cocoa GLUT OpenGL; - }; - egoboo = callPackage ../games/egoboo { }; eidolon = callPackage ../games/eidolon { }; From adabe50db8a31303534bc44a105f69e7e89986a9 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:00:51 -0400 Subject: [PATCH 2/5] eduke32: format with nixfmt-rfc-style --- pkgs/by-name/ed/eduke32/package.nix | 191 +++++++++++++++------------- 1 file changed, 106 insertions(+), 85 deletions(-) diff --git a/pkgs/by-name/ed/eduke32/package.nix b/pkgs/by-name/ed/eduke32/package.nix index 7c0f05c79784..0d40d52a49c5 100644 --- a/pkgs/by-name/ed/eduke32/package.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -1,29 +1,36 @@ -{ lib -, stdenv -, fetchFromGitLab -, makeWrapper -, pkg-config -, nasm -, makeDesktopItem -, copyDesktopItems -, alsa-lib -, flac -, gtk2 -, libvorbis -, libvpx -, libGL -, SDL2 -, SDL2_mixer -, darwin -, graphicsmagick +{ + lib, + stdenv, + fetchFromGitLab, + makeWrapper, + pkg-config, + nasm, + makeDesktopItem, + copyDesktopItems, + alsa-lib, + flac, + gtk2, + libvorbis, + libvpx, + libGL, + SDL2, + SDL2_mixer, + darwin, + graphicsmagick, }: let - inherit (darwin.apple_sdk.frameworks) AGL Cocoa GLUT OpenGL; + inherit (darwin.apple_sdk.frameworks) + AGL + Cocoa + GLUT + OpenGL + ; wrapper = "eduke32-wrapper"; swWrapper = "voidsw-wrapper"; -in stdenv.mkDerivation (finalAttrs: { +in +stdenv.mkDerivation (finalAttrs: { pname = "eduke32"; version = "0-unstable-2024-02-17"; @@ -41,43 +48,50 @@ in stdenv.mkDerivation (finalAttrs: { ./convert-bmp-to-png.diff ]; - buildInputs = [ - flac - libvorbis - libvpx - SDL2 - SDL2_mixer - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - gtk2 - libGL - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - AGL - Cocoa - GLUT - OpenGL - ]; + buildInputs = + [ + flac + libvorbis + libvpx + SDL2 + SDL2_mixer + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + gtk2 + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + AGL + Cocoa + GLUT + OpenGL + ]; - nativeBuildInputs = [ - makeWrapper - pkg-config - copyDesktopItems - graphicsmagick - ] ++ lib.optionals (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-fail '#include ' '#include ' \ - --replace-fail '#include ' '#include ' \ - --replace-fail '#include ' '#include ' - '' + lib.optionalString stdenv.hostPlatform.isLinux '' - for f in glad.c glad_wgl.c ; do - substituteInPlace source/glad/src/$f \ - --replace-fail libGL.so ${libGL}/lib/libGL.so - done - ''; + postPatch = + '' + substituteInPlace source/imgui/src/imgui_impl_sdl2.cpp \ + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for f in glad.c glad_wgl.c ; do + substituteInPlace source/glad/src/$f \ + --replace-fail libGL.so ${libGL}/lib/libGL.so + done + ''; makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" @@ -111,44 +125,51 @@ in stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - installPhase = '' - runHook preInstall + installPhase = + '' + runHook preInstall - install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator - '' + lib.optionalString stdenv.hostPlatform.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"' - 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.hostPlatform.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 + install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator + '' + + lib.optionalString stdenv.hostPlatform.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"' + 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.hostPlatform.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/ + 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 - ''; + 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 + ''; meta = { description = "Enhanched port of Duke Nukem 3D for various platforms"; homepage = "http://eduke32.com"; license = with lib.licenses; [ gpl2Plus ]; - maintainers = with lib.maintainers; [ mikroskeem sander ]; + maintainers = with lib.maintainers; [ + mikroskeem + sander + ]; platforms = lib.platforms.all; }; }) From 28519824242bfed738ffb7cd35b4eb180f1f7018 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:03:44 -0400 Subject: [PATCH 3/5] eduke32: 0-unstable-2024-02-17 -> 0-unstable-2024-07-26 --- pkgs/by-name/ed/eduke32/package.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ed/eduke32/package.nix b/pkgs/by-name/ed/eduke32/package.nix index 0d40d52a49c5..204f4777abcc 100644 --- a/pkgs/by-name/ed/eduke32/package.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -32,14 +32,14 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "eduke32"; - version = "0-unstable-2024-02-17"; + version = "0-unstable-2024-07-26"; src = fetchFromGitLab { domain = "voidpoint.io"; owner = "terminx"; repo = "eduke32"; - rev = "8afa42e388e0434b38979fdddc763363717a2727"; - hash = "sha256-dyZ4JtDBxsTDe9uQDWxJe7M74X7m+5wpEHm+i+s9hwo="; + rev = "19c21b9ab10b0c17147c9ad951cc15279ed33f77"; + hash = "sha256-lwnx2tVjbHouB0vaT7Dh1Ozea8+7Az6e4Wn6HmxDxCo="; }; patches = [ @@ -95,6 +95,10 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" + # git rev-list --count HEAD + "VC_REV=10593" + "VC_HASH=${lib.substring 0 9 finalAttrs.src.rev}" + "VC_BRANCH=master" ]; buildFlags = [ From daf926d0e34044f4cad7cb193dd7c83593937cca Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Sun, 12 May 2024 18:02:05 -0400 Subject: [PATCH 4/5] eduke32: add ion fury and fix wrappers - Add ion fury wrapper and desktop icon - Set GRP file per wrapper so when it traverses looking for games it will force to load the correct one --- pkgs/by-name/ed/eduke32/package.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ed/eduke32/package.nix b/pkgs/by-name/ed/eduke32/package.nix index 204f4777abcc..afe062d3210f 100644 --- a/pkgs/by-name/ed/eduke32/package.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -28,6 +28,7 @@ let ; wrapper = "eduke32-wrapper"; swWrapper = "voidsw-wrapper"; + furyWrapper = "fury-wrapper"; in stdenv.mkDerivation (finalAttrs: { @@ -125,6 +126,15 @@ stdenv.mkDerivation (finalAttrs: { genericName = "Shadow Warrior source port"; categories = [ "Game" ]; }) + (makeDesktopItem { + name = "fury"; + icon = "fury"; + exec = "${furyWrapper}"; + comment = "Ion Fury eduke32 source port"; + desktopName = "Ion Fury"; + genericName = "Ion Fury source port"; + categories = [ "Game" ]; + }) ]; enableParallelBuilding = true; @@ -138,13 +148,19 @@ stdenv.mkDerivation (finalAttrs: { + lib.optionalString stdenv.hostPlatform.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"' + --add-flags '-j"$EDUKE32_DATA_DIR"' \ + --add-flags '-gamegrp DUKE3D.GRP' makeWrapper $out/bin/voidsw $out/bin/${swWrapper} \ --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ - --add-flags '-g"$EDUKE32_DATA_DIR/SW.GRP"' + --add-flags '-j"$EDUKE32_DATA_DIR"' + makeWrapper $out/bin/eduke32 $out/bin/${furyWrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-j"$EDUKE32_DATA_DIR"' \ + --add-flags '-gamegrp FURY.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 + gm convert "./source/duke3d/rsrc/fury/game_icon.ico[4]" $out/share/icons/hicolor/scalable/apps/fury.png '' + lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/Applications/EDuke32.app/Contents/MacOS From 435828e33ce7a77d542fd58ff45e4cb961acff15 Mon Sep 17 00:00:00 2001 From: qubitnano <146656568+qubitnano@users.noreply.github.com> Date: Thu, 16 May 2024 17:36:49 -0400 Subject: [PATCH 5/5] eduke32: remove mikroskeem, add qubitnano to maintainers removal per request --- pkgs/by-name/ed/eduke32/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ed/eduke32/package.nix b/pkgs/by-name/ed/eduke32/package.nix index afe062d3210f..673e38d05875 100644 --- a/pkgs/by-name/ed/eduke32/package.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -187,7 +187,7 @@ stdenv.mkDerivation (finalAttrs: { homepage = "http://eduke32.com"; license = with lib.licenses; [ gpl2Plus ]; maintainers = with lib.maintainers; [ - mikroskeem + qubitnano sander ]; platforms = lib.platforms.all;