summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/qutebrowser/default.nix
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2023-08-19 13:01:41 +0200
committerrnhmjoj <rnhmjoj@inventati.org>2023-08-19 13:08:57 +0200
commit180f7932cd3ca2483a39a6519812d70c0a12692f (patch)
tree82df024815513ad0e983f6bbcac1659e9484748b /pkgs/applications/networking/browsers/qutebrowser/default.nix
parent28482dfd4284560ccf20fb2d9535be326cac8d54 (diff)
downloadnixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar.gz
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar.bz2
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar.lz
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar.xz
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.tar.zst
nixpkgs-180f7932cd3ca2483a39a6519812d70c0a12692f.zip
qutebrowser: 2.5.4 -> 3.0.0
Diffstat (limited to 'pkgs/applications/networking/browsers/qutebrowser/default.nix')
-rw-r--r--pkgs/applications/networking/browsers/qutebrowser/default.nix72
1 files changed, 21 insertions, 51 deletions
diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix
index 47721f18341..1bd35ef0a1d 100644
--- a/pkgs/applications/networking/browsers/qutebrowser/default.nix
+++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchzip, fetchFromGitHub, python3
+{ stdenv, lib, fetchurl, fetchzip, python3
 , wrapQtAppsHook, glib-networking
 , asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2
 , libxslt, gst_all_1 ? null
@@ -8,16 +8,14 @@
 , pipewireSupport    ? stdenv.isLinux
 , pipewire
 , qtwayland
-, mkDerivationWith ? null
-, qtbase ? null
-, qtwebengine ? null
-, wrapGAppsHook ? null
+, qtbase
+, qtwebengine
+, wrapGAppsHook
 , enableWideVine ? false
 , widevine-cdm
-}: let
-  isQt6 = mkDerivationWith == null;
+}:
 
-  python3Packages = python3.pkgs;
+let
   pdfjs = let
     version = "2.14.305";
   in
@@ -27,40 +25,21 @@
     stripRoot = false;
   };
 
-  backendPackage =
-   if backend == "webengine" then if isQt6 then python3Packages.pyqt6-webengine else python3Packages.pyqtwebengine else
-   if backend == "webkit"    then python3Packages.pyqt5_with_qtwebkit else
-   throw ''
-     Unknown qutebrowser backend "${backend}".
-     Valid choices are qtwebengine (recommended) or qtwebkit.
-   '';
-
-  buildPythonApplication = if isQt6 then python3Packages.buildPythonApplication else mkDerivationWith python3Packages.buildPythonApplication;
-
   pname = "qutebrowser";
-  version = if isQt6 then "unstable-2023-04-18" else "2.5.4";
+  version = "3.0.0";
 in
 
 assert withMediaPlayback -> gst_all_1 != null;
-assert isQt6 -> backend != "webkit";
+assert lib.assertMsg (backend != "webkit") ''
+  Support for the QtWebKit backend has been removed.
+  Please remove the `backend = "webkit"` option from your qutebrowser override.
+'';
 
-buildPythonApplication {
+python3.pkgs.buildPythonApplication {
   inherit pname version;
-
-  src = if isQt6 then
-    # comes from the master branch of upstream
-    # https://github.com/qutebrowser/qutebrowser/issues/7202
-    # https://github.com/qutebrowser/qutebrowser/discussions/7628
-    fetchFromGitHub {
-      owner = "qutebrowser";
-      repo = "qutebrowser";
-      rev = "d4cafc0019a4a5574caa11966fc40ede89076d26";
-      hash = "sha256-Ma79EPvnwmQkeXEG9aSnD/Vt1DGhK2JX9dib7uARH8M=";
-    }
-  # the release tarballs are different from the git checkout!
-   else fetchurl {
+  src = fetchurl {
     url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/${pname}-${version}.tar.gz";
-    hash = "sha256-pGCyICUn5CpnDCbSJdn6ZBfQkswfFvOpXnvJXdicGrE=";
+    hash = "sha256-Oer0p/DwUfOejUCgSCSkMvLLAjNyJx51qgN7bcQQ2Pw=";
   };
 
   # Needs tox
@@ -77,20 +56,18 @@ buildPythonApplication {
   nativeBuildInputs = [
     wrapQtAppsHook wrapGAppsHook asciidoc
     docbook_xml_dtd_45 docbook_xsl libxml2 libxslt
-  ]
-    ++ lib.optional isQt6 python3Packages.pygments;
+    python3.pkgs.pygments
+  ];
 
-  propagatedBuildInputs = with python3Packages; ([
-    pyyaml backendPackage jinja2 pygments
+  propagatedBuildInputs = with python3.pkgs; ([
+    pyyaml pyqtwebengine jinja2 pygments
     # scripts and userscripts libs
     tldextract beautifulsoup4
     readability-lxml pykeepass stem
     pynacl
     # extensive ad blocking
     adblock
-  ]
-    ++ lib.optional (pythonOlder "3.9") importlib-resources
-    ++ lib.optional stdenv.isLinux qtwayland
+  ] ++ lib.optional stdenv.isLinux qtwayland
   );
 
   patches = [
@@ -100,10 +77,6 @@ buildPythonApplication {
   dontWrapGApps = true;
   dontWrapQtApps = true;
 
-  preConfigure = lib.optionalString isQt6 ''
-    python scripts/asciidoc2html.py
-  '';
-
   postPatch = ''
     substituteInPlace qutebrowser/misc/quitter.py --subst-var-by qutebrowser "$out/bin/qutebrowser"
 
@@ -141,10 +114,7 @@ buildPythonApplication {
     makeWrapperArgs+=(
       "''${gappsWrapperArgs[@]}"
       "''${qtWrapperArgs[@]}"
-      --add-flags '--backend ${backend}'
-      --set QUTE_QTWEBENGINE_VERSION_OVERRIDE "${lib.getVersion qtwebengine}"
-      ${lib.optionalString isQt6 ''--set QUTE_QT_WRAPPER "PyQt6"''}
-      ${lib.optionalString (pipewireSupport && backend == "webengine") ''--prefix LD_LIBRARY_PATH : ${libPath}''}
+      ${lib.optionalString pipewireSupport ''--prefix LD_LIBRARY_PATH : ${libPath}''}
       ${lib.optionalString enableWideVine ''--add-flags "--qt-flag widevine-path=${widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"''}
     )
   '';
@@ -153,7 +123,7 @@ buildPythonApplication {
     homepage    = "https://github.com/qutebrowser/qutebrowser";
     description = "Keyboard-focused browser with a minimal GUI";
     license     = licenses.gpl3Plus;
-    platforms   = if enableWideVine then [ "x86_64-linux" ] else backendPackage.meta.platforms;
+    platforms   = if enableWideVine then [ "x86_64-linux" ] else qtwebengine.meta.platforms;
     maintainers = with maintainers; [ jagajaga rnhmjoj ebzzry dotlambda nrdxp ];
   };
 }