From d92633226f5c4aa8f5c8e875e664cef54b2849f9 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 11 Apr 2023 22:07:58 +0200 Subject: [PATCH 1/3] alice-tools,alice-tools-qt5,alice-tools-qt6: 0.12.1 -> 0.13.0 And reflect Qt version in pname. --- pkgs/tools/games/alice-tools/default.nix | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/games/alice-tools/default.nix b/pkgs/tools/games/alice-tools/default.nix index 0aed7016feac..d5493dc63aa1 100644 --- a/pkgs/tools/games/alice-tools/default.nix +++ b/pkgs/tools/games/alice-tools/default.nix @@ -2,7 +2,6 @@ , lib , gitUpdater , fetchFromGitHub -, fetchpatch , meson , ninja , pkg-config @@ -21,33 +20,17 @@ assert withGUI -> qtbase != null && wrapQtAppsHook != null; stdenv.mkDerivation rec { - pname = "alice-tools"; - version = "0.12.1"; + 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; 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") '' substituteInPlace src/meson.build \ --replace qt5 qt6 From 82c8852b6f60e838d50dcd1b1add6d6aa61e8a6e Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 11 Apr 2023 22:27:05 +0200 Subject: [PATCH 2/3] alice-tools,alice-tools-qt5,alice-tools-qt6: Add version test --- pkgs/tools/games/alice-tools/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/games/alice-tools/default.nix b/pkgs/tools/games/alice-tools/default.nix index d5493dc63aa1..d10ce8e65ab6 100644 --- a/pkgs/tools/games/alice-tools/default.nix +++ b/pkgs/tools/games/alice-tools/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , gitUpdater +, testers , fetchFromGitHub , meson , ninja @@ -19,14 +20,14 @@ assert withGUI -> qtbase != null && wrapQtAppsHook != null; -stdenv.mkDerivation rec { +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-DazWnBeI5XShkIx41GFZLP3BbE0O8T9uflvKIZUXCHo="; }; @@ -76,7 +77,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"; @@ -86,4 +93,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ OPNA2608 ]; mainProgram = if withGUI then "galice" else "alice"; }; -} +}) From 664d9fd9a252569075f21f2b7d13463466d9ae8c Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 12 Apr 2023 12:29:07 +0200 Subject: [PATCH 3/3] alice-tools-qt6: Fix Qt tool detection on Darwin Meson seems to default to QMake there, which gives search paths into qtbase.out instead of qtbase.dev --- pkgs/tools/games/alice-tools/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/games/alice-tools/default.nix b/pkgs/tools/games/alice-tools/default.nix index d10ce8e65ab6..07d96cbd03fa 100644 --- a/pkgs/tools/games/alice-tools/default.nix +++ b/pkgs/tools/games/alice-tools/default.nix @@ -33,8 +33,12 @@ stdenv.mkDerivation (finalAttrs: { }; 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") [