about summary refs log tree commit diff
path: root/pkgs/by-name/ri
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-06-02 01:21:18 +0200
committerGitHub <noreply@github.com>2024-06-02 01:21:18 +0200
commita4329a34eb561e5f94345e883795a4acd08c63ab (patch)
treebde7f317c32ca60ea7dc5d7bb276843b030d56f5 /pkgs/by-name/ri
parenta888068a01392dc59d5fa719d97d064af2c18ed1 (diff)
parente6fe91d186771b09ad5a59527e89f5eca1caaa65 (diff)
Merge pull request #306820 from donovanglover/ringracers
ringracers: init at 2.3
Diffstat (limited to 'pkgs/by-name/ri')
-rw-r--r--pkgs/by-name/ri/ringracers/package.nix95
1 files changed, 95 insertions, 0 deletions
diff --git a/pkgs/by-name/ri/ringracers/package.nix b/pkgs/by-name/ri/ringracers/package.nix
new file mode 100644
index 0000000000000..2f8368b848c06
--- /dev/null
+++ b/pkgs/by-name/ri/ringracers/package.nix
@@ -0,0 +1,95 @@
+{ lib
+, stdenv
+, fetchzip
+, fetchFromGitHub
+, cmake
+, curl
+, nasm
+, game-music-emu
+, libpng
+, SDL2
+, SDL2_mixer
+, libvpx
+, libyuv
+, zlib
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "ringracers";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "KartKrewDev";
+    repo = "RingRacers";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-X2rSwZOEHtnSJBpu+Xf2vkxGUAZSNSXi6GCuGlM6jhY=";
+  };
+
+  assets = fetchzip {
+    name = "${finalAttrs.pname}-${finalAttrs.version}-assets";
+    url = "https://github.com/KartKrewDev/RingRacers/releases/download/v${finalAttrs.version}/Dr.Robotnik.s-Ring-Racers-v${finalAttrs.version}-Assets.zip";
+    hash = "sha256-sHeI1E6uNF0gBNd1e1AU/JT9wyZdkCQgYLiMPZqXAVc=";
+    stripRoot = false;
+  };
+
+  nativeBuildInputs = [
+    cmake
+    nasm
+    makeWrapper
+    copyDesktopItems
+  ];
+
+  buildInputs = [
+    curl
+    game-music-emu
+    libpng
+    SDL2
+    SDL2_mixer
+    libvpx
+    libyuv
+    zlib
+  ];
+
+  cmakeFlags = [
+    "-DSRB2_ASSET_DIRECTORY=${finalAttrs.assets}"
+    "-DGME_INCLUDE_DIR=${game-music-emu}/include"
+    "-DSDL2_MIXER_INCLUDE_DIR=${lib.getDev SDL2_mixer}/include/SDL2"
+    "-DSDL2_INCLUDE_DIR=${lib.getDev SDL2}/include/SDL2"
+  ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "ringracers";
+      exec = "ringracers";
+      icon = "ringracers";
+      comment = "This is Racing at the Next Level";
+      desktopName = "Dr. Robotnik's Ring Racers";
+      startupWMClass = ".ringracers-wrapped";
+      categories = [ "Game" ];
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 ../srb2.png $out/share/icons/hicolor/256x256/apps/ringracers.png
+    install -Dm755 bin/ringracers $out/bin/ringracers
+
+    wrapProgram $out/bin/ringracers \
+      --set RINGRACERSWADDIR "${finalAttrs.assets}"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Kart racing video game based on Sonic Robo Blast 2 (SRB2), itself based on a modified version of Doom Legacy";
+    homepage = "https://kartkrew.org";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ donovanglover thehans255 ];
+    mainProgram = "ringracers";
+  };
+})