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
|
|
|
|
, cmake
|
|
|
|
, 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";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "4.1.1";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Admiral-Fish";
|
|
|
|
repo = "PokeFinder";
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
sha256 = "fYBeWc9eYLbj4+ku1jwaO5ISL8a7WJnBHJ4qz4W8RHA=";
|
2022-12-02 08:20:57 +00:00
|
|
|
fetchSubmodules = true;
|
2023-08-04 22:07:22 +00:00
|
|
|
# the repo has identical cmake and CMake folders, causing issues on macOS
|
|
|
|
postFetch = if stdenv.isDarwin then ''
|
|
|
|
mv $out/cmake $out/cmake.tmp
|
|
|
|
mv $out/cmake.tmp $out/CMake
|
|
|
|
'' else ''
|
|
|
|
rm -rf $out/cmake
|
|
|
|
'';
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
patches = [ ./set-desktop-file-name.patch ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs Source/Core/Resources/
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
'' + lib.optionalString (stdenv.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
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ cmake wrapQtAppsHook ] ++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems imagemagick ];
|
|
|
|
|
|
|
|
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 ]
|
|
|
|
++ lib.optionals stdenv.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";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ leo60228 ];
|
|
|
|
};
|
|
|
|
}
|