From eb8e9736604f69b9366dc2bfbc15d4902099b8c7 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 17 Aug 2019 20:24:46 +0000 Subject: [PATCH 1/4] pyqtwebengine: passthru wrapQtAppsHook --- pkgs/development/python-modules/pyqtwebengine/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyqtwebengine/default.nix b/pkgs/development/python-modules/pyqtwebengine/default.nix index 7d745aa9e105..b48f21b9e78d 100644 --- a/pkgs/development/python-modules/pyqtwebengine/default.nix +++ b/pkgs/development/python-modules/pyqtwebengine/default.nix @@ -1,5 +1,6 @@ { lib, fetchurl, pythonPackages, pkgconfig , qmake, qtbase, qtsvg, qtwebengine +, wrapQtAppsHook }: let @@ -77,9 +78,12 @@ in buildPythonPackage rec { doCheck = true; - enableParallelBuilding = true; + passthru = { + inherit wrapQtAppsHook; + }; + meta = with lib; { description = "Python bindings for Qt5"; homepage = http://www.riverbankcomputing.co.uk; From 2326319b388f9c2511a2cfd392455593bdd479ba Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 17 Aug 2019 20:25:31 +0000 Subject: [PATCH 2/4] anki: use wrapQtAppsHook from pyqtwebengine --- pkgs/games/anki/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 2530202a565e..8016aea9fd5d 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -92,6 +92,7 @@ buildPythonApplication rec { checkInputs = [ pytest glibcLocales nose ]; + nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook ]; buildInputs = [ lame mplayer libpulseaudio ]; makeWrapperArgs = [ @@ -131,6 +132,8 @@ buildPythonApplication rec { env HOME=$TMP pytest --ignore tests/test_sync.py ''; + dontWrapQtApps = true; + installPhase = '' pp=$out/lib/${python.libPrefix}/site-packages @@ -158,6 +161,9 @@ buildPythonApplication rec { cp -rv anki aqt web $pp/ wrapPythonPrograms + for program in $out/bin/*; do + wrapQtApp "$program" + done # copy the manual into $doc cp -r ${manual}/share/doc/anki/html $doc/share/doc/anki @@ -167,7 +173,7 @@ buildPythonApplication rec { inherit manual; }; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://apps.ankiweb.net/"; description = "Spaced repetition flashcard program"; longDescription = '' From 1a11eb34a1053127fbb5daba38e631dbae564055 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 17 Aug 2019 20:25:45 +0000 Subject: [PATCH 3/4] anki: add myself as a maintainer (Adding to the front of the list because it was I who added this expression to nixpkgs in e00c03101f8d052473fee17e5f7a6a975dc5edb4 7 years ago. :]) --- pkgs/games/anki/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 8016aea9fd5d..a316708ad4e0 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -191,6 +191,6 @@ buildPythonApplication rec { license = licenses.agpl3Plus; broken = stdenv.hostPlatform.isAarch64; platforms = platforms.mesaPlatforms; - maintainers = with maintainers; [ the-kenny Profpatsch enzime ]; + maintainers = with maintainers; [ oxij the-kenny Profpatsch enzime ]; }; } From 39028ee8a760bcd02d0c6a545cd63baf2a2dc41a Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sun, 18 Aug 2019 17:40:42 +0000 Subject: [PATCH 4/4] anki: simplify the expression, elide superfluous wappers As suggested by @worldofpeace. --- pkgs/games/anki/default.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index a316708ad4e0..b0efc54db363 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -95,10 +95,6 @@ buildPythonApplication rec { nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook ]; buildInputs = [ lame mplayer libpulseaudio ]; - makeWrapperArgs = [ - ''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"'' - ]; - patches = [ # Disable updated version check. ./no-version-check.patch @@ -132,8 +128,6 @@ buildPythonApplication rec { env HOME=$TMP pytest --ignore tests/test_sync.py ''; - dontWrapQtApps = true; - installPhase = '' pp=$out/lib/${python.libPrefix}/site-packages @@ -160,15 +154,18 @@ buildPythonApplication rec { cp -rv locale $out/share/ cp -rv anki aqt web $pp/ - wrapPythonPrograms - for program in $out/bin/*; do - wrapQtApp "$program" - done - # copy the manual into $doc cp -r ${manual}/share/doc/anki/html $doc/share/doc/anki ''; + dontWrapQtApps = true; + makeWrapperArgs = [ + ''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"'' + "\${qtWrapperArgs[@]}" + ]; + + # now wrapPythonPrograms from postFixup will add both python and qt env variables + passthru = { inherit manual; };