summary refs log tree commit diff
path: root/pkgs/tools/games
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2023-07-19 00:12:20 +0200
committerGitHub <noreply@github.com>2023-07-19 00:12:20 +0200
commit1331644a5e56b34df77a4cfdf099a644adf211dc (patch)
tree6f307ee77fe044b3be4a9c6fea9ede62c2bc8a50 /pkgs/tools/games
parent369fbaae615ca2c51a8e3ed7b030099ed7906540 (diff)
parent0acafaf34a0165da042a0cc7cfc2d1b77cdda773 (diff)
downloadnixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar.gz
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar.bz2
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar.lz
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar.xz
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.tar.zst
nixpkgs-1331644a5e56b34df77a4cfdf099a644adf211dc.zip
Merge pull request #242569 from leo60228/pokefinder-4.1.1
pokefinder: 4.0.1 -> 4.1.1
Diffstat (limited to 'pkgs/tools/games')
-rw-r--r--pkgs/tools/games/pokefinder/cstddef.patch12
-rw-r--r--pkgs/tools/games/pokefinder/default.nix47
-rw-r--r--pkgs/tools/games/pokefinder/set-desktop-file-name.patch12
3 files changed, 50 insertions, 21 deletions
diff --git a/pkgs/tools/games/pokefinder/cstddef.patch b/pkgs/tools/games/pokefinder/cstddef.patch
deleted file mode 100644
index c74340b0d6d..00000000000
--- a/pkgs/tools/games/pokefinder/cstddef.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Source/Core/Util/EncounterSlot.cpp b/Source/Core/Util/EncounterSlot.cpp
-index adddbdab..71c98e83 100644
---- a/Source/Core/Util/EncounterSlot.cpp
-+++ b/Source/Core/Util/EncounterSlot.cpp
-@@ -20,6 +20,7 @@
- #include "EncounterSlot.hpp"
- #include <Core/Enum/Encounter.hpp>
- #include <array>
-+#include <cstddef>
- 
- namespace
- {
diff --git a/pkgs/tools/games/pokefinder/default.nix b/pkgs/tools/games/pokefinder/default.nix
index fe2c8bdf560..1ddde132d1a 100644
--- a/pkgs/tools/games/pokefinder/default.nix
+++ b/pkgs/tools/games/pokefinder/default.nix
@@ -1,45 +1,74 @@
 { lib
 , stdenv
+, copyDesktopItems
+, makeDesktopItem
 , fetchFromGitHub
 , cmake
 , qtbase
 , qttools
 , qtwayland
+, imagemagick
 , wrapQtAppsHook
 , gitUpdater
 }:
 
 stdenv.mkDerivation rec {
   pname = "pokefinder";
-  version = "4.0.1";
+  version = "4.1.1";
 
   src = fetchFromGitHub {
     owner = "Admiral-Fish";
     repo = "PokeFinder";
     rev = "v${version}";
-    sha256 = "j7xgjNF8NWLFVPNItWcFM5WL8yPxgHxVX00x7lt45WI=";
+    sha256 = "fYBeWc9eYLbj4+ku1jwaO5ISL8a7WJnBHJ4qz4W8RHA=";
     fetchSubmodules = true;
+    # 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
+    '';
   };
 
-  patches = [ ./cstddef.patch ];
+  patches = [ ./set-desktop-file-name.patch ];
 
   postPatch = ''
     patchShebangs Source/Core/Resources/
   '';
 
-  installPhase = lib.optionalString (!stdenv.isDarwin) ''
-    install -D Source/Forms/PokeFinder $out/bin/PokeFinder
-  '' + lib.optionalString stdenv.isDarwin ''
+  installPhase = ''
+    runHook preInstall
+  '' + lib.optionalString (stdenv.isDarwin) ''
     mkdir -p $out/Applications
-    cp -R Source/Forms/PokeFinder.app $out/Applications
+    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
   '';
 
-  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+  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" ];
+    })
+  ];
 
   buildInputs = [ qtbase qttools ]
     ++ lib.optionals stdenv.isLinux [ qtwayland ];
 
-  passthru.updateScript = gitUpdater { };
+  passthru.updateScript = gitUpdater {
+    rev-prefix = "v";
+  };
 
   meta = with lib; {
     homepage = "https://github.com/Admiral-Fish/PokeFinder";
diff --git a/pkgs/tools/games/pokefinder/set-desktop-file-name.patch b/pkgs/tools/games/pokefinder/set-desktop-file-name.patch
new file mode 100644
index 00000000000..e22046f6fd0
--- /dev/null
+++ b/pkgs/tools/games/pokefinder/set-desktop-file-name.patch
@@ -0,0 +1,12 @@
+diff --git a/Source/main.cpp b/Source/main.cpp
+index 3e58a381..2e7e4a86 100644
+--- a/Source/main.cpp
++++ b/Source/main.cpp
+@@ -69,6 +69,7 @@ int main(int argc, char *argv[])
+ {
+     QApplication a(argc, argv);
+     a.setApplicationName("PokeFinder");
++    a.setDesktopFileName("pokefinder");
+     a.setOrganizationName("PokeFinder Team");
+ 
+     Q_INIT_RESOURCE(resources);