acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / games / openrw / default.nix
blobd2d86226af2612ee0336933af9cc397cf5b7a220
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , ninja
6 , sfml
7 , libGLU
8 , libGL
9 , bullet
10 , glm
11 , libmad
12 , openal
13 , SDL2
14 , boost
15 , ffmpeg_6
16 , Cocoa
17 , OpenAL }:
19 stdenv.mkDerivation {
20   version = "0-unstable-2024-04-20";
21   pname = "openrw";
23   src = fetchFromGitHub {
24     owner = "rwengine";
25     repo = "openrw";
26     rev = "f10a5a8f7abc79a0728847e9a10ee104a1216047";
27     hash = "sha256-4ydwPh/pCzuZNNOyZuEEeX4wzI+dqTtAxUyXOXz76zk=";
28     fetchSubmodules = true;
29   };
31   patches = [
32     # SoundSource.cpp: return AVERROR_EOF when buffer is empty
33     # https://github.com/rwengine/openrw/pull/747
34     ./fix-ffmpeg-6.patch
35   ];
37   postPatch = lib.optional (stdenv.cc.isClang && (lib.versionAtLeast stdenv.cc.version "9"))''
38     substituteInPlace cmake_configure.cmake \
39       --replace 'target_link_libraries(rw_interface INTERFACE "stdc++fs")' ""
40   '';
42   nativeBuildInputs = [ cmake ninja ];
44   buildInputs = [
45     sfml libGLU libGL bullet glm libmad openal SDL2 boost ffmpeg_6
46   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ OpenAL Cocoa ];
48   meta = with lib; {
49     description = "Unofficial open source recreation of the classic Grand Theft Auto III game executable";
50     homepage = "https://github.com/rwengine/openrw";
51     license = licenses.gpl3;
52     longDescription = ''
53       OpenRW is an open source re-implementation of Rockstar Games' Grand Theft
54       Auto III, a classic 3D action game first published in 2001.
55     '';
56     maintainers = with maintainers; [ kragniz ];
57     platforms = platforms.all;
58     mainProgram = "rwgame";
59   };