From 9b07d48d9c12cb889c0732bfa0e02fa048a3e61a Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 10 Dec 2018 16:13:59 -0500 Subject: [PATCH 01/10] pyqt5: remove old fixes Since about 5 hydra evaluations ago the build log has: substituteStream(): WARNING: pattern 'install_dir=pydbusmoddir' doesn't match anything in file 'configure.py' substituteStream(): WARNING: pattern 'ModuleMetadata(qmake_QT=['webkitwidgets'])' doesn't match anything in file 'configure.py' Looking at the original configure.py I don't see any mention of pydbusmoddir and ModuleMetadata seems to be set like the patch suggests: 'QtWebKitWidgets': ModuleMetadata( qmake_QT=['webkitwidgets', 'printsupport']), It appears that we don't need the fix anymore. Reverts: d3ed0ab32b ('PyQt: fix build') --- pkgs/development/python-modules/pyqt/5.x.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 14d7bddbb709..17b4ecb75d96 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -49,10 +49,6 @@ in buildPythonPackage { export PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages} - substituteInPlace configure.py \ - --replace 'install_dir=pydbusmoddir' "install_dir='$out/${python.sitePackages}/dbus/mainloop'" \ - --replace "ModuleMetadata(qmake_QT=['webkitwidgets'])" "ModuleMetadata(qmake_QT=['webkitwidgets', 'printsupport'])" - ${python.executable} configure.py -w \ --confirm-license \ --dbus=${dbus.dev}/include/dbus-1.0 \ From facefec1399fc718a0ad59fd1511e3b4c406af67 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 10 Dec 2018 16:18:38 -0500 Subject: [PATCH 02/10] pyqt5: make qtwebkit optional, disable by default qtwebkit appears to be unsupported in Qt 5.11. We are using some old port https://github.com/NixOS/nixpkgs/blob/475d653afdbd8fe3e00ccfd22a30014b0df7aeaa/pkgs/development/libraries/qt-5/5.11/default.nix#L39-L48 and it is broken on darwin. --- pkgs/development/python-modules/pyqt/5.x.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 17b4ecb75d96..50dbe51e7684 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -1,7 +1,8 @@ { lib, fetchurl, fetchpatch, pythonPackages, pkgconfig -, qmake, lndir, qtbase, qtsvg, qtwebkit, qtwebengine, dbus -, withWebSockets ? false, qtwebsockets +, qmake, lndir, qtbase, qtsvg, qtwebengine, dbus , withConnectivity ? false, qtconnectivity +, withWebKit ? false, qtwebkit +, withWebSockets ? false, qtwebsockets }: let @@ -36,9 +37,11 @@ in buildPythonPackage { buildInputs = [ dbus sip ]; - propagatedBuildInputs = [ - qtbase qtsvg qtwebkit qtwebengine - ] ++ lib.optional (!isPy3k) enum34 ++ lib.optional withWebSockets qtwebsockets ++ lib.optional withConnectivity qtconnectivity; + propagatedBuildInputs = [ qtbase qtsvg qtwebengine ] + ++ lib.optional (!isPy3k) enum34 + ++ lib.optional withConnectivity qtconnectivity + ++ lib.optional withWebKit qtwebkit + ++ lib.optional withWebSockets qtwebsockets; configurePhase = '' runHook preConfigure From 3c198294e7e7760197e5054256307317f6873faa Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 10 Dec 2018 16:24:09 -0500 Subject: [PATCH 03/10] pyqt5: refactor --- pkgs/development/python-modules/pyqt/5.x.nix | 24 +++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 50dbe51e7684..2d2c04d5fb2c 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -6,26 +6,16 @@ }: let - pname = "PyQt"; - version = "5.11.3"; inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34; sip = pythonPackages.sip.override { sip-module = "PyQt5.sip"; }; -in buildPythonPackage { - pname = pname; - version = version; +in buildPythonPackage rec { + pname = "PyQt"; + version = "5.11.3"; format = "other"; - meta = with lib; { - description = "Python bindings for Qt5"; - homepage = http://www.riverbankcomputing.co.uk; - license = licenses.gpl3; - platforms = platforms.mesaPlatforms; - maintainers = with maintainers; [ sander ]; - }; - src = fetchurl { url = "mirror://sourceforge/pyqt/PyQt5/PyQt-${version}/PyQt5_gpl-${version}.tar.gz"; sha256 = "0wqh4srqkcc03rvkwrcshaa028psrq58xkys6npnyhqxc0apvdf9"; @@ -73,4 +63,12 @@ in buildPythonPackage { ''; enableParallelBuilding = true; + + meta = with lib; { + description = "Python bindings for Qt5"; + homepage = http://www.riverbankcomputing.co.uk; + license = licenses.gpl3; + platforms = platforms.mesaPlatforms; + maintainers = with maintainers; [ sander ]; + }; } From 20d60c8238d407e1e175d06f533b5d99111b6891 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 11 Dec 2018 19:40:28 -0500 Subject: [PATCH 04/10] treewide: use pythonPackages.pyqt5_with_qtwebkit where QtWebKit is needed --- pkgs/applications/audio/cadence/default.nix | 2 +- pkgs/applications/misc/calibre/default.nix | 4 ++-- pkgs/applications/misc/electron-cash/default.nix | 2 +- .../networking/instant-messengers/blink/default.nix | 2 +- .../networking/instant-messengers/scudcloud/default.nix | 2 +- .../version-management/git-and-tools/git-cola/default.nix | 4 ++-- pkgs/applications/video/openshot-qt/default.nix | 2 +- pkgs/misc/frescobaldi/default.nix | 5 ++++- pkgs/top-level/python-packages.nix | 1 + 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/audio/cadence/default.nix b/pkgs/applications/audio/cadence/default.nix index f7fa9dbd8615..ef7eeab4b60c 100644 --- a/pkgs/applications/audio/cadence/default.nix +++ b/pkgs/applications/audio/cadence/default.nix @@ -25,7 +25,7 @@ DESTDIR=$(out) ''; - propagatedBuildInputs = with python3Packages; [ pyqt5 ]; + propagatedBuildInputs = with python3Packages; [ pyqt5_with_qtwebkit ]; postInstall = '' # replace with our own wrappers. They need to be changed manually since it wouldn't work otherwise diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index 6da1cdefa700..7b01f5c53d77 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch; prePatch = '' - sed -i "/pyqt_sip_dir/ s:=.*:= '${python2Packages.pyqt5}/share/sip/PyQt5':" \ + sed -i "/pyqt_sip_dir/ s:=.*:= '${python2Packages.pyqt5_with_qtwebkit}/share/sip/PyQt5':" \ setup/build_environment.py # Remove unneeded files and libs @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils wrapGAppsHook ] ++ (with python2Packages; [ apsw cssselect cssutils dateutil dnspython html5-parser lxml mechanize netifaces pillow - python pyqt5 sip + python pyqt5_with_qtwebkit sip regex msgpack # the following are distributed with calibre, but we use upstream instead odfpy diff --git a/pkgs/applications/misc/electron-cash/default.nix b/pkgs/applications/misc/electron-cash/default.nix index fff67b0add62..3ba6dfd2da06 100644 --- a/pkgs/applications/misc/electron-cash/default.nix +++ b/pkgs/applications/misc/electron-cash/default.nix @@ -25,7 +25,7 @@ python3Packages.buildPythonApplication rec { pbkdf2 pyaes pycrypto - pyqt5 + pyqt5_with_qtwebkit # TODO: qtwebkit not needed? pysocks qrcode requests diff --git a/pkgs/applications/networking/instant-messengers/blink/default.nix b/pkgs/applications/networking/instant-messengers/blink/default.nix index 63dec91dad90..bbdb2ae79f83 100644 --- a/pkgs/applications/networking/instant-messengers/blink/default.nix +++ b/pkgs/applications/networking/instant-messengers/blink/default.nix @@ -16,7 +16,7 @@ pythonPackages.buildPythonApplication rec { sed -i 's|@out@|'"''${out}"'|g' blink/resources.py ''; - propagatedBuildInputs = with pythonPackages; [ pyqt5 cjson sipsimple twisted google_api_python_client ]; + propagatedBuildInputs = with pythonPackages; [ pyqt5_with_qtwebkit cjson sipsimple twisted google_api_python_client ]; buildInputs = [ pythonPackages.cython zlib libvncserver libvpx ]; diff --git a/pkgs/applications/networking/instant-messengers/scudcloud/default.nix b/pkgs/applications/networking/instant-messengers/scudcloud/default.nix index 441bc020868e..54959383f08e 100644 --- a/pkgs/applications/networking/instant-messengers/scudcloud/default.nix +++ b/pkgs/applications/networking/instant-messengers/scudcloud/default.nix @@ -9,7 +9,7 @@ in python3Packages.buildPythonPackage { sha256 = "e0d1cb72115d0fda17db92d28be51558ad8fe250972683fac3086dbe8d350d22"; }; - propagatedBuildInputs = with python3Packages; [ pyqt5 dbus-python jsmin ]; + propagatedBuildInputs = with python3Packages; [ pyqt5_with_qtwebkit dbus-python jsmin ]; meta = with stdenv.lib; { description = "Non-official desktop client for Slack"; diff --git a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix index 4b15d03d2007..72bfe87230b6 100644 --- a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, pythonPackages, gettext, git }: let - inherit (pythonPackages) buildPythonApplication pyqt5 sip pyinotify; + inherit (pythonPackages) buildPythonApplication pyqt5_with_qtwebkit sip pyinotify; in buildPythonApplication rec { name = "git-cola-${version}"; version = "3.2"; @@ -14,7 +14,7 @@ in buildPythonApplication rec { }; buildInputs = [ git gettext ]; - propagatedBuildInputs = [ pyqt5 sip pyinotify ]; + propagatedBuildInputs = [ pyqt5_with_qtwebkit sip pyinotify ]; doCheck = false; diff --git a/pkgs/applications/video/openshot-qt/default.nix b/pkgs/applications/video/openshot-qt/default.nix index 0905ef5481bb..6f113817058c 100644 --- a/pkgs/applications/video/openshot-qt/default.nix +++ b/pkgs/applications/video/openshot-qt/default.nix @@ -17,7 +17,7 @@ python3Packages.buildPythonApplication rec { buildInputs = [ gtk3 ]; - propagatedBuildInputs = with python3Packages; [ libopenshot pyqt5 requests sip httplib2 pyzmq ]; + propagatedBuildInputs = with python3Packages; [ libopenshot pyqt5_with_qtwebkit requests sip httplib2 pyzmq ]; preConfigure = '' diff --git a/pkgs/misc/frescobaldi/default.nix b/pkgs/misc/frescobaldi/default.nix index af4c54d9d0d8..df1d623930b5 100644 --- a/pkgs/misc/frescobaldi/default.nix +++ b/pkgs/misc/frescobaldi/default.nix @@ -11,7 +11,10 @@ python3Packages.buildPythonApplication rec { sha256 = "1yn18pwsjxpxz5j3yfysmaif8k0vqahj5c7ays9cxsylpg9hl7jd"; }; - propagatedBuildInputs = with python3Packages; [ lilypond pygame python-ly poppler-qt5 ]; + propagatedBuildInputs = with python3Packages; [ + lilypond pygame python-ly + pyqt5_with_qtwebkit (poppler-qt5.override { pyqt5 = pyqt5_with_qtwebkit; }) + ]; # no tests in shipped with upstream doCheck = false; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d7a22f94b53a..2859f2283b9e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -614,6 +614,7 @@ in { pyqt5 = pkgs.libsForQt5.callPackage ../development/python-modules/pyqt/5.x.nix { pythonPackages = self; }; + pyqt5_with_qtwebkit = self.pyqt5.override { withWebKit = true; }; pysc2 = callPackage ../development/python-modules/pysc2 { }; From 97ec7a9ab9ec7b86a243d775c8c140db3055c492 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 20 Dec 2018 16:45:07 -0500 Subject: [PATCH 05/10] pythonPackages.qtconsole: build on darwin Fixes: d7ef9a71071 ('python36Packages.qtconsole: 4.4.2 -> 4.4.3') --- pkgs/development/python-modules/qtconsole/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/qtconsole/default.nix b/pkgs/development/python-modules/qtconsole/default.nix index ef322bd79804..07b5a3169614 100644 --- a/pkgs/development/python-modules/qtconsole/default.nix +++ b/pkgs/development/python-modules/qtconsole/default.nix @@ -31,7 +31,7 @@ buildPythonPackage rec { description = "Jupyter Qt console"; homepage = http://jupyter.org/; license = lib.licenses.bsd3; - platforms = lib.platforms.linux; # fails on Darwin + platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ fridh ]; }; } From 07a67363b73d4d4d056f3535d1df1e4924913bbf Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 26 Dec 2018 11:06:30 -0500 Subject: [PATCH 06/10] pyqt5_with_qtwebkit: add warning comment --- pkgs/top-level/python-packages.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2859f2283b9e..ba25debd5519 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -614,6 +614,12 @@ in { pyqt5 = pkgs.libsForQt5.callPackage ../development/python-modules/pyqt/5.x.nix { pythonPackages = self; }; + + /* + `pyqt5_with_qtwebkit` should not be used by python libraries in + pkgs/development/python-modules/*. Putting this attribute in + `propagatedBuildInputs` may cause collisions. + */ pyqt5_with_qtwebkit = self.pyqt5.override { withWebKit = true; }; pysc2 = callPackage ../development/python-modules/pysc2 { }; From 8df467ebd6f50eec35f42209e2282df33f32441d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 26 Dec 2018 12:35:58 -0500 Subject: [PATCH 07/10] qutebrowser: drop QtWebKit support From the qutebrowser README: "support for QtWebKit will be dropped soon" --- .../networking/browsers/qutebrowser/default.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index 5e44bb8cbef6..1be4f1c4c524 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -4,7 +4,6 @@ , libxslt, gst_all_1 ? null , withPdfReader ? true , withMediaPlayback ? true -, withWebEngineDefault ? true }: assert withMediaPlayback -> gst_all_1 != null; @@ -39,7 +38,7 @@ in python3Packages.buildPythonApplication rec { ] ++ lib.optionals withMediaPlayback (with gst_all_1; [ gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav - ]) ++ lib.optional (!withWebEngineDefault) python3Packages.qtwebkit-plugins; + ]); nativeBuildInputs = [ makeWrapper wrapGAppsHook asciidoc @@ -90,10 +89,6 @@ in python3Packages.buildPythonApplication rec { done ''; - postFixup = lib.optionalString (! withWebEngineDefault) '' - wrapProgram $out/bin/qutebrowser --add-flags "--backend webkit" - ''; - meta = with stdenv.lib; { homepage = https://github.com/The-Compiler/qutebrowser; description = "Keyboard-focused browser with a minimal GUI"; From ae8797777ab7b15512ce2d7b586cf22cde23696a Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 29 Dec 2018 22:37:18 -0500 Subject: [PATCH 08/10] electron-cash: doesn't need QtWebKit Upstream issue: https://github.com/Electron-Cash/Electron-Cash/pull/1078 --- pkgs/applications/misc/electron-cash/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/electron-cash/default.nix b/pkgs/applications/misc/electron-cash/default.nix index 3ba6dfd2da06..fff67b0add62 100644 --- a/pkgs/applications/misc/electron-cash/default.nix +++ b/pkgs/applications/misc/electron-cash/default.nix @@ -25,7 +25,7 @@ python3Packages.buildPythonApplication rec { pbkdf2 pyaes pycrypto - pyqt5_with_qtwebkit # TODO: qtwebkit not needed? + pyqt5 pysocks qrcode requests From 16f11dff3f4ca888f3b93252fd4a9222779169bc Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 29 Dec 2018 22:54:03 -0500 Subject: [PATCH 09/10] frescobaldi: add explicit dependency on sip --- pkgs/misc/frescobaldi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/frescobaldi/default.nix b/pkgs/misc/frescobaldi/default.nix index df1d623930b5..2b38ed57c285 100644 --- a/pkgs/misc/frescobaldi/default.nix +++ b/pkgs/misc/frescobaldi/default.nix @@ -12,7 +12,7 @@ python3Packages.buildPythonApplication rec { }; propagatedBuildInputs = with python3Packages; [ - lilypond pygame python-ly + lilypond pygame python-ly sip pyqt5_with_qtwebkit (poppler-qt5.override { pyqt5 = pyqt5_with_qtwebkit; }) ]; From eecc33608fbd80b1ca246268a633001875dd16ef Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 30 Dec 2018 10:21:38 -0500 Subject: [PATCH 10/10] git-cola: doesn't need QtWebKit QtWebKit is only used if QtWebEngine is not available --- .../version-management/git-and-tools/git-cola/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix index 72bfe87230b6..039da03efb1f 100644 --- a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix @@ -1,7 +1,8 @@ { stdenv, fetchFromGitHub, pythonPackages, gettext, git }: let - inherit (pythonPackages) buildPythonApplication pyqt5_with_qtwebkit sip pyinotify; + inherit (pythonPackages) buildPythonApplication pyqt5 sip pyinotify; + in buildPythonApplication rec { name = "git-cola-${version}"; version = "3.2"; @@ -14,7 +15,7 @@ in buildPythonApplication rec { }; buildInputs = [ git gettext ]; - propagatedBuildInputs = [ pyqt5_with_qtwebkit sip pyinotify ]; + propagatedBuildInputs = [ pyqt5 sip pyinotify ]; doCheck = false;