From 322d13eb6746f63b4eb29211b2455213c7fa866d Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Fri, 17 Jul 2020 10:45:02 +0200 Subject: [PATCH] qutebrowser: re-add option to control the browser backend --- .../browsers/qutebrowser/default.nix | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index f65ae2f46956..82ec598371ae 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -2,8 +2,9 @@ , mkDerivationWith, wrapQtAppsHook, wrapGAppsHook, qtbase, glib-networking , asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2 , libxslt, gst_all_1 ? null -, withPdfReader ? true -, withMediaPlayback ? true +, withPdfReader ? true +, withMediaPlayback ? true +, backend ? "webkit" }: assert withMediaPlayback -> gst_all_1 != null; @@ -19,6 +20,14 @@ let stripRoot = false; }; + backendPackage = + if backend == "webengine" then python3Packages.pyqtwebengine else + if backend == "webkit" then python3Packages.pyqt5_with_qtwebkit else + throw '' + Unknown qutebrowser backend "${backend}". + Valid choices are qtwebengine (recommended) or qtwebkit. + ''; + in mkDerivationWith python3Packages.buildPythonApplication rec { pname = "qutebrowser"; version = "1.13.0"; @@ -46,16 +55,14 @@ in mkDerivationWith python3Packages.buildPythonApplication rec { ]; propagatedBuildInputs = with python3Packages; [ - pyyaml pyqt5 pyqtwebengine jinja2 pygments + pyyaml backendPackage jinja2 pygments pypeg2 cssutils pyopengl attrs setuptools # scripts and userscripts libs tldextract beautifulsoup4 pyreadability pykeepass stem ]; - patches = [ - ./fix-restart.patch - ]; + patches = [ ./fix-restart.patch ]; dontWrapGApps = true; dontWrapQtApps = true; @@ -101,7 +108,8 @@ in mkDerivationWith python3Packages.buildPythonApplication rec { postFixup = '' wrapProgram $out/bin/qutebrowser \ "''${gappsWrapperArgs[@]}" \ - "''${qtWrapperArgs[@]}" + "''${qtWrapperArgs[@]}" \ + --add-flags '--backend ${backend}' ''; meta = with stdenv.lib; {