2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-08-04 22:07:22 +00:00
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2022-12-02 08:20:57 +00:00
|
|
|
, fetchFromGitHub
|
2024-06-20 14:57:18 +00:00
|
|
|
, fetchpatch
|
2022-12-02 08:20:57 +00:00
|
|
|
, cmake
|
2024-05-15 15:35:15 +00:00
|
|
|
, python3
|
2022-12-02 08:20:57 +00:00
|
|
|
, qtbase
|
|
|
|
, qttools
|
2023-03-08 16:32:21 +00:00
|
|
|
, qtwayland
|
2023-08-04 22:07:22 +00:00
|
|
|
, imagemagick
|
2022-12-02 08:20:57 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, gitUpdater
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pokefinder";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "4.2.0";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Admiral-Fish";
|
|
|
|
repo = "PokeFinder";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
sha256 = "R0FrRRQRe0tWrHUoU4PPwOgIsltUEImEMTXL79ISfRE=";
|
2022-12-02 08:20:57 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
patches = [
|
|
|
|
./set-desktop-file-name.patch
|
|
|
|
# fix compatibility with our libstdc++
|
|
|
|
# https://github.com/Admiral-Fish/PokeFinder/pull/392
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Admiral-Fish/PokeFinder/commit/2cb1b049cabdf0d1b32c8cf29bf6c9d9c5c55cb0.patch";
|
|
|
|
hash = "sha256-F/w7ydsZ5tZParMWi33W3Tv8A6LLiJt4dAoCrs40DIo=";
|
|
|
|
})
|
|
|
|
];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs Source/Core/Resources/
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString (stdenv.hostPlatform.isDarwin) ''
|
2023-02-02 18:25:31 +00:00
|
|
|
mkdir -p $out/Applications
|
2023-08-04 22:07:22 +00:00
|
|
|
cp -R Source/PokeFinder.app $out/Applications
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
2023-08-04 22:07:22 +00:00
|
|
|
install -D Source/PokeFinder $out/bin/PokeFinder
|
|
|
|
mkdir -p $out/share/pixmaps
|
|
|
|
convert "$src/Source/Form/Images/pokefinder.ico[-1]" $out/share/pixmaps/pokefinder.png
|
|
|
|
'' + ''
|
|
|
|
runHook postInstall
|
2022-12-02 08:20:57 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
nativeBuildInputs = [ cmake wrapQtAppsHook python3 ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ copyDesktopItems imagemagick ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "pokefinder";
|
|
|
|
exec = "PokeFinder";
|
|
|
|
icon = "pokefinder";
|
|
|
|
comment = "Cross platform Pokémon RNG tool";
|
|
|
|
desktopName = "PokéFinder";
|
|
|
|
categories = [ "Utility" ];
|
|
|
|
})
|
|
|
|
];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
buildInputs = [ qtbase qttools ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/Admiral-Fish/PokeFinder";
|
|
|
|
description = "Cross platform Pokémon RNG tool";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "PokeFinder";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ leo60228 ];
|
|
|
|
};
|
|
|
|
}
|