Unverified Commit e5513db9 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

openrw: 0-unstable-2024-04-20 -> 0-unstable-2025-01-09, cleanup, move to by-name (#389379)

parents 2eff08c6 6a9d3e88
Loading
Loading
Loading
Loading
+36 −39
Original line number Diff line number Diff line
@@ -2,43 +2,41 @@
  lib,
  stdenv,
  fetchFromGitHub,

  # nativeBuildInputs
  cmake,
  ninja,
  sfml,
  libGLU,
  libGL,

  # buildInputs
  SDL2,
  boost,
  bullet,
  ffmpeg_6,
  glm,
  libGL,
  libGLU,
  libmad,
  openal,
  SDL2,
  boost,
  ffmpeg_6,
  Cocoa,
  OpenAL,
  sfml,

  unstableGitUpdater,
}:

stdenv.mkDerivation {
  version = "0-unstable-2024-04-20";
  version = "0-unstable-2025-01-09";
  pname = "openrw";

  src = fetchFromGitHub {
    owner = "rwengine";
    repo = "openrw";
    rev = "f10a5a8f7abc79a0728847e9a10ee104a1216047";
    hash = "sha256-4ydwPh/pCzuZNNOyZuEEeX4wzI+dqTtAxUyXOXz76zk=";
    rev = "556cdfbbf1fb5b3ddef5e43f36e97976be0252fc";
    fetchSubmodules = true;
    hash = "sha256-NYn89KGMITccVdqGo7NUS45HxXGurR9QDbVKEagjFqk=";
  };

  patches = [
    # SoundSource.cpp: return AVERROR_EOF when buffer is empty
    # https://github.com/rwengine/openrw/pull/747
    ./fix-ffmpeg-6.patch
  ];

  postPatch = lib.optional (stdenv.cc.isClang && (lib.versionAtLeast stdenv.cc.version "9")) ''
    substituteInPlace cmake_configure.cmake \
      --replace 'target_link_libraries(rw_interface INTERFACE "stdc++fs")' ""
      --replace-fail 'target_link_libraries(rw_interface INTERFACE "stdc++fs")' ""
  '';

  nativeBuildInputs = [
@@ -46,34 +44,33 @@ stdenv.mkDerivation {
    ninja
  ];

  buildInputs =
    [
      sfml
      libGLU
      libGL
  buildInputs = [
    SDL2
    boost
    bullet
    ffmpeg_6
    glm
    libGL
    libGLU
    libmad
    openal
      SDL2
      boost
      ffmpeg_6
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      OpenAL
      Cocoa
    sfml
  ];

  meta = with lib; {
  passthru = {
    updateScript = unstableGitUpdater { };
  };

  meta = {
    description = "Unofficial open source recreation of the classic Grand Theft Auto III game executable";
    homepage = "https://github.com/rwengine/openrw";
    license = licenses.gpl3;
    license = lib.licenses.gpl3;
    longDescription = ''
      OpenRW is an open source re-implementation of Rockstar Games' Grand Theft
      Auto III, a classic 3D action game first published in 2001.
    '';
    maintainers = with maintainers; [ kragniz ];
    platforms = platforms.all;
    maintainers = with lib.maintainers; [ kragniz ];
    platforms = lib.platforms.all;
    mainProgram = "rwgame";
  };
}
+0 −22
Original line number Diff line number Diff line
From ad7be040894661b708f9c861696499640ac7f9dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomi=20L=C3=A4hteenm=C3=A4ki?= <lihis@lihis.net>
Date: Fri, 1 Dec 2023 16:01:59 +0200
Subject: [PATCH] SoundSource.cpp: return AVERROR_EOF when buffer is empty

---
 rwengine/src/audio/SoundSource.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rwengine/src/audio/SoundSource.cpp b/rwengine/src/audio/SoundSource.cpp
index c93376e73..d355cab74 100644
--- a/rwengine/src/audio/SoundSource.cpp
+++ b/rwengine/src/audio/SoundSource.cpp
@@ -55,7 +55,7 @@ int read_packet(void* opaque, uint8_t* buf, int buf_size) {
     memcpy(buf, input->ptr, buf_size);
     input->ptr += buf_size;
     input->size -= buf_size;
-    return buf_size;
+    return buf_size <= 0 ? AVERROR_EOF : buf_size;
 }
 }  // namespace
 
+0 −4
Original line number Diff line number Diff line
@@ -16323,10 +16323,6 @@ with pkgs;
  openra = openraPackages.engines.release;
  openrw = callPackage ../games/openrw {
    inherit (darwin.apple_sdk.frameworks) Cocoa OpenAL;
  };
  openspades = callPackage ../games/openspades {
    inherit (darwin.apple_sdk.frameworks) Cocoa;
  };