pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / doom-ports / rbdoom-3-bfg / default.nix
blob07f809662d6bbeab05bfffbd84bc531fcab73b0e
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , directx-shader-compiler
7 , libGLU
8 , libpng
9 , libjpeg_turbo
10 , openal
11 , rapidjson
12 , SDL2
13 , vulkan-headers
14 , vulkan-loader
15 , zlib
18 stdenv.mkDerivation rec {
19   pname = "rbdoom-3-bfg";
20   version = "1.5.1";
22   src = fetchFromGitHub {
23     owner = "RobertBeckebans";
24     repo = pname;
25     rev = "v${version}";
26     hash = "sha256-bjjeTdbQDWTibSrIWhCnr6F0Ef17efLgWGQAAwezjUw=";
27     fetchSubmodules = true;
28   };
30   patches = fetchpatch {
31     name = "replace-HLSL-ternary-operators.patch";
32     url = "https://github.com/RobertBeckebans/RBDOOM-3-BFG/commit/feffa4a4dd9a2a5f3c608f720cde41bea37797d3.patch";
33     hash = "sha256-aR1eoWZL3+ps7P7yFXFvGsMFxpUSBDiyBsja/ISin4I=";
34   };
36   postPatch = ''
37     substituteInPlace neo/extern/nvrhi/tools/shaderCompiler/CMakeLists.txt \
38       --replace "AppleClang" "Clang"
39   '';
41   nativeBuildInputs = [
42     cmake
43     directx-shader-compiler
44   ];
46   buildInputs = [
47     libGLU
48     libpng
49     libjpeg_turbo
50     openal
51     rapidjson
52     SDL2
53     vulkan-headers
54     vulkan-loader
55     zlib
56   ];
58   cmakeDir = "../neo";
59   cmakeFlags = [
60     "-DFFMPEG=OFF"
61     "-DBINKDEC=ON"
62     "-DUSE_SYSTEM_LIBGLEW=ON"
63     "-DUSE_SYSTEM_LIBPNG=ON"
64     "-DUSE_SYSTEM_LIBJPEG=ON"
65     "-DUSE_SYSTEM_RAPIDJSON=ON"
66     "-DUSE_SYSTEM_ZLIB=ON"
67   ];
69   # it caused build failure
70   hardeningDisable = [ "fortify3" ];
72   installPhase = ''
73     runHook preInstall
75     mkdir -p $out/bin
76     install RBDoom3BFG $out/bin/RBDoom3BFG
78     runHook postInstall
79   '';
81   meta = with lib; {
82     homepage = "https://github.com/RobertBeckebans/RBDOOM-3-BFG";
83     description = "Doom 3 BFG Edition with modern engine features";
84     mainProgram = "RBDoom3BFG";
85     license = licenses.gpl3Plus;
86     maintainers = with maintainers; [ Zaechus ];
87     platforms = platforms.unix;
88   };