From a02d25fb2aa1315b005cdcc5e93096783548330d Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 27 Apr 2025 22:50:21 +0200 Subject: [PATCH 1/2] actiona: 3.10.2 -> 3.11.1 --- pkgs/applications/misc/actiona/default.nix | 80 ++++--------------- .../misc/actiona/disable-tts.patch | 68 +++++++++++++--- .../applications/misc/actiona/fix-paths.patch | 39 --------- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 71 insertions(+), 118 deletions(-) delete mode 100644 pkgs/applications/misc/actiona/fix-paths.patch diff --git a/pkgs/applications/misc/actiona/default.nix b/pkgs/applications/misc/actiona/default.nix index 069473ce3c0f..6f858cab5a4c 100644 --- a/pkgs/applications/misc/actiona/default.nix +++ b/pkgs/applications/misc/actiona/default.nix @@ -2,104 +2,54 @@ lib, stdenv, fetchFromGitHub, + cmake, pkg-config, - wrapQtAppsHook, bluez, libnotify, - libXdmcp, - libXtst, opencv, - qtbase, - qtmultimedia, - qtscript, - qttools, - qtx11extras, - qtxmlpatterns, + qt6, # Running with TTS support causes the program to freeze for a few seconds every time at startup, # so it is disabled by default textToSpeechSupport ? false, - qtspeech, }: -let - # For some reason qtscript wants to use the same version of qtbase as itself - # This override makes it think that they are the same version - qtscript' = qtscript.overrideAttrs (oldAttrs: { - inherit (qtbase) version; - postPatch = '' - substituteInPlace .qmake.conf \ - --replace-fail ${oldAttrs.version} ${qtbase.version} - ''; - }); -in stdenv.mkDerivation (finalAttrs: { pname = "actiona"; - version = "3.10.2"; + version = "3.11.1"; src = fetchFromGitHub { owner = "Jmgr"; repo = "actiona"; rev = "v${finalAttrs.version}"; - hash = "sha256-4RKCNEniBBx0kDwdHVZOqXYeGCsH8g6SfVc8JdDV0hI="; + hash = "sha256-sJlzrrpmo2CbzChCtiyxqDtjoN58BN4Ptjm4sH83zAw="; fetchSubmodules = true; }; - patches = - [ - # Sets the proper search location for the `.so` files and the translations - ./fix-paths.patch - ] - ++ lib.optionals (!textToSpeechSupport) [ - # Removes TTS support - ./disable-tts.patch - ]; + patches = lib.optionals (!textToSpeechSupport) [ + # Removes TTS support + ./disable-tts.patch + ]; - postPatch = '' - substituteInPlace gui/src/mainwindow.cpp executer/src/executer.cpp tools/src/languages.cpp \ - --subst-var out - ''; + strictDeps = true; nativeBuildInputs = [ cmake pkg-config - wrapQtAppsHook + qt6.wrapQtAppsHook ]; buildInputs = [ bluez libnotify - libXdmcp - libXtst opencv - qtbase - qtmultimedia - qtscript' - qttools - qtx11extras - qtxmlpatterns - ] ++ lib.optionals textToSpeechSupport [ qtspeech ]; - - # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ - cmakeFlags = [ (lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true) ]; - - # udev is used by the system-actionpack - env.NIX_LDFLAGS = "-ludev"; - - installPhase = '' - runHook preInstall - - install -Dm755 {execution,actiontools,tools}/*.so -t $out/lib - install -Dm755 actions/actionpack*.so -t $out/lib/actions - install -Dm755 actiona actexec -t $out/bin - install -Dm644 translations/*.qm -t $out/share/actiona/translations - install -Dm644 $src/actiona.desktop -t $out/share/applications - install -Dm644 $src/gui/icons/actiona.png -t $out/share/icons/hicolor/48x48/apps - - runHook postInstall - ''; + qt6.qtbase + qt6.qtmultimedia + qt6.qttools + qt6.qt5compat + ] ++ lib.optionals textToSpeechSupport [ qt6.qtspeech ]; meta = { description = "Cross-platform automation tool"; diff --git a/pkgs/applications/misc/actiona/disable-tts.patch b/pkgs/applications/misc/actiona/disable-tts.patch index 977959db254c..ec36dff532a5 100644 --- a/pkgs/applications/misc/actiona/disable-tts.patch +++ b/pkgs/applications/misc/actiona/disable-tts.patch @@ -1,8 +1,50 @@ +diff --git a/actexec/CMakeLists.txt b/actexec/CMakeLists.txt +index 49d8128..e8bfa16 100644 +--- a/actexec/CMakeLists.txt ++++ b/actexec/CMakeLists.txt +@@ -40,7 +40,7 @@ endif() + + setup_target(${PROJECT}) + +-find_package(Qt6 ${ACT_MINIMUM_QT_VERSION} COMPONENTS Qml Network Widgets Core5Compat Multimedia TextToSpeech REQUIRED) ++find_package(Qt6 ${ACT_MINIMUM_QT_VERSION} COMPONENTS Qml Network Widgets Core5Compat Multimedia REQUIRED) + + target_link_directories(${PROJECT} + PRIVATE +@@ -75,7 +75,6 @@ target_link_libraries( + Qt6::Widgets + Qt6::Core5Compat + Qt6::Multimedia +- Qt6::TextToSpeech + ${LIBNOTIFY_LIBRARIES} + ) + +diff --git a/actiona/CMakeLists.txt b/actiona/CMakeLists.txt +index d03d650..222b2f9 100644 +--- a/actiona/CMakeLists.txt ++++ b/actiona/CMakeLists.txt +@@ -125,7 +125,7 @@ endif() + + setup_target(${PROJECT}) + +-find_package(Qt6 ${ACT_MINIMUM_QT_VERSION} COMPONENTS Qml Network Widgets Core5Compat Multimedia TextToSpeech REQUIRED) ++find_package(Qt6 ${ACT_MINIMUM_QT_VERSION} COMPONENTS Qml Network Widgets Core5Compat Multimedia REQUIRED) + + target_link_directories(${PROJECT} + PRIVATE +@@ -162,7 +162,6 @@ target_link_libraries( + Qt6::Widgets + Qt6::Core5Compat + Qt6::Multimedia +- Qt6::TextToSpeech + ${LIBNOTIFY_LIBRARIES} + ${LIBX11_LIBRARIES} + $<$:shlwapi> diff --git a/actions/system/CMakeLists.txt b/actions/system/CMakeLists.txt -index ca861145..3e3d3d3b 100644 +index a3019b1..6d9430c 100644 --- a/actions/system/CMakeLists.txt +++ b/actions/system/CMakeLists.txt -@@ -66,8 +66,6 @@ set(HEADERS +@@ -67,8 +67,6 @@ set(HEADERS ${HEADERS_PREFIX}/actions/playsoundinstance.hpp ${HEADERS_PREFIX}/actions/systemdefinition.hpp ${HEADERS_PREFIX}/actions/systeminstance.hpp @@ -11,27 +53,27 @@ index ca861145..3e3d3d3b 100644 ${HEADERS_PREFIX}/code/mediaplaylist.hpp ${HEADERS_PREFIX}/code/notify.hpp ${HEADERS_PREFIX}/code/process.hpp -@@ -131,7 +129,6 @@ find_package(Qt5 ${ACT_MINIMUM_QT_VERSION} COMPONENTS +@@ -140,7 +138,6 @@ find_package(Qt6 ${ACT_MINIMUM_QT_VERSION} COMPONENTS DBus Multimedia MultimediaWidgets - TextToSpeech REQUIRED) - target_include_directories(${PROJECT} -@@ -153,7 +150,6 @@ target_link_libraries(${PROJECT} - Qt5::DBus - Qt5::Multimedia - Qt5::MultimediaWidgets -- Qt5::TextToSpeech + target_link_directories(${PROJECT} +@@ -167,7 +164,6 @@ target_link_libraries(${PROJECT} + Qt6::DBus + Qt6::Multimedia + Qt6::MultimediaWidgets +- Qt6::TextToSpeech ${LIBNOTIFY_LIBRARIES} ${BLUEZ_LIBRARIES} - ${UDEV_LIBRARIES} + $<$:Bthprops> diff --git a/actions/system/src/actionpacksystem.hpp b/actions/system/src/actionpacksystem.hpp -index c5768415..27a899d6 100644 +index ea045e3..a5af35a 100644 --- a/actions/system/src/actionpacksystem.hpp +++ b/actions/system/src/actionpacksystem.hpp -@@ -31,10 +31,6 @@ +@@ -32,10 +32,6 @@ #include "actions/playsounddefinition.hpp" #include "actions/findimagedefinition.hpp" @@ -42,7 +84,7 @@ index c5768415..27a899d6 100644 #include "code/system.hpp" #include "code/mediaplaylist.hpp" #include "code/notify.hpp" -@@ -67,9 +63,6 @@ public: +@@ -64,9 +60,6 @@ public: addActionDefinition(new Actions::DetachedCommandDefinition(this)); addActionDefinition(new Actions::PlaySoundDefinition(this)); addActionDefinition(new Actions::FindImageDefinition(this)); diff --git a/pkgs/applications/misc/actiona/fix-paths.patch b/pkgs/applications/misc/actiona/fix-paths.patch deleted file mode 100644 index 1c26159bbfdb..000000000000 --- a/pkgs/applications/misc/actiona/fix-paths.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/executer/src/executer.cpp b/executer/src/executer.cpp -index da848dad..5bd7e986 100644 ---- a/executer/src/executer.cpp -+++ b/executer/src/executer.cpp -@@ -45,7 +45,7 @@ bool Executer::start(QIODevice *device, const QString &filename) - QSettings settings; - QString locale = settings.value(QStringLiteral("gui/locale"), QLocale::system().name()).toString(); - -- mActionFactory->loadActionPacks(QApplication::applicationDirPath() + QStringLiteral("/actions"), locale); -+ mActionFactory->loadActionPacks(QStringLiteral("@out@/lib/actions"), locale); - #ifndef Q_OS_WIN - if(mActionFactory->actionPackCount() == 0) - mActionFactory->loadActionPacks(QStringLiteral("actiona/actions/"), locale); -diff --git a/gui/src/mainwindow.cpp b/gui/src/mainwindow.cpp -index 6052648e..3c802d93 100644 ---- a/gui/src/mainwindow.cpp -+++ b/gui/src/mainwindow.cpp -@@ -322,7 +322,7 @@ void MainWindow::postInit() - if(mSplashScreen) - mSplashScreen->showMessage(tr("Loading actions...")); - -- mActionFactory->loadActionPacks(QApplication::applicationDirPath() + QStringLiteral("/actions"), mUsedLocale); -+ mActionFactory->loadActionPacks(QStringLiteral("@out@/lib/actions"), mUsedLocale); - #ifndef Q_OS_WIN - if(mActionFactory->actionPackCount() == 0) - mActionFactory->loadActionPacks(QStringLiteral("actiona/actions/"), mUsedLocale); -diff --git a/tools/src/languages.cpp b/tools/src/languages.cpp -index 4926936e..18e9aabb 100644 ---- a/tools/src/languages.cpp -+++ b/tools/src/languages.cpp -@@ -79,7 +79,7 @@ namespace Tools - void Languages::installTranslator(const QString &componentName, const QString &locale) - { - auto translator = new QTranslator(QCoreApplication::instance()); -- if(!translator->load(QStringLiteral("%1/translations/%2_%3").arg(QCoreApplication::applicationDirPath()).arg(componentName).arg(locale))) -+ if(!translator->load(QStringLiteral("@out@/share/actiona/translations/%1_%2").arg(componentName).arg(locale))) - { - auto path = QStringLiteral("%1/translations/%2_%3").arg(QDir::currentPath()).arg(componentName).arg(locale); - if(!translator->load(path)) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a19045092b6e..b80cff7207e2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7759,7 +7759,7 @@ with pkgs; ### DEVELOPMENT / TOOLS - actiona = libsForQt5.callPackage ../applications/misc/actiona { }; + actiona = callPackage ../applications/misc/actiona { }; inherit (callPackage ../development/tools/alloy { }) alloy5 From 826931e082aaa6c2627736fee9658cf03e5d55f5 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 27 Apr 2025 22:51:33 +0200 Subject: [PATCH 2/2] actiona: move to pkgs/by-name --- .../{applications/misc => by-name/ac}/actiona/disable-tts.patch | 0 .../misc/actiona/default.nix => by-name/ac/actiona/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 2 deletions(-) rename pkgs/{applications/misc => by-name/ac}/actiona/disable-tts.patch (100%) rename pkgs/{applications/misc/actiona/default.nix => by-name/ac/actiona/package.nix} (100%) diff --git a/pkgs/applications/misc/actiona/disable-tts.patch b/pkgs/by-name/ac/actiona/disable-tts.patch similarity index 100% rename from pkgs/applications/misc/actiona/disable-tts.patch rename to pkgs/by-name/ac/actiona/disable-tts.patch diff --git a/pkgs/applications/misc/actiona/default.nix b/pkgs/by-name/ac/actiona/package.nix similarity index 100% rename from pkgs/applications/misc/actiona/default.nix rename to pkgs/by-name/ac/actiona/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b80cff7207e2..48dacdcea17e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7759,8 +7759,6 @@ with pkgs; ### DEVELOPMENT / TOOLS - actiona = callPackage ../applications/misc/actiona { }; - inherit (callPackage ../development/tools/alloy { }) alloy5 alloy6