18 , wrapQtAppsHook ? null
21 assert withGUI -> qtbase != null && wrapQtAppsHook != null;
23 stdenv.mkDerivation (finalAttrs: {
24 pname = "alice-tools" + lib.optionalString withGUI "-qt${lib.versions.major qtbase.version}";
27 src = fetchFromGitHub {
30 rev = finalAttrs.version;
31 fetchSubmodules = true;
32 hash = "sha256-DazWnBeI5XShkIx41GFZLP3BbE0O8T9uflvKIZUXCHo=";
35 postPatch = lib.optionalString (withGUI && lib.versionAtLeast qtbase.version "6.0") ''
36 # Use Meson's Qt6 module
37 substituteInPlace src/meson.build \
40 # For some reason Meson uses QMake instead of pkg-config detection method for Qt6 on Darwin, which gives wrong search paths for tools
41 export PATH=${qtbase.dev}/libexec:$PATH
44 mesonFlags = lib.optionals (withGUI && lib.versionAtLeast qtbase.version "6.0") [
45 # Qt6 requires at least C++17, project uses compiler's default, default too old on Darwin & aarch64-linux
55 ] ++ lib.optionals withGUI [
65 ] ++ lib.optionals withGUI [
69 dontWrapQtApps = true;
71 # Default install step only installs a static library of a build dependency
75 install -Dm755 src/alice $out/bin/alice
76 '' + lib.optionalString withGUI ''
77 install -Dm755 src/galice $out/bin/galice
78 wrapQtApp $out/bin/galice
85 updateScript = gitUpdater { };
86 tests.version = testers.testVersion {
87 package = finalAttrs.finalPackage;
88 command = lib.optionalString withGUI "env QT_QPA_PLATFORM=minimal " + "${lib.getExe finalAttrs.finalPackage} --version";
93 description = "Tools for extracting/editing files from AliceSoft games";
94 homepage = "https://github.com/nunuhara/alice-tools";
95 license = licenses.gpl2Plus;
96 platforms = platforms.all;
97 maintainers = with maintainers; [ OPNA2608 ];
98 mainProgram = if withGUI then "galice" else "alice";