summary refs log tree commit diff
path: root/pkgs/tools/games/pokefinder/default.nix
blob: fe2c8bdf5608d679dd1b42cba0e1bb0684c9bad8 (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, qtbase
, qttools
, qtwayland
, wrapQtAppsHook
, gitUpdater
}:

stdenv.mkDerivation rec {
  pname = "pokefinder";
  version = "4.0.1";

  src = fetchFromGitHub {
    owner = "Admiral-Fish";
    repo = "PokeFinder";
    rev = "v${version}";
    sha256 = "j7xgjNF8NWLFVPNItWcFM5WL8yPxgHxVX00x7lt45WI=";
    fetchSubmodules = true;
  };

  patches = [ ./cstddef.patch ];

  postPatch = ''
    patchShebangs Source/Core/Resources/
  '';

  installPhase = lib.optionalString (!stdenv.isDarwin) ''
    install -D Source/Forms/PokeFinder $out/bin/PokeFinder
  '' + lib.optionalString stdenv.isDarwin ''
    mkdir -p $out/Applications
    cp -R Source/Forms/PokeFinder.app $out/Applications
  '';

  nativeBuildInputs = [ cmake wrapQtAppsHook ];

  buildInputs = [ qtbase qttools ]
    ++ lib.optionals stdenv.isLinux [ qtwayland ];

  passthru.updateScript = gitUpdater { };

  meta = with lib; {
    homepage = "https://github.com/Admiral-Fish/PokeFinder";
    description = "Cross platform Pokémon RNG tool";
    license = licenses.gpl3Only;
    platforms = platforms.all;
    maintainers = with maintainers; [ leo60228 ];
  };
}