Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could NOT find qtpaths executable #8

Open
milahu opened this issue Jan 30, 2022 · 4 comments
Open

Could NOT find qtpaths executable #8

milahu opened this issue Jan 30, 2022 · 4 comments

Comments

@milahu
Copy link

milahu commented Jan 30, 2022

qt6ct/CMakeLists.txt

Lines 42 to 43 in e41923d

get_filename_component(QT_QTPATHS_EXECUTABLE ${QT_LRELEASE_EXECUTABLE} DIRECTORY)
set(QT_QTPATHS_EXECUTABLE ${QT_QTPATHS_EXECUTABLE}/qtpaths)

problem is:

  • lrelease is part of the qttools module
  • qtpaths is part of the qtbase module

so, on nixos, these have different prefixes

fixed by using the commented code blocks

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,14 +24,14 @@
 
 find_package(Qt6 COMPONENTS BuildInternals Widgets Concurrent LinguistTools REQUIRED)
 
-#get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
+get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
 get_target_property(QT_LRELEASE_EXECUTABLE Qt6::lrelease IMPORTED_LOCATION)
 
-#if(QT_QTPATHS_EXECUTABLE)
-#    message(STATUS "Found qtpaths executable: " ${QT_QTPATHS_EXECUTABLE})
-#else()
-#    message(FATAL_ERROR "Could NOT find qtpaths executable")
-#endif()
+if(QT_QTPATHS_EXECUTABLE)
+    message(STATUS "Found qtpaths executable: " ${QT_QTPATHS_EXECUTABLE})
+else()
+    message(FATAL_ERROR "Could NOT find qtpaths executable")
+endif()
 
 if(QT_LRELEASE_EXECUTABLE)
     message(STATUS "Found lrelease executable: " ${QT_LRELEASE_EXECUTABLE})
@@ -39,15 +39,6 @@
     message(FATAL_ERROR "Could NOT find lrelease executable")
 endif()
 
-get_filename_component(QT_QTPATHS_EXECUTABLE ${QT_LRELEASE_EXECUTABLE} DIRECTORY)
-set(QT_QTPATHS_EXECUTABLE ${QT_QTPATHS_EXECUTABLE}/qtpaths)
-
-if(EXISTS ${QT_QTPATHS_EXECUTABLE})
-    message(STATUS "Found qtpaths executable: " ${QT_QTPATHS_EXECUTABLE})
-else()
-    message(FATAL_ERROR "Could NOT find qtpaths executable")
-endif()
-
 #execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
 message(STATUS "Plugin path: " ${PLUGINDIR})

fixed by using the commented code blocks

is there a good reason this code is commented?
maybe use the current code as fallback?

@spikespaz
Copy link

Is this the reason that it can't find my kvantum theme? All I have is "Fusion" and "Windows" when I try to configure via the GUI.

@spikespaz
Copy link

Obviously this needs to be called with pkgs.qt6.callPackage and not the other two.
It compiles perfectly fine but doesn't find the Kvantum (or any other) themes.

{
  stdenv,
  lib,
  fetchFromGitHub,
  wrapQtAppsHook,
  qtbase,
  qtsvg,
  qttools,
  qmake,
  qtwayland,
}:
stdenv.mkDerivation rec {
  pname = "qt6ct";
  version = "0.7";

  src = fetchFromGitHub {
    owner = "trialuser02";
    repo = "qt6ct";
    rev = version;
    sha256 = "sha256-7WuHdb7gmdC/YqrPDT7OYbD6BEm++EcIkmORW7cSPDE=";
  };

  nativeBuildInputs = [qmake qttools qtwayland wrapQtAppsHook];

  buildInputs = [qtbase qtsvg];

  qmakeFlags = [
    "LRELEASE_EXECUTABLE=${lib.getDev qttools}/bin/lrelease"
    "PLUGINDIR=${placeholder "out"}/${qtbase.qtPluginPrefix}"
  ];

  # meta = with lib; {
  #   description = "Qt5 Configuration Tool";
  #   homepage = "https://www.opendesktop.org/content/show.php?content=168066";
  #   platforms = platforms.linux;
  #   license = licenses.bsd2;
  #   maintainers = with maintainers; [ralith];
  # };
}

@milahu
Copy link
Author

milahu commented Feb 12, 2023

Is this the reason that it can't find my kvantum theme?

no. qt themes should be in $QT_PLUGIN_PATH on runtime (not on compiletime)

  qmakeFlags = [
    "LRELEASE_EXECUTABLE=${lib.getDev qttools}/bin/lrelease"

see also NixOS/nixpkgs#214943

@jonaski
Copy link
Contributor

jonaski commented Sep 5, 2023

#31 should fix this.
Not sure what the idea behind setting the qtpaths executable from the path to lconvert, but I made it fallback to that only if qtpaths is not found normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants