about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2023-04-23 17:55:22 +0200
committerGitHub <noreply@github.com>2023-04-23 17:55:22 +0200
commit6ad93a05a3daf6d49a3fda36ac0b9d76d17e683e (patch)
tree35dac1613d78884bdf895d228c60c3d35c46d4b0
parenta5340ba9ff3484008c7b7633f9c4cb231ebcce42 (diff)
parent664d9fd9a252569075f21f2b7d13463466d9ae8c (diff)
Merge pull request #225807 from OPNA2608/update/alice-tools
-rw-r--r--pkgs/tools/games/alice-tools/default.nix42
1 files changed, 18 insertions, 24 deletions
diff --git a/pkgs/tools/games/alice-tools/default.nix b/pkgs/tools/games/alice-tools/default.nix
index 0aed7016feac8..07d96cbd03fa0 100644
--- a/pkgs/tools/games/alice-tools/default.nix
+++ b/pkgs/tools/games/alice-tools/default.nix
@@ -1,8 +1,8 @@
 { stdenv
 , lib
 , gitUpdater
+, testers
 , fetchFromGitHub
-, fetchpatch
 , meson
 , ninja
 , pkg-config
@@ -20,37 +20,25 @@
 
 assert withGUI -> qtbase != null && wrapQtAppsHook != null;
 
-stdenv.mkDerivation rec {
-  pname = "alice-tools";
-  version = "0.12.1";
+stdenv.mkDerivation (finalAttrs: {
+  pname = "alice-tools" + lib.optionalString withGUI "-qt${lib.versions.major qtbase.version}";
+  version = "0.13.0";
 
   src = fetchFromGitHub {
     owner = "nunuhara";
     repo = "alice-tools";
-    rev = version;
+    rev = finalAttrs.version;
     fetchSubmodules = true;
-    hash = "sha256-uXiNNneAOTDupgc+ZvaeRNbEQFJBv4ppdEc3kZeUsg8=";
+    hash = "sha256-DazWnBeI5XShkIx41GFZLP3BbE0O8T9uflvKIZUXCHo=";
   };
 
-  patches = [
-    # These two patches (one to alice-tools, one to a subproject) improve DCF & PCF parsing
-    # Remove them when version > 0.12.1
-    (fetchpatch {
-      url = "https://github.com/nunuhara/alice-tools/commit/c800e85b37998d7a47060f5da4b1782d7201a042.patch";
-      excludes = [ "subprojects/libsys4" ];
-      hash = "sha256-R5ckFHqUWHdAPkFa53UbVeLgxJg/8qGLTQWwj5YRJc4=";
-    })
-    (fetchpatch {
-      url = "https://github.com/nunuhara/libsys4/commit/cff2b826d1618fb17616cdd288ab0c50f35e8032.patch";
-      stripLen = 1;
-      extraPrefix = "subprojects/libsys4/";
-      hash = "sha256-CmetiVP2kGL+MwuE9OoEDrDFxzwWvv1TtZuq1li1uIw=";
-    })
-  ];
-
   postPatch = lib.optionalString (withGUI && lib.versionAtLeast qtbase.version "6.0") ''
+    # Use Meson's Qt6 module
     substituteInPlace src/meson.build \
       --replace qt5 qt6
+
+    # For some reason Meson uses QMake instead of pkg-config detection method for Qt6 on Darwin, which gives wrong search paths for tools
+    export PATH=${qtbase.dev}/libexec:$PATH
   '';
 
   mesonFlags = lib.optionals (withGUI && lib.versionAtLeast qtbase.version "6.0") [
@@ -93,7 +81,13 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  passthru.updateScript = gitUpdater { };
+  passthru = {
+    updateScript = gitUpdater { };
+    tests.version = testers.testVersion {
+      package = finalAttrs.finalPackage;
+      command = lib.optionalString withGUI "env QT_QPA_PLATFORM=minimal " + "${lib.getExe finalAttrs.finalPackage} --version";
+    };
+  };
 
   meta = with lib; {
     description = "Tools for extracting/editing files from AliceSoft games";
@@ -103,4 +97,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ OPNA2608 ];
     mainProgram = if withGUI then "galice" else "alice";
   };
-}
+})