python312Packages.fnllm: 0.0.11 -> 0.0.12 (#364582)
[NixPkgs.git] / pkgs / tools / games / pokefinder / default.nix
blobed9d62db08ce21e7da1228bfabde4f87ca87cc1d
2   lib,
3   stdenv,
4   copyDesktopItems,
5   makeDesktopItem,
6   fetchFromGitHub,
7   fetchpatch,
8   cmake,
9   python3,
10   qtbase,
11   qttools,
12   qtwayland,
13   imagemagick,
14   wrapQtAppsHook,
15   gitUpdater,
18 stdenv.mkDerivation rec {
19   pname = "pokefinder";
20   version = "4.2.0";
22   src = fetchFromGitHub {
23     owner = "Admiral-Fish";
24     repo = "PokeFinder";
25     rev = "v${version}";
26     sha256 = "R0FrRRQRe0tWrHUoU4PPwOgIsltUEImEMTXL79ISfRE=";
27     fetchSubmodules = true;
28   };
30   patches = [
31     ./set-desktop-file-name.patch
32     # fix compatibility with our libstdc++
33     # https://github.com/Admiral-Fish/PokeFinder/pull/392
34     (fetchpatch {
35       url = "https://github.com/Admiral-Fish/PokeFinder/commit/2cb1b049cabdf0d1b32c8cf29bf6c9d9c5c55cb0.patch";
36       hash = "sha256-F/w7ydsZ5tZParMWi33W3Tv8A6LLiJt4dAoCrs40DIo=";
37     })
38   ];
40   postPatch = ''
41     patchShebangs Source/Core/Resources/
42   '';
44   installPhase =
45     ''
46       runHook preInstall
47     ''
48     + lib.optionalString (stdenv.hostPlatform.isDarwin) ''
49       mkdir -p $out/Applications
50       cp -R Source/PokeFinder.app $out/Applications
51     ''
52     + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
53       install -D Source/PokeFinder $out/bin/PokeFinder
54       mkdir -p $out/share/pixmaps
55       convert "$src/Source/Form/Images/pokefinder.ico[-1]" $out/share/pixmaps/pokefinder.png
56     ''
57     + ''
58       runHook postInstall
59     '';
61   nativeBuildInputs =
62     [
63       cmake
64       wrapQtAppsHook
65       python3
66     ]
67     ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
68       copyDesktopItems
69       imagemagick
70     ];
72   desktopItems = [
73     (makeDesktopItem {
74       name = "pokefinder";
75       exec = "PokeFinder";
76       icon = "pokefinder";
77       comment = "Cross platform Pokémon RNG tool";
78       desktopName = "PokéFinder";
79       categories = [ "Utility" ];
80     })
81   ];
83   buildInputs = [
84     qtbase
85     qttools
86   ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
88   passthru.updateScript = gitUpdater {
89     rev-prefix = "v";
90   };
92   meta = with lib; {
93     homepage = "https://github.com/Admiral-Fish/PokeFinder";
94     description = "Cross platform Pokémon RNG tool";
95     mainProgram = "PokeFinder";
96     license = licenses.gpl3Only;
97     platforms = platforms.all;
98     maintainers = with maintainers; [ leo60228 ];
99   };