diff options
| author | Robert Schütz <github@dotlambda.de> | 2022-10-11 22:17:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-11 22:17:05 -0700 |
| commit | ad74cafb1566d93ead524322e2a9c3072dfac954 (patch) | |
| tree | 3c0861fd9a6e7b87b3f23493fad0866ccc1d1874 | |
| parent | terraform-providers.utils: 1.4.1 → 1.5.0 (diff) | |
| download | nixpkgs-origin/revert-194833-pyqt6-webengine-new.tar.gz | |
Revert "pyqt6-webengine: init"origin/revert-194833-pyqt6-webengine-new
9 files changed, 61 insertions, 173 deletions
diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index a3f5b3236973..ce2392ab4edc 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -1,5 +1,5 @@ -{ stdenv, lib, fetchurl, fetchzip, fetchFromGitHub, python3 -, wrapQtAppsHook, glib-networking +{ stdenv, lib, fetchurl, fetchzip, python3 +, mkDerivationWith, wrapQtAppsHook, wrapGAppsHook, qtbase, qtwebengine, glib-networking , asciidoc, docbook_xml_dtd_45, docbook_xsl, libxml2 , libxslt, gst_all_1 ? null , withPdfReader ? true @@ -7,56 +7,35 @@ , backend ? "webengine" , pipewireSupport ? stdenv.isLinux , pipewire_0_2 -, qtwayland -, mkDerivationWith ? null -, qtbase ? null -, qtwebengine ? null -, wrapGAppsHook ? null -}: let - isQt6 = mkDerivationWith == null; +}: +assert withMediaPlayback -> gst_all_1 != null; + +let python3Packages = python3.pkgs; pdfjs = let version = "2.14.305"; in - fetchzip { + fetchzip rec { url = "https://github.com/mozilla/pdf.js/releases/download/v${version}/pdfjs-${version}-dist.zip"; hash = "sha256-E7t+0AUndrgi4zfJth0w28RmWLqLyXMUCnueNf/gNi4="; stripRoot = false; }; backendPackage = - if backend == "webengine" then if isQt6 then python3Packages.pyqt6-webengine else python3Packages.pyqtwebengine else + 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. ''; - buildPythonApplication = if isQt6 then python3Packages.buildPythonApplication else mkDerivationWith python3Packages.buildPythonApplication; - +in mkDerivationWith python3Packages.buildPythonApplication rec { pname = "qutebrowser"; - version = if isQt6 then "unstable-2022-09-16" else "2.5.2"; - -in - -assert withMediaPlayback -> gst_all_1 != null; -assert isQt6 -> backend != "webkit"; - -buildPythonApplication { - inherit pname version; + version = "2.5.2"; - src = if isQt6 then - # comes from qt6-v2 branch of upstream - # https://github.com/qutebrowser/qutebrowser/issues/7202 - fetchFromGitHub { - owner = "qutebrowser"; - repo = "qutebrowser"; - rev = "5e11e6c7d413cf5c77056ba871a545aae1cfd66a"; - sha256 = "sha256-5HNzPO07lUQe/Q3Nb4JiS9kb9GMQ5/FqM5029vLNNWo="; - } # 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-qb/OFN3EA94N6y7t+YPCMc4APgdZmV7H706jTkl06Qg="; }; @@ -87,7 +66,6 @@ buildPythonApplication { adblock ] ++ lib.optional (pythonOlder "3.9") importlib-resources - ++ lib.optional stdenv.isLinux qtwayland ); patches = [ @@ -116,15 +94,14 @@ buildPythonApplication { # Install icons for i in 16 24 32 48 64 128 256 512; do - install -Dm644 "qutebrowser/icons/qutebrowser-''${i}x''${i}.png" \ + install -Dm644 "icons/qutebrowser-''${i}x''${i}.png" \ "$out/share/icons/hicolor/''${i}x''${i}/apps/qutebrowser.png" done - install -Dm644 ${if isQt6 then "qutebrowser/" else ""}icons/qutebrowser.svg \ + install -Dm644 icons/qutebrowser.svg \ "$out/share/icons/hicolor/scalable/apps/qutebrowser.svg" # Install scripts sed -i "s,/usr/bin/,$out/bin/,g" scripts/open_url_in_instance.sh - ${if isQt6 then "rm -rf scripts/{testbrowser,dev}" else ""} install -Dm755 -t "$out/share/qutebrowser/scripts/" $(find scripts -type f) install -Dm755 -t "$out/share/qutebrowser/userscripts/" misc/userscripts/* diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index c365f3c06853..e4b56e7e7664 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -69,7 +69,7 @@ , enableProprietaryCodecs ? true }: -qtModule { +qtModule rec { pname = "qtwebengine"; qtInputs = [ qtdeclarative qtwebchannel qtwebsockets qtpositioning ]; nativeBuildInputs = [ @@ -94,12 +94,6 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - patches = [ - # fixes consistent crashing in github on 6.4.0, can probably remove when there is a patch release - # https://codereview.qt-project.org/c/qt/qtwebengine/+/436316 - ../patches/qtwebengine-fix.patch - ]; - postPatch = '' # Patch Chromium build tools ( diff --git a/pkgs/development/libraries/qt-6/patches/qtwebengine-fix.patch b/pkgs/development/libraries/qt-6/patches/qtwebengine-fix.patch deleted file mode 100644 index 672421ed43d4..000000000000 --- a/pkgs/development/libraries/qt-6/patches/qtwebengine-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 81bf140583f7b7bf13cc8dd522e1ca2aba873fc4 Mon Sep 17 00:00:00 2001 -From: Martin Negyokru <negyokru@inf.u-szeged.hu> -Date: Mon, 03 Oct 2022 12:20:00 +0200 -Subject: [PATCH] Do not intercept websocket connection when there is no associated frame - -This fix is based on chrome's implementation. - -Fixes: QTBUG-107144 -Change-Id: If042e4156b8a4bdb27a210c4db94e3a6198aed7d -Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> -(cherry picked from commit 64b7da9dab82713fdcb2e03d8a2715421eae5685) -Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> ---- - -diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp -index 020ae91..99a3aa3 100644 ---- a/src/core/content_browser_client_qt.cpp -+++ b/src/core/content_browser_client_qt.cpp -@@ -1237,8 +1237,7 @@ - - bool ContentBrowserClientQt::WillInterceptWebSocket(content::RenderFrameHost *frame) - { -- Q_UNUSED(frame); -- return true; // It is probably not worth it to only intercept when interceptors are installed -+ return frame != nullptr; - } - - QWebEngineUrlRequestInterceptor *getProfileInterceptorFromFrame(content::RenderFrameHost *frame) diff --git a/pkgs/development/python-modules/pyqt-builder/default.nix b/pkgs/development/python-modules/pyqt-builder/default.nix index 1aef6e13d2c7..5e87e700a55f 100644 --- a/pkgs/development/python-modules/pyqt-builder/default.nix +++ b/pkgs/development/python-modules/pyqt-builder/default.nix @@ -2,14 +2,20 @@ buildPythonPackage rec { pname = "pyqt-builder"; - version = "1.14.0"; + version = "1.13.0"; src = fetchPypi { pname = "PyQt-builder"; inherit version; - sha256 = "sha256-Z1WTHG0viUBVPgM00QyTPOXMGLZEJelP2hrM9P93T1k="; + sha256 = "sha256-SHdYDDjOtTIOEps4HQg7CoYBxoFm2LmXB/CPoKFonu8="; }; + patches = [ + # use the sip-distinfo executable from PATH instead of trying to guess, + # we know it's the right one because it's the _only_ one + ./use-sip-distinfo-from-path.patch + ]; + propagatedBuildInputs = [ packaging sip ]; pythonImportsCheck = [ "pyqtbuild" ]; @@ -21,6 +27,6 @@ buildPythonPackage rec { description = "PEP 517 compliant build system for PyQt"; homepage = "https://pypi.org/project/PyQt-builder/"; license = licenses.gpl3Only; - maintainers = with maintainers; [ nrdxp ]; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/development/python-modules/pyqt6-webengine.nix b/pkgs/development/python-modules/pyqt6-webengine.nix deleted file mode 100644 index 96fa057a47ca..000000000000 --- a/pkgs/development/python-modules/pyqt6-webengine.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ lib -, buildPythonPackage -, fetchPypi -, pkg-config -, lndir -, sip -, pyqt-builder -, qt6Packages -, pythonOlder -, pyqt6 -, python -}: - -buildPythonPackage rec { - pname = "PyQt6_WebEngine"; - version = "6.4.0"; - format = "pyproject"; - - disabled = pythonOlder "3.6"; - - src = fetchPypi { - inherit pname version; - sha256 = "sha256-THHBMIYKvNEeBMr7IuM5g/qaOu6DI8UZCbFaFwGCjiE="; - }; - - # fix include path and increase verbosity - postPatch = '' - sed -i \ - '/\[tool.sip.project\]/a\ - verbose = true\ - sip-include-dirs = [\"${pyqt6}/${python.sitePackages}/PyQt6/bindings\"]' \ - pyproject.toml - ''; - - enableParallelBuilding = true; - # HACK: paralellize compilation of make calls within pyqt's setup.py - # pkgs/stdenv/generic/setup.sh doesn't set this for us because - # make gets called by python code and not its build phase - # format=pyproject means the pip-build-hook hook gets used to build this project - # pkgs/development/interpreters/python/hooks/pip-build-hook.sh - # does not use the enableParallelBuilding flag - postUnpack = '' - export MAKEFLAGS+=" -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES" - ''; - - outputs = [ "out" "dev" ]; - - dontWrapQtApps = true; - - nativeBuildInputs = with qt6Packages; [ - pkg-config - lndir - sip - qtwebengine - qmake - pyqt-builder - ]; - - buildInputs = with qt6Packages; [ - qtwebengine - ]; - - propagatedBuildInputs = [ - pyqt6 - ]; - - passthru = { - inherit sip; - }; - - dontConfigure = true; - - # Checked using pythonImportsCheck, has no tests - doCheck = true; - - pythonImportsCheck = [ - "PyQt6.QtWebEngineCore" - "PyQt6.QtWebEngineQuick" - "PyQt6.QtWebEngineWidgets" - ]; - - meta = with lib; { - description = "Python bindings for Qt6 WebEngine"; - homepage = "https://riverbankcomputing.com/"; - license = licenses.gpl3Only; - platforms = platforms.mesaPlatforms; - maintainers = with maintainers; [ LunNova nrdxp ]; - }; -} diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index ab2701fefdc3..68052145766c 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -2,19 +2,35 @@ buildPythonPackage rec { pname = "sip"; - version = "6.7.1"; + version = "6.6.2"; src = fetchPypi { pname = "sip"; inherit version; - sha256 = "sha256-KBcP34gPk3Am/If6qcF3sGLDU8XRaeoyQrB4AmFN3Qw="; + sha256 = "sha256-Dj76wcXf2OUlrlcUCSffJpk+E/WLidFXfDFPQQW/2Q0="; }; + patches = [ + # on non-x86 Linux platforms, sip incorrectly detects the manylinux version + # and PIP will refuse to install the resulting wheel. + # remove once upstream fixes this, hopefully in 6.5.2 + ./fix-manylinux-version.patch + + # fix issue triggered by QGIS 3.26.x, already fixed upstream + # in SIP, waiting for release past 6.6.2 + (fetchpatch { + url = "https://riverbankcomputing.com/hg/sip/raw-diff/323d39a2d602/sipbuild/generator/parser/instantiations.py"; + hash = "sha256-QEQuRzXA+wK9Dt22U/LgIwtherY9pJURGJYpKpJkiok="; + }) + ]; + propagatedBuildInputs = [ packaging ply toml ]; # There aren't tests doCheck = false; + pythonImportsCheck = [ "sipbuild" ]; + # FIXME: Why isn't this detected automatically? # Needs to be specified in pyproject.toml, e.g.: # [tool.sip.bindings.MODULE] @@ -29,12 +45,10 @@ buildPythonPackage rec { else throw "unsupported platform"; - pythonImportsCheck = [ "sipbuild" ]; - meta = with lib; { description = "Creates C++ bindings for Python modules"; homepage = "https://riverbankcomputing.com/"; license = licenses.gpl3Only; - maintainers = with maintainers; [ nrdxp ]; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/development/python-modules/sip/fix-manylinux-version.patch b/pkgs/development/python-modules/sip/fix-manylinux-version.patch new file mode 100644 index 000000000000..4b8e99ae8e47 --- /dev/null +++ b/pkgs/development/python-modules/sip/fix-manylinux-version.patch @@ -0,0 +1,19 @@ +diff --git a/sipbuild/project.py b/sipbuild/project.py +--- a/sipbuild/project.py ++++ b/sipbuild/project.py +@@ -336,13 +336,13 @@ class Project(AbstractProject, Configurable): + # We expect a two part tag so leave anything else unchanged. + parts = platform_tag.split('-') + if len(parts) == 2: +- if self.minimum_glibc_version > (2, 17): ++ if self.minimum_glibc_version > (2, 17) or parts[1] not in {"x86_64", "i686", "aarch64", "armv7l", "ppc64", "ppc64le", "s390x"}: + # PEP 600. + parts[0] = 'manylinux' + parts.insert(1, + '{}.{}'.format(self.minimum_glibc_version[0], + self.minimum_glibc_version[1])) +- elif self.minimum_glibc_version > (2, 12): ++ elif self.minimum_glibc_version > (2, 12) or parts[1] not in {"x86_64", "i686"}: + # PEP 599. + parts[0] = 'manylinux2014' + elif self.minimum_glibc_version > (2, 5): diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6e7546d684a7..aa95ca80d41b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31158,9 +31158,6 @@ with pkgs; }; qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { }; - qutebrowser-qt6 = callPackage ../applications/networking/browsers/qutebrowser { - inherit (qt6Packages) qtbase qtwebengine wrapQtAppsHook qtwayland; - }; qxw = callPackage ../applications/editors/qxw {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 077d3fda6796..652d44baae2c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8427,8 +8427,6 @@ in { pyqt6-sip = callPackage ../development/python-modules/pyqt/pyqt6-sip.nix { }; - pyqt6-webengine = callPackage ../development/python-modules/pyqt6-webengine.nix { }; - pyqtgraph = callPackage ../development/python-modules/pyqtgraph { }; pyqtwebengine = pkgs.libsForQt5.callPackage ../development/python-modules/pyqtwebengine { |
