nixpkgs/pkgs/by-name/nx/nxengine-evo/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.2 KiB
Nix
Raw Normal View History

{
lib,
SDL2,
SDL2_mixer,
callPackage,
cmake,
pkg-config,
ninja,
fetchFromGitHub,
fetchpatch,
fetchurl,
libpng,
stdenv,
2019-07-20 07:52:07 +02:00
}:
stdenv.mkDerivation (finalAttrs: {
2019-07-20 07:52:07 +02:00
pname = "nxengine-evo";
version = "2.6.4";
src = fetchFromGitHub {
owner = "nxengine";
repo = "nxengine-evo";
rev = "v${finalAttrs.version}";
hash = "sha256-krK2b1E5JUMxRoEWmb3HZMNSIHfUUGXSpyb4/Zdp+5A=";
2019-07-20 07:52:07 +02:00
};
patches = [
# Fix building by adding SDL_MIXER to include path
2019-07-20 07:52:07 +02:00
(fetchpatch {
url = "https://github.com/nxengine/nxengine-evo/commit/1890127ec4b4b5f8d6cb0fb30a41868e95659840.patch";
hash = "sha256-wlsIdN2RugOo94V3qj/AzYgrs2kf0i1Iw5zNOP8WQqI=";
2019-07-20 07:52:07 +02:00
})
# Fix buffer overflow
2019-07-20 07:52:07 +02:00
(fetchpatch {
url = "https://github.com/nxengine/nxengine-evo/commit/75b8b8e3b067fd354baa903332f2a3254d1cc017.patch";
hash = "sha256-fZVaZAOHgFoNakOR2MfsvRJjuLhbx+5id/bcN8w/WWo=";
})
# Add missing include
(fetchpatch {
url = "https://github.com/nxengine/nxengine-evo/commit/0076ebb11bcfec5dc5e2e923a50425f1a33a4133.patch";
hash = "sha256-8j3fFFw8DMljV7aAFXE+eA+vkbz1HdFTMAJmk3BRU04=";
2019-07-20 07:52:07 +02:00
})
];
nativeBuildInputs = [
SDL2
cmake
ninja
pkg-config
];
2019-07-20 07:52:07 +02:00
buildInputs = [
SDL2
SDL2_mixer
libpng
2019-07-20 07:52:07 +02:00
];
strictDeps = true;
2019-07-20 07:52:07 +02:00
# Allow finding game assets.
postPatch = ''
sed -i -e "s,/usr/share/,$out/share/," src/ResourceManager.cpp
'';
installPhase = ''
runHook preInstall
2019-07-20 07:52:07 +02:00
cd ..
mkdir -p $out/bin/ $out/share/nxengine/
install bin/* $out/bin/
'' + ''
cp -r ${finalAttrs.finalPackage.assets}/share/nxengine/data $out/share/nxengine/data
2019-07-20 07:52:07 +02:00
chmod -R a=r,a+X $out/share/nxengine/data
'' + ''
runHook postInstall
2019-07-20 07:52:07 +02:00
'';
passthru = {
assets = callPackage ./assets.nix { };
};
2019-07-20 07:52:07 +02:00
meta = {
homepage = "https://github.com/nxengine/nxengine-evo";
2019-07-20 07:52:07 +02:00
description = "A complete open-source clone/rewrite of the masterpiece jump-and-run platformer Doukutsu Monogatari (also known as Cave Story)";
2021-01-15 05:31:39 +01:00
license = with lib.licenses; [
gpl3Plus
2019-07-20 07:52:07 +02:00
];
mainProgram = "nx";
maintainers = with lib.maintainers; [ AndersonTorres ];
2021-01-15 05:31:39 +01:00
platforms = lib.platforms.linux;
2019-07-20 07:52:07 +02:00
};
})