about summary refs log tree commit diff
path: root/pkgs/tools/misc/yubikey-manager-qt
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2019-07-05 14:38:10 -0500
committerGitHub <noreply@github.com>2019-07-05 14:38:10 -0500
commit56d5963382da1b4848615aa9139e527978c64670 (patch)
tree6e76232d7b4fd5cf3034eef18f0e109f2b86bbb0 /pkgs/tools/misc/yubikey-manager-qt
parent066491c2e18d6277e0765a3647068c93650fcd19 (diff)
parent3adc9d04870605ca20969a98fe820535fc7a88a5 (diff)
Merge pull request #54525 from ttuegel/feature/qt-5/wrap-qt-apps
Wrap Qt applications
Diffstat (limited to 'pkgs/tools/misc/yubikey-manager-qt')
-rw-r--r--pkgs/tools/misc/yubikey-manager-qt/default.nix35
1 files changed, 13 insertions, 22 deletions
diff --git a/pkgs/tools/misc/yubikey-manager-qt/default.nix b/pkgs/tools/misc/yubikey-manager-qt/default.nix
index a1d0b185a0a94..44b2f3451c1dd 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.2";
 
@@ -34,7 +27,7 @@ in stdenv.mkDerivation rec {
     sha256 = "01ax8zjrahs2sjbgsys2ahh57sdcap0ij3y1r1bbvsgzr7xxm2q8";
   };
 
-  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; {