nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 93 lines 2.2 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 imagemagick, 6 gettext, 7 glibcLocalesUtf8, 8 libpng, 9 SDL2, 10 SDL2_image, 11 SDL2_mixer, 12 SDL2_ttf, 13 zlib, 14 libiconv, 15 16 gitUpdater, 17}: 18 19stdenv.mkDerivation (finalAttrs: { 20 pname = "fheroes2"; 21 version = "1.1.13"; 22 23 src = fetchFromGitHub { 24 owner = "ihhub"; 25 repo = "fheroes2"; 26 rev = finalAttrs.version; 27 hash = "sha256-ct58Rkc6ORXldINQZVzMuObMl0BMk6QG88oU4tT0WcE="; 28 }; 29 30 nativeBuildInputs = [ imagemagick ]; 31 32 buildInputs = [ 33 gettext 34 glibcLocalesUtf8 35 libpng 36 SDL2 37 SDL2_image 38 SDL2_mixer 39 SDL2_ttf 40 zlib 41 ] 42 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; 43 44 makeFlags = [ 45 "FHEROES2_DATA=\"${placeholder "out"}/share/fheroes2\"" 46 ]; 47 48 enableParallelBuilding = true; 49 50 postBuild = '' 51 # Pick guaranteed to be present UTF-8 locale. 52 # Otherwise `iconv` calls fail to produce valid translations. 53 LANG=en_US.UTF_8 make -C files/lang 54 ''; 55 56 installPhase = '' 57 runHook preInstall 58 59 install -Dm755 $PWD/src/dist/fheroes2/fheroes2 $out/bin/fheroes2 60 61 install -Dm644 -t $out/share/fheroes2/files/lang $PWD/files/lang/*.mo 62 install -Dm644 -t $out/share/fheroes2/files/data $PWD/files/data/resurrection.h2d 63 64 install -Dm644 -t $out/share/applications $PWD/script/packaging/common/fheroes2.desktop 65 66 for size in 16 24 32 48 64 128; do 67 mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps 68 convert -resize "$size"x"$size" $PWD/src/resources/fheroes2.png $out/share/icons/hicolor/"$size"x"$size"/apps/fheroes2.png 69 done; 70 71 runHook postInstall 72 ''; 73 74 passthru = { 75 updateScript = gitUpdater { 76 url = "https://github.com/ihhub/fheroes2.git"; 77 }; 78 }; 79 80 meta = { 81 homepage = "https://github.com/ihhub/fheroes2"; 82 description = "Free implementation of Heroes of Might and Magic II game engine"; 83 mainProgram = "fheroes2"; 84 longDescription = '' 85 In order to play this game, an original game data is required. 86 Please refer to README of the project for instructions. 87 On linux, the data can be placed in ~/.local/share/fheroes2 folder. 88 ''; 89 license = lib.licenses.gpl2Plus; 90 maintainers = [ ]; 91 platforms = lib.platforms.unix; 92 }; 93})