Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / ivan / default.nix
blob21f071af379bb20500f5d82fcb454dcbe9e2e975
1 { lib, stdenv, fetchFromGitHub, cmake, pkg-config, SDL2, SDL2_mixer, alsa-lib, libpng
2 , pcre, makeDesktopItem }:
4 stdenv.mkDerivation rec {
6   pname = "ivan";
7   version = "059";
9   src = fetchFromGitHub {
10     owner = "Attnam";
11     repo = "ivan";
12     rev = "v${version}";
13     sha256 = "sha256-5Ijy28LLx1TGnZE6ZNQXPYfvW2KprF+91fKx2MzLEms=";
14   };
16   nativeBuildInputs = [ cmake pkg-config ];
18   buildInputs = [ SDL2 SDL2_mixer alsa-lib libpng pcre ];
20   hardeningDisable = ["all"];
22   # Enable wizard mode
23   cmakeFlags = ["-DCMAKE_CXX_FLAGS=-DWIZARD"];
25   # Help CMake find SDL_mixer.h
26   env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_mixer}/include/SDL2";
28   # Create "ivan.desktop" file
29   ivanDesktop = makeDesktopItem {
30     name = pname;
31     exec = pname;
32     icon = "ivan.png";
33     desktopName = "IVAN";
34     genericName = pname;
35     categories = [ "Game" "AdventureGame" "RolePlaying" ];
36     comment = meta.description;
37   };
39   # Create appropriate directories. Copy icons and desktop item to these directories.
40   postInstall = ''
41     mkdir -p $out/share/applications
42     mkdir -p $out/share/icons/hicolor/16x16/apps
43     mkdir -p $out/share/icons/hicolor/32x32/apps
44     mkdir -p $out/share/icons/hicolor/128x128/apps
45     mkdir -p $out/share/icons/hicolor/256x256/apps
46     mkdir -p $out/share/icons/hicolor/512x512/apps
47     cp $src/Graphics/icons/shadowless.iconset/icon_16x16.png $out/share/icons/hicolor/16x16/apps/ivan.png
48     cp $src/Graphics/icons/shadowless.iconset/icon_32x32.png $out/share/icons/hicolor/32x32/apps/ivan.png
49     cp $src/Graphics/icons/shadowless.iconset/icon_128x128.png $out/share/icons/hicolor/128x128/apps/ivan.png
50     cp $src/Graphics/icons/shadowless.iconset/icon_256x256.png $out/share/icons/hicolor/256x256/apps/ivan.png
51     cp $src/Graphics/icons/shadowless.iconset/icon_512x512.png $out/share/icons/hicolor/512x512/apps/ivan.png
52     cp ${ivanDesktop}/share/applications/* $out/share/applications
53   '';
55   meta = with lib; {
56     description = "Graphical roguelike game";
57     longDescription = ''
58       Iter Vehemens ad Necem (IVAN) is a graphical roguelike game, which currently
59       runs in Windows, DOS, Linux, and OS X. It features advanced bodypart and
60       material handling, multi-colored lighting and, above all, deep gameplay.
62       This is a fan continuation of IVAN by members of Attnam.com
63     '';
64     homepage = "https://attnam.com/";
65     license = licenses.gpl2Plus;
66     platforms = platforms.linux;
67     maintainers = with maintainers; [];
68   };