Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qutebrowser: 2.5.4 -> 3.0.0 #251667

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 41 additions & 19 deletions pkgs/applications/networking/browsers/qutebrowser/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, fetchzip, python3
{ stdenv, lib, fetchurl, fetchzip, fetchFromGitHub, python3
, wrapQtAppsHook, glib-networking
, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2
, libxslt, gst_all_1 ? null
Expand All @@ -8,14 +8,16 @@
, pipewireSupport ? stdenv.isLinux
, pipewire
, qtwayland
, qtbase
, qtwebengine
, wrapGAppsHook
, mkDerivationWith ? null
, qtbase ? null
, qtwebengine ? null
, wrapGAppsHook ? null
, enableWideVine ? false
, widevine-cdm
}:
}: let
isQt6 = mkDerivationWith == null;

let
python3Packages = python3.pkgs;
pdfjs = let
version = "3.9.179";
in
Expand All @@ -25,21 +27,32 @@ let
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 = "3.0.0";
version = if isQt6 then "3.0.0" else "2.5.4";
in

assert withMediaPlayback -> gst_all_1 != null;
assert lib.assertMsg (backend != "webkit") ''
Support for the QtWebKit backend has been removed.
Please remove the `backend = "webkit"` option from your qutebrowser override.
'';
assert isQt6 -> backend != "webkit";

python3.pkgs.buildPythonApplication {
buildPythonApplication {
inherit pname version;

src = fetchurl {
url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/${pname}-${version}.tar.gz";
hash = "sha256-Oer0p/DwUfOejUCgSCSkMvLLAjNyJx51qgN7bcQQ2Pw=";
hash = {
"2.5.4" = "sha256-pGCyICUn5CpnDCbSJdn6ZBfQkswfFvOpXnvJXdicGrE=";
"3.0.0" = "sha256-Oer0p/DwUfOejUCgSCSkMvLLAjNyJx51qgN7bcQQ2Pw=";
}."${version}";
};

# Needs tox
Expand All @@ -56,18 +69,20 @@ python3.pkgs.buildPythonApplication {
nativeBuildInputs = [
wrapQtAppsHook wrapGAppsHook asciidoc
docbook_xml_dtd_45 docbook_xsl libxml2 libxslt
python3.pkgs.pygments
];
]
++ lib.optional isQt6 python3Packages.pygments;

propagatedBuildInputs = with python3.pkgs; ([
pyyaml pyqt6-webengine jinja2 pygments
pyyaml backendPackage jinja2 pygments
# scripts and userscripts libs
tldextract beautifulsoup4
readability-lxml pykeepass stem
pynacl
# extensive ad blocking
adblock
] ++ lib.optional stdenv.isLinux qtwayland
]
++ lib.optional (pythonOlder "3.9") importlib-resources
++ lib.optional stdenv.isLinux qtwayland
);

patches = [
Expand All @@ -77,6 +92,10 @@ python3.pkgs.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"

Expand Down Expand Up @@ -114,7 +133,10 @@ python3.pkgs.buildPythonApplication {
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
"''${qtWrapperArgs[@]}"
${lib.optionalString pipewireSupport ''--prefix LD_LIBRARY_PATH : ${libPath}''}
--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 enableWideVine ''--add-flags "--qt-flag widevine-path=${widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"''}
)
'';
Expand All @@ -123,7 +145,7 @@ python3.pkgs.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 qtwebengine.meta.platforms;
platforms = if enableWideVine then [ "x86_64-linux" ] else backendPackage.meta.platforms;
maintainers = with maintainers; [ jagajaga rnhmjoj ebzzry dotlambda nrdxp ];
};
}
1 change: 0 additions & 1 deletion pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,6 @@ mapAliases ({
quake3game = throw "'quake3game' has been renamed to/replaced by 'ioquake3'"; # Converted to throw 2022-02-22
quaternion-git = throw "quaternion-git has been removed in favor of the stable version 'quaternion'"; # Added 2020-04-09
quilter = throw "quilter has been removed from nixpkgs, as it was unmaintained"; # Added 2021-08-03
qutebrowser-qt6 = throw "'qutebrowser-qt6' has been replaced by 'qutebrowser', since the the qt5 version has been removed"; # Added 2023-08-19
qvim = throw "qvim has been removed"; # Added 2020-08-31
qweechat = throw "qweechat has been removed because it was broken"; # Added 2021-03-08
qwt6 = throw "'qwt6' has been renamed to/replaced by 'libsForQt5.qwt'"; # Converted to throw 2022-02-22
Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35109,7 +35109,8 @@ with pkgs;
withXineBackend = true;
};

qutebrowser = callPackage ../applications/networking/browsers/qutebrowser {
qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { };
qutebrowser-qt6 = callPackage ../applications/networking/browsers/qutebrowser {
inherit (qt6Packages) qtbase qtwebengine wrapQtAppsHook qtwayland;
};

Expand Down