1 { stdenv, lib, fetchFromGitHub, imagemagick
2 , gettext, glibcLocalesUtf8, libpng, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, zlib
8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
16 hash = "sha256-FSfA2gjJZWAbl2nTJwkAhWcJghbw5ulftU+6QBqljxY=";
19 nativeBuildInputs = [ imagemagick ];
21 buildInputs = [ gettext glibcLocalesUtf8 libpng SDL2 SDL2_image SDL2_mixer SDL2_ttf zlib ]
22 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
25 "FHEROES2_STRICT_COMPILATION=1"
26 "FHEROES2_DATA=\"${placeholder "out"}/share/fheroes2\""
29 enableParallelBuilding = true;
32 # Pick guaranteed to be present UTF-8 locale.
33 # Otherwise `iconv` calls fail to produce valid translations.
34 LANG=en_US.UTF_8 make -C files/lang
40 install -Dm755 $PWD/src/dist/fheroes2 $out/bin/fheroes2
42 install -Dm644 -t $out/share/fheroes2/files/lang $PWD/files/lang/*.mo
43 install -Dm644 -t $out/share/fheroes2/files/data $PWD/files/data/resurrection.h2d
45 install -Dm644 -t $out/share/applications $PWD/script/packaging/common/fheroes2.desktop
47 for size in 16 24 32 48 64 128; do
48 mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
49 convert -resize "$size"x"$size" $PWD/src/resources/fheroes2.png $out/share/icons/hicolor/"$size"x"$size"/apps/fheroes2.png
56 updateScript = gitUpdater {
57 url = "https://github.com/ihhub/fheroes2.git";
62 homepage = "https://github.com/ihhub/fheroes2";
63 description = "Free implementation of Heroes of Might and Magic II game engine";
64 mainProgram = "fheroes2";
66 In order to play this game, an original game data is required.
67 Please refer to README of the project for instructions.
68 On linux, the data can be placed in ~/.local/share/fheroes2 folder.
70 license = licenses.gpl2Plus;
71 maintainers = [ maintainers.karolchmist ];
72 platforms = platforms.unix;