From a2440fb078b98dbc2a40260675284cf476def57a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 3 Nov 2023 22:25:17 -0700 Subject: [PATCH] pyqt5: fix cross --- pkgs/development/python-modules/pyqt/5.x.nix | 55 ++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 12d2ea182af0..c514b9f83584 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -12,6 +12,7 @@ , pyqt5_sip , pyqt-builder , libsForQt5 +, enableVerbose ? true , withConnectivity ? false , withMultimedia ? false , withWebKit ? false @@ -19,6 +20,9 @@ , withLocation ? false , withSerialPort ? false , withTools ? false +, pkgsBuildTarget +, buildPackages +, dbusSupport ? !stdenv.isDarwin }: buildPythonPackage rec { @@ -45,6 +49,7 @@ buildPythonPackage rec { # be more verbose '' cat >> pyproject.toml < PyQt_PrintDialog + # QT_NO_PRINTER => PyQt_Printer + # QT_NO_PRINTPREVIEWDIALOG => PyQt_PrintPreviewDialog + # QT_NO_PRINTPREVIEWWIDGET => PyQt_PrintPreviewWidget + # QT_NO_SSL => PyQt_SSL + # QT_SHARED || QT_DLL => shared (otherwise static) + # QT_NO_PROCESS => PyQt_Process + # QT_NO_FPU || Q_PROCESSOR_ARM || Q_OS_WINCE => PyQt_qreal_double + # sizeof (qreal) != sizeof (double) => PyQt_qreal_double + # !Q_COMPILER_CONSTEXPR !Q_COMPILER_UNIFORM_INIT => PyQt_CONSTEXPR + # QT_NO_ACCESSIBILITY => PyQt_Accessibility + # QT_NO_OPENGL => PyQt_OpenGL PyQt_Desktop_OpenGL + # defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_3) => PyQt_Desktop_OpenGL + # QT_NO_RAWFONT => PyQt_RawFont + # QT_NO_SESSIONMANAGER => PyQt_SessionManager + # + + lib.optionalString (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) '' + rm config-tests/cfgtest_QtCore.cpp + rm config-tests/cfgtest_QtGui.cpp + rm config-tests/cfgtest_QtNetwork.cpp + rm config-tests/cfgtest_QtPrintSupport.cpp ''; enableParallelBuilding = true; @@ -68,16 +104,27 @@ buildPythonPackage rec { export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}" ''; + # tons of warnings from subpackages, no point in playing whack-a-mole + env = lib.optionalAttrs (!enableVerbose) { + NIX_CFLAGS_COMPILE = "-w"; + }; + outputs = [ "out" "dev" ]; dontWrapQtApps = true; - nativeBuildInputs = with libsForQt5; [ + nativeBuildInputs = [ pkg-config - qmake + ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + libsForQt5.qmake + ] ++ [ setuptools lndir sip + ] ++ (with pkgsBuildTarget.targetPackages.libsForQt5; [ + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + qmake + ] ++ [ qtbase qtsvg qtdeclarative @@ -90,11 +137,13 @@ buildPythonPackage rec { ++ lib.optional withLocation qtlocation ++ lib.optional withSerialPort qtserialport ++ lib.optional withTools qttools - ; + ); buildInputs = with libsForQt5; [ dbus + ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ qtbase + ] ++ [ qtsvg qtdeclarative pyqt-builder