diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index 5f82900903835..206691f607a32 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -207,6 +207,7 @@ let { inherit perl; inherit lib; + inherit buildPackages; # Use a variant of mkDerivation that does not include wrapQtApplications # to avoid cyclic dependencies between Qt modules. mkDerivation = @@ -317,7 +318,7 @@ let qmake = makeSetupHook { name = "qmake-hook"; - propagatedBuildInputs = [ self.qtbase.dev ]; + depsTargetTargetPropagated = [ self.qtbase.dev ]; substitutions = { inherit debug; fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh; @@ -326,7 +327,8 @@ let wrapQtAppsHook = makeSetupHook { name = "wrap-qt5-apps-hook"; - propagatedBuildInputs = [ self.qtbase.dev buildPackages.makeBinaryWrapper ] + propagatedBuildInputs = [ buildPackages.makeBinaryWrapper ]; + depsTargetTargetPropagated = [ self.qtbase.dev ] ++ lib.optional stdenv.isLinux self.qtwayland.dev; } ../hooks/wrap-qt-apps-hook.sh; } // lib.optionalAttrs config.allowAliases { diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index de73bcbe27724..4cf255e2c7399 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -28,6 +28,7 @@ , developerBuild ? false , decryptSslTraffic ? false , testers +, buildPackages }: let @@ -82,6 +83,11 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ] ++ lib.optionals stdenv.isDarwin [ xcbuild ]; + # `qtbase` expects to find `cc` (with no prefix) in the + # `$PATH`, so the following is needed even if + # `stdenv.buildPlatform.canExecute stdenv.hostPlatform` + depsBuildBuild = [ buildPackages.stdenv.cc ]; + propagatedNativeBuildInputs = [ lndir ]; # libQt5Core links calls CoreFoundation APIs that call into the system ICU. Binaries linked diff --git a/pkgs/development/libraries/qt-5/qtModule.nix b/pkgs/development/libraries/qt-5/qtModule.nix index 9abd9fabc9576..67e2abfd0adb4 100644 --- a/pkgs/development/libraries/qt-5/qtModule.nix +++ b/pkgs/development/libraries/qt-5/qtModule.nix @@ -1,4 +1,6 @@ -{ lib, mkDerivation, perl }: +{ lib, mkDerivation, perl +, buildPackages +}: let inherit (lib) licenses maintainers platforms; in @@ -16,8 +18,10 @@ mkDerivation (args // { inherit pname version src; patches = (args.patches or []) ++ (patches.${pname} or []); - nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ]; + nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake self.qtbase.dev ]; + propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []); + depsBuildBuild = [ buildPackages.stdenv.cc ]; outputs = args.outputs or [ "out" "dev" ]; setOutputFlags = args.setOutputFlags or false; diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 6bb268d21995c..de33f61ef9aab 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -19,6 +19,7 @@ , withLocation ? false , withSerialPort ? false , withTools ? false +, pkgsBuildTarget }: buildPythonPackage rec { @@ -55,6 +56,37 @@ buildPythonPackage rec { minimum-macos-version = "11.0" '' + '' EOF + '' + + # pyqt-builder tries to compile *and run* these programs. This + # is really sad because the only thing they do is print out a + # flag based on whether or not some compile-time symbol was + # defined. This could all be done without having to *execute* + # cross-compiled programs! + # + # Here is the complete list of things checked: + # + # QT_NO_PRINTDIALOG => 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; @@ -72,12 +104,13 @@ buildPythonPackage rec { dontWrapQtApps = true; - nativeBuildInputs = with libsForQt5; [ + nativeBuildInputs = (with libsForQt5; [ pkg-config qmake setuptools lndir sip + ]) ++ (with pkgsBuildTarget.targetPackages.libsForQt5; [ qtbase qtsvg qtdeclarative @@ -90,7 +123,7 @@ buildPythonPackage rec { ++ lib.optional withLocation qtlocation ++ lib.optional withSerialPort qtserialport ++ lib.optional withTools qttools - ; + ); buildInputs = with libsForQt5; [ dbus diff --git a/pkgs/misc/frescobaldi/default.nix b/pkgs/misc/frescobaldi/default.nix index 57baeb7fe828f..5be22418a92f6 100644 --- a/pkgs/misc/frescobaldi/default.nix +++ b/pkgs/misc/frescobaldi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPythonApplication, fetchFromGitHub, python3Packages, pyqtwebengine, lilypond }: +{ lib, stdenv, buildPythonApplication, fetchFromGitHub, python3Packages, pyqtwebengine, lilypond, gettext }: buildPythonApplication rec { pname = "frescobaldi"; @@ -22,7 +22,7 @@ buildPythonApplication rec { pyqtwebengine ]; - nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook ]; + nativeBuildInputs = [ pyqtwebengine.wrapQtAppsHook gettext ]; # Needed because source is fetched from git preBuild = ''