From cf3d9c3cf1c48bc7b5294bdfbdde5e13693b73bc Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 24 Apr 2022 22:20:07 -0700 Subject: [PATCH 1/4] qtwebengine: implement meta.platforms correctly --- .../libraries/qt-5/modules/qtwebengine.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 3c5256908d88..ce087d49b5fa 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -240,7 +240,22 @@ qtModule { meta = with lib; { description = "A web engine based on the Chromium web browser"; maintainers = with maintainers; [ matthewbauer ]; - platforms = platforms.unix; + + # qtwebengine-5.15.8: "QtWebEngine can only be built for x86, + # x86-64, ARM, Aarch64, and MIPSel architectures." + platforms = + lib.trivial.pipe lib.systems.doubles.all [ + (map (double: lib.systems.elaborate { system = double; })) + (lib.lists.filter (parsedPlatform: with parsedPlatform; + isUnix && + (isx86_32 || + isx86_64 || + isAarch32 || + isAarch64 || + (isMips && isLittleEndian)))) + (map (plat: plat.system)) + ]; + # This build takes a long time; particularly on slow architectures timeout = 24 * 3600; # we are still stuck with MacOS SDK 10.12 on x86_64-darwin From 0959604970230574185f02658f9b9abf4cc2d8bb Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 24 Apr 2022 22:20:39 -0700 Subject: [PATCH 2/4] pyqtwebengine: intersect meta.platforms with qtwebengine --- pkgs/development/python-modules/pyqtwebengine/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyqtwebengine/default.nix b/pkgs/development/python-modules/pyqtwebengine/default.nix index f59694876cc4..12021e52271b 100644 --- a/pkgs/development/python-modules/pyqtwebengine/default.nix +++ b/pkgs/development/python-modules/pyqtwebengine/default.nix @@ -66,6 +66,6 @@ in buildPythonPackage rec { description = "Python bindings for Qt5"; homepage = "http://www.riverbankcomputing.co.uk"; license = licenses.gpl3; - platforms = platforms.mesaPlatforms; + platforms = lib.lists.intersectLists qtwebengine.meta.platforms platforms.mesaPlatforms; }; } From d53c8e99ee73615b064f4ca2327896e48fda04e4 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 24 Apr 2022 22:21:18 -0700 Subject: [PATCH 3/4] qutebrowser: take meta.platforms from pyqtweb{engine,kit} --- pkgs/applications/networking/browsers/qutebrowser/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix index ecce98c9b46a..2e96266fd737 100644 --- a/pkgs/applications/networking/browsers/qutebrowser/default.nix +++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix @@ -132,5 +132,6 @@ in mkDerivationWith python3Packages.buildPythonApplication rec { description = "Keyboard-focused browser with a minimal GUI"; license = licenses.gpl3Plus; maintainers = with maintainers; [ jagajaga rnhmjoj ebzzry dotlambda ]; + inherit (backendPackage.meta) platforms; }; } From e134ec7dbb7b44e05f4c7dd87c84b84978038567 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 24 Apr 2022 22:21:33 -0700 Subject: [PATCH 4/4] calibre: omit pyqtwebengine on unsupported platforms --- pkgs/applications/misc/calibre/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index b3754fed1796..8f672deb693b 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -104,7 +104,6 @@ mkDerivation rec { pillow pyqt-builder pyqt5 - pyqtwebengine python regex sip @@ -114,6 +113,11 @@ mkDerivation rec { pycryptodome # the following are distributed with calibre, but we use upstream instead odfpy + ] ++ lib.optionals (lib.lists.any (p: p == stdenv.hostPlatform.system) pyqtwebengine.meta.platforms) [ + # much of calibre's functionality is usable without a web + # browser, so we enable building on platforms which qtwebengine + # does not support by simply omitting qtwebengine. + pyqtwebengine ] ++ lib.optional (unrarSupport) unrardll );