qt5.pyqtwebengine: fix cross

This commit is contained in:
Adam Joseph 2023-11-03 22:20:23 -07:00 committed by Adam Joseph
parent 80c4676224
commit b7b8175963

View file

@ -1,13 +1,14 @@
{ lib, stdenv, pythonPackages, fetchPypi, pkg-config { lib, stdenv, pythonPackages, fetchPypi, pkg-config
, qmake, qtbase, qtsvg, qtwebengine , qmake, qtbase, qtsvg, qtwebengine, qtwebchannel, qtdeclarative
, wrapQtAppsHook , wrapQtAppsHook
, darwin , darwin
, buildPackages
}: }:
let let
inherit (pythonPackages) buildPythonPackage python isPy27 pyqt5 sip pyqt-builder; inherit (pythonPackages) buildPythonPackage python isPy27 pyqt5 sip pyqt-builder;
inherit (darwin) autoSignDarwinBinariesHook; inherit (darwin) autoSignDarwinBinariesHook;
in buildPythonPackage rec { in buildPythonPackage (rec {
pname = "PyQtWebEngine"; pname = "PyQtWebEngine";
version = "5.15.4"; version = "5.15.4";
format = "pyproject"; format = "pyproject";
@ -29,12 +30,18 @@ in buildPythonPackage rec {
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
qmake qmake
] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
sip sip
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.python3Packages.sip
] ++ [
qtbase qtbase
qtsvg qtsvg
qtwebengine qtwebengine
pyqt-builder pyqt-builder
pythonPackages.setuptools pythonPackages.setuptools
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
qtdeclarative
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
autoSignDarwinBinariesHook autoSignDarwinBinariesHook
]; ];
@ -44,6 +51,9 @@ in buildPythonPackage rec {
qtbase qtbase
qtsvg qtsvg
qtwebengine qtwebengine
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
qtwebchannel
qtdeclarative
]; ];
propagatedBuildInputs = [ pyqt5 ]; propagatedBuildInputs = [ pyqt5 ];
@ -71,6 +81,13 @@ in buildPythonPackage rec {
description = "Python bindings for Qt5"; description = "Python bindings for Qt5";
homepage = "http://www.riverbankcomputing.co.uk"; homepage = "http://www.riverbankcomputing.co.uk";
license = licenses.gpl3; license = licenses.gpl3;
platforms = lib.lists.intersectLists qtwebengine.meta.platforms platforms.mesaPlatforms; hydraPlatforms = lib.lists.intersectLists qtwebengine.meta.platforms platforms.mesaPlatforms;
}; };
} } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
# TODO: figure out why the env hooks aren't adding these inclusions automatically
env.NIX_CFLAGS_COMPILE =
lib.concatStringsSep " " [
"-I${lib.getDev qtbase}/include/QtPrintSupport/"
"-I${lib.getDev qtwebchannel}/include/QtWebChannel/"
];
})