evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / nx / nxengine-evo / package.nix
blob10acb961d4417993a09e18bbf67e5550345190bb
2   lib,
3   SDL2,
4   SDL2_mixer,
5   callPackage,
6   cmake,
7   pkg-config,
8   ninja,
9   fetchFromGitHub,
10   fetchpatch,
11   libpng,
12   stdenv,
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "nxengine-evo";
17   version = "2.6.4";
19   src = fetchFromGitHub {
20     owner = "nxengine";
21     repo = "nxengine-evo";
22     rev = "v${finalAttrs.version}";
23     hash = "sha256-krK2b1E5JUMxRoEWmb3HZMNSIHfUUGXSpyb4/Zdp+5A=";
24   };
26   patches = [
27     # Fix building by adding SDL_MIXER to include path
28     (fetchpatch {
29       url = "https://github.com/nxengine/nxengine-evo/commit/1890127ec4b4b5f8d6cb0fb30a41868e95659840.patch";
30       hash = "sha256-wlsIdN2RugOo94V3qj/AzYgrs2kf0i1Iw5zNOP8WQqI=";
31     })
32     # Fix buffer overflow
33     (fetchpatch {
34       url = "https://github.com/nxengine/nxengine-evo/commit/75b8b8e3b067fd354baa903332f2a3254d1cc017.patch";
35       hash = "sha256-fZVaZAOHgFoNakOR2MfsvRJjuLhbx+5id/bcN8w/WWo=";
36     })
37     # Add missing include
38     (fetchpatch {
39       url = "https://github.com/nxengine/nxengine-evo/commit/0076ebb11bcfec5dc5e2e923a50425f1a33a4133.patch";
40       hash = "sha256-8j3fFFw8DMljV7aAFXE+eA+vkbz1HdFTMAJmk3BRU04=";
41     })
42   ];
44   nativeBuildInputs = [
45     SDL2
46     cmake
47     ninja
48     pkg-config
49   ];
51   buildInputs = [
52     SDL2
53     SDL2_mixer
54     libpng
55   ];
57   strictDeps = true;
59   # Allow finding game assets.
60   postPatch = ''
61     sed -i -e "s,/usr/share/,$out/share/," src/ResourceManager.cpp
62   '';
64   installPhase = ''
65     runHook preInstall
67     cd ..
68     mkdir -p $out/bin/ $out/share/nxengine/
69     install bin/* $out/bin/
70   '' + ''
71     cp -r ${finalAttrs.finalPackage.assets}/share/nxengine/data $out/share/nxengine/data
72     chmod -R a=r,a+X $out/share/nxengine/data
73   '' + ''
74     runHook postInstall
75   '';
77   passthru = {
78     assets = callPackage ./assets.nix { };
79   };
81   meta = {
82     homepage = "https://github.com/nxengine/nxengine-evo";
83     changelog = "https://github.com/nxengine/nxengine-evo/releases/tag/${finalAttrs.src.rev}";
84     description = "Complete open-source clone/rewrite of the masterpiece jump-and-run platformer Doukutsu Monogatari (also known as Cave Story)";
85     license = with lib.licenses; [
86       gpl3Plus
87     ];
88     mainProgram = "nx";
89     maintainers = with lib.maintainers; [ AndersonTorres ];
90     platforms = lib.platforms.linux;
91   };