nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 qtbase,
6 qmake,
7 qttools,
8 wrapQtAppsHook,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "cubiomes-viewer";
13 version = "4.1.2";
14
15 src = fetchFromGitHub {
16 owner = "Cubitect";
17 repo = pname;
18 rev = version;
19 hash = "sha256-izDKS08LNT2rV5rIxlWRHevJAKEbAVzekjfZy0Oen1I=";
20 fetchSubmodules = true;
21 };
22
23 postPatch = ''
24 substituteInPlace cubiomes-viewer.pro \
25 --replace '$$[QT_INSTALL_BINS]/lupdate' lupdate \
26 --replace '$$[QT_INSTALL_BINS]/lrelease' lrelease
27 '';
28
29 buildInputs = [
30 qtbase
31 ];
32
33 nativeBuildInputs = [
34 qmake
35 qttools
36 wrapQtAppsHook
37 ];
38
39 preBuild = ''
40 # QMAKE_PRE_LINK is not executed (I dont know why)
41 make -C ./cubiomes libcubiomes CFLAGS="-DSTRUCT_CONFIG_OVERRIDE=1" all
42 '';
43
44 installPhase = ''
45 runHook preInstall
46
47 mkdir -p $out/bin
48 cp cubiomes-viewer $out/bin
49
50 mkdir -p $out/share/{pixmaps,applications}
51 cp rc/icons/map.png $out/share/pixmaps/com.github.cubitect.cubiomes-viewer.png
52 cp etc/com.github.cubitect.cubiomes-viewer.desktop $out/share/applications
53
54 runHook postInstall
55 '';
56
57 meta = with lib; {
58 broken = stdenv.hostPlatform.isDarwin;
59 homepage = "https://github.com/Cubitect/cubiomes-viewer";
60 description = "Graphical Minecraft seed finder and map viewer";
61 mainProgram = "cubiomes-viewer";
62 longDescription = ''
63 Cubiomes Viewer provides a graphical interface for the efficient and flexible seed-finding
64 utilities provided by cubiomes and a map viewer for the Minecraft biomes and structure generation.
65 '';
66 platforms = platforms.all;
67 license = licenses.gpl3Plus;
68 maintainers = with maintainers; [ hqurve ];
69 };
70}