about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/graphics/nifskope/default.nix12
-rw-r--r--pkgs/tools/misc/partition-manager/default.nix10
-rw-r--r--pkgs/tools/misc/yubikey-manager-qt/default.nix35
-rw-r--r--pkgs/tools/security/nitrokey-app/default.nix11
4 files changed, 23 insertions, 45 deletions
diff --git a/pkgs/tools/graphics/nifskope/default.nix b/pkgs/tools/graphics/nifskope/default.nix
index c5651d0418e49..42da24e323994 100644
--- a/pkgs/tools/graphics/nifskope/default.nix
+++ b/pkgs/tools/graphics/nifskope/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake, qtbase, qttools, substituteAll, libGLU, makeWrapper }:
+{ stdenv, fetchFromGitHub, qmake, qtbase, qttools, substituteAll, libGLU, wrapQtAppsHook }:
 
 stdenv.mkDerivation rec {
   name = "nifskope-${version}";
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  buildInputs = [ qtbase qttools libGLU.dev makeWrapper ];
-  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtbase qttools libGLU.dev ];
+  nativeBuildInputs = [ qmake wrapQtAppsHook ];
 
   preConfigure = ''
     shopt -s globstar
@@ -33,9 +33,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   # Inspired by install/linux-install/nifskope.spec.in.
-  installPhase = let
-    qtVersion = "5.${stdenv.lib.versions.minor qtbase.version}";
-  in ''
+  installPhase = ''
     runHook preInstall
 
     d=$out/share/nifskope
@@ -53,8 +51,6 @@ stdenv.mkDerivation rec {
 
     find $out/share -type f -exec chmod -x {} \;
 
-    wrapProgram $out/bin/NifSkope --prefix QT_PLUGIN_PATH : "${qtbase}/lib/qt-${qtVersion}/plugins"
-
     runHook postInstall
   '';
 
diff --git a/pkgs/tools/misc/partition-manager/default.nix b/pkgs/tools/misc/partition-manager/default.nix
index 4599309b2384a..1c094c291d899 100644
--- a/pkgs/tools/misc/partition-manager/default.nix
+++ b/pkgs/tools/misc/partition-manager/default.nix
@@ -1,7 +1,7 @@
 { mkDerivation, fetchurl, lib
-, extra-cmake-modules, kdoctools, wrapGAppsHook
+, extra-cmake-modules, kdoctools, wrapGAppsHook, wrapQtAppsHook
 , kconfig, kcrash, kinit, kpmcore
-, eject, libatasmart , utillinux, makeWrapper, qtbase
+, eject, libatasmart , utillinux, qtbase
 }:
 
 let
@@ -17,16 +17,12 @@ in mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook makeWrapper ];
+  nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook wrapQtAppsHook ];
 
   # refer to kpmcore for the use of eject
   buildInputs = [ eject libatasmart utillinux ];
   propagatedBuildInputs = [ kconfig kcrash kinit kpmcore ];
 
-  postInstall = ''
-    wrapProgram "$out/bin/partitionmanager" --prefix QT_PLUGIN_PATH : "${kpmcore}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins"
-  '';
-
   meta = with lib; {
     description = "KDE Partition Manager";
     license = licenses.gpl2;
diff --git a/pkgs/tools/misc/yubikey-manager-qt/default.nix b/pkgs/tools/misc/yubikey-manager-qt/default.nix
index 6eda3e6e436af..391b989322edc 100644
--- a/pkgs/tools/misc/yubikey-manager-qt/default.nix
+++ b/pkgs/tools/misc/yubikey-manager-qt/default.nix
@@ -1,6 +1,6 @@
 { stdenv
 , fetchurl
-, makeWrapper
+, wrapQtAppsHook
 , pcsclite
 , pyotherside
 , pythonPackages
@@ -16,16 +16,9 @@
 , yubikey-personalization
 }:
 
-let
-  qmlPath = qmlLib: "${qmlLib}/${qtbase.qtQmlPrefix}";
+let inherit (stdenv) lib; in
 
-  inherit (stdenv) lib;
-
-  qml2ImportPath = lib.concatMapStringsSep ":" qmlPath [
-    qtbase.bin qtdeclarative.bin pyotherside qtquickcontrols qtquickcontrols2.bin qtgraphicaleffects
-  ];
-
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "yubikey-manager-qt";
   version = "1.1.1";
 
@@ -34,7 +27,7 @@ in stdenv.mkDerivation rec {
     sha256 = "0hcfl0mh4gqy9c8ghmi58asqr8v009n6li0mgcy3r8fyjr7qryvy";
   };
 
-  nativeBuildInputs = [ makeWrapper python3.pkgs.wrapPython qmake ];
+  nativeBuildInputs = [ wrapQtAppsHook python3.pkgs.wrapPython qmake ];
 
   postPatch = ''
     substituteInPlace ykman-gui/deployment.pri --replace '/usr/bin' "$out/bin"
@@ -46,22 +39,20 @@ in stdenv.mkDerivation rec {
 
   pythonPath = [ yubikey-manager ];
 
+  dontWrapQtApps = true;
   postInstall = ''
     buildPythonPath "$pythonPath"
 
-    wrapProgram $out/bin/ykman-gui \
+    wrapQtApp $out/bin/ykman-gui \
       --prefix LD_LIBRARY_PATH : "${stdenv.lib.getLib pcsclite}/lib:${yubikey-personalization}/lib" \
-      --prefix PYTHONPATH : "$program_PYTHONPATH" \
-      --set QML2_IMPORT_PATH "${qml2ImportPath}" \
-      --set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-*/plugins/platforms \
-      --prefix QT_PLUGIN_PATH : "${qtsvg.bin}/${qtbase.qtPluginPrefix}"
+      --prefix PYTHONPATH : "$program_PYTHONPATH"
 
-      mkdir -p $out/share/applications
-      cp resources/ykman-gui.desktop $out/share/applications/ykman-gui.desktop
-      mkdir -p $out/share/ykman-gui/icons
-      cp resources/icons/*.{icns,ico,png,xpm} $out/share/ykman-gui/icons
-      substituteInPlace $out/share/applications/ykman-gui.desktop \
-        --replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" \
+    mkdir -p $out/share/applications
+    cp resources/ykman-gui.desktop $out/share/applications/ykman-gui.desktop
+    mkdir -p $out/share/ykman-gui/icons
+    cp resources/icons/*.{icns,ico,png,xpm} $out/share/ykman-gui/icons
+    substituteInPlace $out/share/applications/ykman-gui.desktop \
+      --replace 'Exec=ykman-gui' "Exec=$out/bin/ykman-gui" \
   '';
 
   meta = with lib; {
diff --git a/pkgs/tools/security/nitrokey-app/default.nix b/pkgs/tools/security/nitrokey-app/default.nix
index e7f7547e4ad9f..1b18f0e1e11a0 100644
--- a/pkgs/tools/security/nitrokey-app/default.nix
+++ b/pkgs/tools/security/nitrokey-app/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, makeWrapper, bash-completion, cmake, fetchFromGitHub, hidapi, libusb1, pkgconfig
-, qtbase, qttranslations, qtsvg }:
+{ stdenv, bash-completion, cmake, fetchFromGitHub, hidapi, libusb1, pkgconfig
+, qtbase, qttranslations, qtsvg, wrapQtAppsHook }:
 
 stdenv.mkDerivation rec {
   name = "nitrokey-app-${version}";
@@ -29,15 +29,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     cmake
     pkgconfig
-    makeWrapper
+    wrapQtAppsHook
   ];
   cmakeFlags = "-DCMAKE_BUILD_TYPE=Release";
 
-  postFixup = ''
-    wrapProgram $out/bin/nitrokey-app \
-      --prefix QT_PLUGIN_PATH : "${qtbase}/${qtbase.qtPluginPrefix}"
-  '';
-
   meta = with stdenv.lib; {
     description      = "Provides extra functionality for the Nitrokey Pro and Storage";
     longDescription  = ''