2021-06-06 07:54:09 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub
|
2022-08-21 13:32:41 +00:00
|
|
|
, gettext, glibcLocalesUtf8, libpng, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, zlib
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
, gitUpdater
|
2021-06-06 07:54:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fheroes2";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.9.21";
|
2021-06-06 07:54:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ihhub";
|
|
|
|
repo = "fheroes2";
|
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-b4OAuwMgVgZUdLWJp6Rv/+1X+rPcG7piIBk8SlEXoUY=";
|
2021-06-06 07:54:09 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
buildInputs = [ gettext glibcLocalesUtf8 libpng SDL2 SDL2_image SDL2_mixer SDL2_ttf zlib ];
|
2021-06-06 07:54:09 +00:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"FHEROES2_STRICT_COMPILATION=1"
|
2022-08-21 13:32:41 +00:00
|
|
|
"FHEROES2_DATA=\"${placeholder "out"}/share/fheroes2\""
|
2021-06-06 07:54:09 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
postBuild = ''
|
|
|
|
# Pick guaranteed to be present UTF-8 locale.
|
|
|
|
# Otherwise `iconv` calls fail to produce valid translations.
|
|
|
|
LANG=en_US.UTF_8 make -C files/lang
|
|
|
|
'';
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 $PWD/src/dist/fheroes2 $out/bin/fheroes2
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
install -Dm644 -t $out/share/fheroes2/files/lang $PWD/files/lang/*.mo
|
|
|
|
install -Dm644 -t $out/share/fheroes2/files/data $PWD/files/data/resurrection.h2d
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
passthru = {
|
2022-10-30 15:09:59 +00:00
|
|
|
updateScript = gitUpdater {
|
|
|
|
url = "https://github.com/ihhub/fheroes2.git";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ihhub/fheroes2";
|
|
|
|
description = "Free implementation of Heroes of Might and Magic II game engine";
|
|
|
|
longDescription = ''
|
|
|
|
In order to play this game, an original game data is required.
|
|
|
|
Please refer to README of the project for instructions.
|
|
|
|
On linux, the data can be placed in ~/.local/share/fheroes2 folder.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = [ maintainers.karolchmist ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|