summary refs log tree commit diff
path: root/pkgs/applications/misc/cubiomes-viewer/default.nix
blob: 42355054ee881f84d64917743716476c7582004e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{ lib
, stdenv
, fetchFromGitHub
, qtbase
, qmake
, wrapQtAppsHook
, copyDesktopItems
, makeDesktopItem
}:

stdenv.mkDerivation rec {
  pname = "cubiomes-viewer";
  version = "2.1.1";

  src = fetchFromGitHub {
    owner = "Cubitect";
    repo = pname;
    rev = version;
    sha256 = "sha256-cIA6W82XEeW0k9WNygZ/KVFZE31QThpkV4OazVEvmtw=";
    fetchSubmodules = true;
  };

  buildInputs = [
    qtbase
  ];

  nativeBuildInputs = [
    qmake
    wrapQtAppsHook
    copyDesktopItems
  ];

  desktopItems = [ (makeDesktopItem {
    name = pname;
    desktopName = "Cubiomes Viewer";
    exec = pname;
    icon = pname;
    categories = [ "Game" ];
    comment = meta.description;
  }) ];

  preBuild = ''
    # QMAKE_PRE_LINK is not executed (I dont know why)
    make -C ./cubiomes libcubiomes CFLAGS="-DSTRUCT_CONFIG_OVERRIDE=1" all
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp cubiomes-viewer $out/bin

    mkdir -p $out/share/pixmaps
    cp rc/icons/map.png $out/share/pixmaps/cubiomes-viewer.png

    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/Cubitect/cubiomes-viewer";
    description = "A graphical Minecraft seed finder and map viewer";
    longDescription = ''
      Cubiomes Viewer provides a graphical interface for the efficient and flexible seed-finding
      utilities provided by cubiomes and a map viewer for the Minecraft biomes and structure generation.
    '';
    platforms = platforms.all;
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ hqurve ];
  };
}