diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index c0a20503e64c0..da37506d9c16f 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -39,6 +39,7 @@ , libepoxy , libiconv , dbus +, dbusSupport ? true , fontconfig , freetype , glib @@ -68,6 +69,7 @@ , xcbutilwm , zlib , at-spi2-core +, odbcSupport ? stdenv.buildPlatform == stdenv.hostPlatform , unixODBC , unixODBCDrivers # darwin @@ -94,10 +96,49 @@ , debug ? false , developerBuild ? false , qttranslations ? null +, buildPackages +, pkgsBuildHost +, writeText }: let debugSymbols = debug || developerBuild; + + # Cross Compilation support + # + # NOTE! You must use `targetPlatform` instead of `hostPlatform` + # almost everywhere in this file. This is necessary because our + # qtbase expression has "the GCC problem": it builds both a + # compiler-like tool (qmake) and its target libraries (qtbase) as + # part of a single derivation. We should stop doing this. + + qtPlatformCross = plat: with plat; + if isLinux + then "linux-generic-g++" + else throw "Please add a qtPlatformCross entry for ${plat.config}"; + + specsDirName = "nixpkgs-${stdenv.targetPlatform.config}"; + specsFile = writeText "qmake.conf" ('' + MAKEFILE_GENERATOR = UNIX + CONFIG += incremental + QMAKE_INCREMENTAL_STYLE = sublib + '' + lib.optionalString stdenv.hostPlatform.isLinux '' + include(../common/linux.conf) + '' + lib.optionalString stdenv.cc.isGNU '' + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) + '' + '' + QMAKE_CC = ${stdenv.cc.targetPrefix}gcc + QMAKE_CXX = ${stdenv.cc.targetPrefix}g++ + QMAKE_LINK = ${stdenv.cc.targetPrefix}g++ + QMAKE_LINK_SHLIB = ${stdenv.cc.targetPrefix}g++ + QMAKE_AR = ${stdenv.cc.targetPrefix}ar cqs + QMAKE_OBJCOPY = ${stdenv.cc.targetPrefix}objcopy + QMAKE_NM = ${stdenv.cc.targetPrefix}nm -P + QMAKE_STRIP = ${stdenv.cc.targetPrefix}strip + load(qt_config) + ''); + in stdenv.mkDerivation rec { pname = "qtbase"; @@ -126,15 +167,18 @@ stdenv.mkDerivation rec { double-conversion libb2 md4c + ] ++ lib.optionals dbusSupport [ dbus + ] ++ [ glib + ] ++ lib.optionals odbcSupport [ # unixODBC drivers unixODBCDrivers.psql unixODBCDrivers.sqlite unixODBCDrivers.mariadb ] ++ lib.optionals systemdSupport [ systemd - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.targetPlatform.isLinux [ util-linux mtdev lksctp-tools @@ -179,6 +223,8 @@ stdenv.mkDerivation rec { ] ++ lib.optional libGLSupported libGL; buildInputs = [ + python3 + ] ++ lib.optionals dbusSupport [ at-spi2-core ] ++ lib.optionals (!stdenv.isDarwin) [ libinput @@ -208,6 +254,9 @@ stdenv.mkDerivation rec { substituteInPlace src/corelib/CMakeLists.txt --replace /bin/ls ${coreutils}/bin/ls '' + lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/QtAutoDetect.cmake --replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" + '' + lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) '' + install -DT ${specsFile} mkspecs/${specsDirName}/qmake.conf + ln -s ../linux-g++/qplatformdefs.h mkspecs/${specsDirName}/qplatformdefs.h ''; fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh; @@ -231,10 +280,24 @@ stdenv.mkDerivation rec { "-DQT_FEATURE_sctp=ON" "-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}" "-DQT_FEATURE_vulkan=ON" + "-DQT_FEATURE_dbus=${if dbusSupport then "ON" else "OFF"}" ] ++ lib.optionals stdenv.isDarwin [ # error: 'path' is unavailable: introduced in macOS 10.15 "-DQT_FEATURE_cxx17_filesystem=OFF" - ] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.targetPlatform) [ + # Useful: https://raw.githubusercontent.com/qt/qtbase/dev/cmake/configure-cmake-mapping.md + #"-DQT_QMAKE_TARGET_MKSPEC=${specsDirName}" + #"-DFEATURE_thread=ON" + #"-DQT_BUILD_SHARED_LIBS=ON" + #"-DQT_FORCE_BUILD_TOOLS=TRUE" + "-DQT_QMAKE_TARGET_MKSPEC=devices/${qtPlatformCross stdenv.hostPlatform}" + "-DQT_QMAKE_DEVICE_OPTIONS=CROSS_COMPILE=${stdenv.cc.targetPrefix}" + + #"-DQT_INSTALL_PREFIX=${builtins.placeholder "out"}" + "-DQT_HOST_PREFIX=${pkgsBuildHost.qt6Packages.qtbase}" + ] + #++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations" + ; NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [ # Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc" @@ -249,7 +312,11 @@ stdenv.mkDerivation rec { moveToOutput "mkspecs/modules" "$dev" fixQtModulePaths "$dev/mkspecs/modules" fixQtBuiltinPaths "$out" '*.pr?' - ''; + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.targetPlatform) '' + ln -s "${pkgsBuildHost.qt6Packages.qtbase}/libexec/moc" $out/libexec/moc || true + '' + ; dontStrip = debugSymbols; diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix index afdb24d1d291a..d2e4d75024fe4 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix @@ -1,14 +1,31 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtlanguageserver , qtshadertools +, qtdeclarative , openssl , python3 +, buildPackages +, pkgsBuildBuild +, pkgsBuildHost +, pkgsBuildTarget }: qtModule { pname = "qtdeclarative"; - propagatedBuildInputs = [ qtbase qtlanguageserver qtshadertools openssl python3 ]; + buildInputs = [ + openssl + python3 + qtbase + ]; + nativeBuildInputs = [ + python3 + qtbase + qtshadertools + ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; patches = [ # prevent headaches from stale qmlcache data ../patches/qtdeclarative-default-disable-qmlcache.patch diff --git a/pkgs/development/libraries/qt-6/modules/qtlocation.nix b/pkgs/development/libraries/qt-6/modules/qtlocation.nix index 12fa89b9aaead..376ded1d54984 100644 --- a/pkgs/development/libraries/qt-6/modules/qtlocation.nix +++ b/pkgs/development/libraries/qt-6/modules/qtlocation.nix @@ -1,10 +1,14 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtdeclarative , qtpositioning +, pkgsBuildHost }: qtModule { pname = "qtlocation"; propagatedBuildInputs = [ qtbase qtdeclarative qtpositioning ]; + nativeQtBuildInputs = [ "qtpositioning" "qtdeclarative" ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix index 538687dce58a0..03e27a2c26bfa 100644 --- a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix @@ -12,7 +12,7 @@ , gst-plugins-good , gst-libav , gst-vaapi -, libpulseaudio +, pulseaudioSupport ? stdenv.hostPlatform.isLinux, libpulseaudio , wayland , elfutils , libunwind @@ -24,11 +24,13 @@ qtModule { pname = "qtmultimedia"; nativeBuildInputs = [ pkg-config ]; buildInputs = [ libunwind orc ] - ++ lib.optionals stdenv.isLinux [ libpulseaudio elfutils alsa-lib wayland ]; - propagatedBuildInputs = [ qtbase qtdeclarative qtsvg qtshadertools ] + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] ++ lib.optionals stdenv.isLinux [ elfutils alsa-lib wayland ]; + propagatedBuildInputs = [ qtbase qtdeclarative qtsvg ] ++ lib.optionals stdenv.isLinux [ gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi ] ++ lib.optionals stdenv.isDarwin [ VideoToolbox ]; + nativeQtBuildInputs = [ "qtshadertools" "qtdeclarative" ]; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-include AudioToolbox/AudioToolbox.h"; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin diff --git a/pkgs/development/libraries/qt-6/modules/qtpositioning.nix b/pkgs/development/libraries/qt-6/modules/qtpositioning.nix index 20f059976323c..d9546136d2751 100644 --- a/pkgs/development/libraries/qt-6/modules/qtpositioning.nix +++ b/pkgs/development/libraries/qt-6/modules/qtpositioning.nix @@ -1,14 +1,19 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtdeclarative , qtserialport , pkg-config , openssl +, pkgsBuildHost }: qtModule { pname = "qtpositioning"; - propagatedBuildInputs = [ qtbase qtdeclarative qtserialport ]; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl ]; + propagatedBuildInputs = [ qtbase qtserialport ]; + nativeBuildInputs = [ qtbase.dev pkg-config ]; + buildInputs = [ openssl qtdeclarative ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; } + diff --git a/pkgs/development/libraries/qt-6/modules/qtquick3d.nix b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix index 1c84856c0c129..d05b3d3f5c526 100644 --- a/pkgs/development/libraries/qt-6/modules/qtquick3d.nix +++ b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix @@ -1,11 +1,19 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtdeclarative +, qtshadertools , openssl +, pkgsBuildHost }: qtModule { pname = "qtquick3d"; - propagatedBuildInputs = [ qtbase qtdeclarative ]; - buildInputs = [ openssl ]; + propagatedBuildInputs = [ qtbase ]; + nativeBuildInputs = [ qtshadertools ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; + buildInputs = [ openssl qtdeclarative ]; + dontIgnorePath = true; } + diff --git a/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix b/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix index 9ac9c1f093934..e6de8135ec74f 100644 --- a/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix +++ b/pkgs/development/libraries/qt-6/modules/qtquicktimeline.nix @@ -1,9 +1,14 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtdeclarative +, pkgsBuildHost }: qtModule { pname = "qtquicktimeline"; propagatedBuildInputs = [ qtbase qtdeclarative ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; } + diff --git a/pkgs/development/libraries/qt-6/modules/qtshadertools.nix b/pkgs/development/libraries/qt-6/modules/qtshadertools.nix index 5a4b894b9abd6..0337ce1e077be 100644 --- a/pkgs/development/libraries/qt-6/modules/qtshadertools.nix +++ b/pkgs/development/libraries/qt-6/modules/qtshadertools.nix @@ -1,8 +1,10 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase }: qtModule { pname = "qtshadertools"; - propagatedBuildInputs = [ qtbase ]; + buildInputs = [ qtbase ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qtwayland.nix b/pkgs/development/libraries/qt-6/modules/qtwayland.nix index ddd402f3c2221..25166885659a4 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwayland.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwayland.nix @@ -1,15 +1,22 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtquick3d , qtdeclarative +, qtwayland , wayland +, wayland-scanner , pkg-config , libdrm +, pkgsBuildHost +, pkgsBuildBuild }: qtModule { pname = "qtwayland"; - propagatedBuildInputs = [ qtbase qtdeclarative ]; - buildInputs = [ wayland libdrm ]; - nativeBuildInputs = [ pkg-config ]; + propagatedBuildInputs = [ qtbase ]; + buildInputs = [ (lib.getLib wayland) libdrm qtdeclarative ]; + nativeBuildInputs = [ pkg-config wayland-scanner ]; } + diff --git a/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix b/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix index bf0ba0f633858..1d211ea18f777 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebchannel.nix @@ -9,4 +9,5 @@ qtModule { pname = "qtwebchannel"; propagatedBuildInputs = [ qtbase qtdeclarative qtwebsockets ]; buildInputs = [ openssl ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index 8670fba6bb2a6..fcf73cc68d591 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -43,11 +43,11 @@ , libevent , openssl , alsa-lib -, pulseaudio +, pulseaudioSupport ? stdenv.hostPlatform.isLinux, pulseaudio , libcap , pciutils , systemd -, pipewire +, pipewireSupport ? stdenv.hostPlatform.isLinux, pipewire , gn , ffmpeg_4 , lib @@ -129,7 +129,9 @@ qtModule { # See https://github.com/NixOS/nixpkgs/issues/226484 for more context. ../patches/qtwebengine-xkb-includes.patch + ] ++ lib.optionals pulseaudioSupport [ ../patches/qtwebengine-link-pulseaudio.patch + ] ++ [ # Override locales install path so they go to QtWebEngine's $out ../patches/qtwebengine-locales-path.patch @@ -191,7 +193,7 @@ qtModule { # "-DQT_FEATURE_webengine_native_spellchecker=ON" "-DQT_FEATURE_webengine_sanitizer=ON" "-DQT_FEATURE_webengine_kerberos=ON" - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals pipewireSupport [ "-DQT_FEATURE_webengine_webrtc_pipewire=ON" ] ++ lib.optionals enableProprietaryCodecs [ "-DQT_FEATURE_webengine_proprietary_codecs=ON" @@ -241,7 +243,9 @@ qtModule { # Audio formats alsa-lib + ] ++ lib.optionals pulseaudioSupport [ pulseaudio + ] ++ [ # Text rendering fontconfig @@ -265,8 +269,10 @@ qtModule { libXi xorg.libXext + ] ++ lib.optionals pipewireSupport [ # Pipewire pipewire + ] ++ [ libkrb5 mesa diff --git a/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix b/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix index c3a346a8d78a6..eeff475f1eaff 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebsockets.nix @@ -1,11 +1,16 @@ -{ qtModule +{ lib +, stdenv +, qtModule , qtbase , qtdeclarative , openssl +, pkgsBuildHost }: qtModule { pname = "qtwebsockets"; propagatedBuildInputs = [ qtbase qtdeclarative ]; buildInputs = [ openssl ]; + nativeQtBuildInputs = [ "qtdeclarative" ]; } + diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index 5434be84fa595..36ba2a382bc1b 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -6,6 +6,7 @@ , moveBuildTree , srcs , patches ? [ ] +, pkgsBuildHost }: args: @@ -15,7 +16,7 @@ let version = args.version or srcs.${pname}.version; src = args.src or srcs.${pname}.src; in -stdenv.mkDerivation (args // { +(stdenv.mkDerivation ((builtins.removeAttrs args [ "dontIgnorePath" "nativeQtBuildInputs" ]) // { inherit pname version src; patches = args.patches or patches.${pname} or [ ]; @@ -39,4 +40,32 @@ stdenv.mkDerivation (args // { maintainers = with maintainers; [ milahu nickcao ]; platforms = platforms.unix; } // (args.meta or { }); -}) +})) + .overrideAttrs(previousAttrs: lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + strictDeps = true; + env = (previousAttrs.env or {}) // { QT_HOST_PATH = "${pkgsBuildHost.qt6Packages.qtbase}"; }; + cmakeFlags = [ + "-DQT_FORCE_BUILD_TOOLS=true" + ] ++ lib.optionals (!(args.dontIgnorePath or false)) [ + # When cross-compiling, QT's build process will ignore the + # $PATH, assuming a conventional FHS distro, all QT packages + # smashed together into a single installation directory, and + # poor hygiene on the part of the developer. Since we carefully + # manage our $PATH and install each package to a separate prefix + # it's okay for QT to trust the $PATH we expose to it. + # + # The bizzarrely-named + # `QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES` option is how you + # tell QT that we are smarter than it is. + # + # See: https://codereview.qt-project.org/gitweb?p=qt%2Fqtbase.git;a=commit;h=7bb91398f25cb2016c0558fd397b376f413e3e96 + # TODO: set this globally, everywhere. + "-DQT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES=true" + ] ++ lib.optional (args?nativeQtBuildInputs) + ("-DQT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH=${ + lib.concatMapStringsSep ":" + (pname: pkgsBuildHost.qt6Packages.${pname}) + args.nativeQtBuildInputs}") + ++ (previousAttrs.cmakeFlags or []); + }) + diff --git a/pkgs/development/python-modules/pyqt/6.x.nix b/pkgs/development/python-modules/pyqt/6.x.nix index 51f0341703e18..f81dba1d0f529 100644 --- a/pkgs/development/python-modules/pyqt/6.x.nix +++ b/pkgs/development/python-modules/pyqt/6.x.nix @@ -19,8 +19,14 @@ #, withConnectivity ? true , withPrintSupport ? true , cups +, buildPackages +, pkgsBuildTarget +, pkgsHostTarget +, pkgs }: +assert withWebSockets; + buildPythonPackage rec { pname = "PyQt6"; version = "6.5.2"; @@ -40,6 +46,9 @@ buildPythonPackage rec { # ./pyqt5-fix-dbus-mainloop-support.patch # confirm license when installing via pyqt6_sip ./pyqt5-confirm-license.patch + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + # Adapted from Void Linux + ./pyproject-cross.patch ]; # be more verbose @@ -65,37 +74,36 @@ buildPythonPackage rec { dontWrapQtApps = true; - nativeBuildInputs = with qt6Packages; [ + nativeBuildInputs = [ pkg-config lndir sip + buildPackages.stdenv.cc.cc + ] ++ (with pkgsBuildTarget.targetPackages.qt6Packages; [ + qmake qtbase - qtsvg qtdeclarative qtwebchannel - qmake - qtquick3d - qtquicktimeline - ] - # ++ lib.optional withConnectivity qtconnectivity - ++ lib.optional withMultimedia qtmultimedia - ++ lib.optional withWebSockets qtwebsockets - ++ lib.optional withLocation qtlocation - ; + ]); - buildInputs = with qt6Packages; [ + buildInputs = lib.optionals dbusSupport [ dbus + ] ++ (with qt6Packages; [ qtbase + qtbase.dev qtsvg qtdeclarative pyqt-builder qtquick3d + qtwebchannel + qtwebchannel.dev qtquicktimeline ] # ++ lib.optional withConnectivity qtconnectivity + ++ lib.optional withMultimedia qtmultimedia ++ lib.optional withWebSockets qtwebsockets ++ lib.optional withLocation qtlocation - ; + ); propagatedBuildInputs = [ dbus-python @@ -125,6 +133,7 @@ buildPythonPackage rec { "PyQt6.QtWidgets" "PyQt6.QtGui" "PyQt6.QtQuick" + "PyQt6.QtWebChannel" ] ++ lib.optional withWebSockets "PyQt6.QtWebSockets" ++ lib.optional withMultimedia "PyQt6.QtMultimedia" @@ -132,8 +141,16 @@ buildPythonPackage rec { ++ lib.optional withLocation "PyQt6.QtPositioning" ; - # fix build with qt 6.6 - env.NIX_CFLAGS_COMPILE = "-fpermissive"; + env = { + NIX_CFLAGS_COMPILE = lib.concatStringsSep " " ([ + # fix build with qt 6.6 + "-fpermissive" + ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Wno-cast-function-type" + ]); + } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + EMULATOR = stdenv.hostPlatform.emulator buildPackages; + }; meta = with lib; { description = "Python bindings for Qt6"; diff --git a/pkgs/development/python-modules/pyqt/pyproject-cross.patch b/pkgs/development/python-modules/pyqt/pyproject-cross.patch new file mode 100644 index 0000000000000..75bd4300a3ed6 --- /dev/null +++ b/pkgs/development/python-modules/pyqt/pyproject-cross.patch @@ -0,0 +1,19 @@ +Index: PyQt6-6.1.0/project.py +=================================================================== +--- PyQt6-6.1.0.orig/project.py ++++ PyQt6-6.1.0/project.py +@@ -49,6 +49,14 @@ class PyQt(PyQtProject): + # QtNfc, QtPositioning, QtLocation, QtRemoteObjects, QtSensors, + # QtSerialPort, QtTextToSpeech, QtWebChannel, QtWebSockets + ++ def run_command(self, args, *, fatal=True): ++ """ Run a command and display the output if requested. """ ++ emulator = os.environ.get("EMULATOR") ++ builddir = os.environ.get("NIX_BUILD_TOP") ++ if emulator and args[0].startswith(builddir): ++ args.insert(0, emulator) ++ super().run_command(args, fatal=fatal) ++ + def apply_user_defaults(self, tool): + """ Set default values where needed. """ + diff --git a/pkgs/development/python-modules/pyqt6-webengine.nix b/pkgs/development/python-modules/pyqt6-webengine.nix index d3b70a02f77dd..fe12b9d79085d 100644 --- a/pkgs/development/python-modules/pyqt6-webengine.nix +++ b/pkgs/development/python-modules/pyqt6-webengine.nix @@ -8,7 +8,12 @@ , qt6Packages , pythonOlder , pyqt6 +, pyqt6-sip +, setuptools , python +, pkgsHostTarget +, pkgsBuildTarget +, buildPackages }: buildPythonPackage rec { @@ -41,27 +46,38 @@ buildPythonPackage rec { # does not use the enableParallelBuilding flag postUnpack = '' export MAKEFLAGS+=" -j$NIX_BUILD_CORES" + export QT_ADDITIONAL_PACKAGES_PREFIX_PATH+="${qt6Packages.qtwebengine.dev}:${qt6Packages.qtwebengine}" + export QMAKEPATH+="${qt6Packages.qtwebengine.dev}:${qt6Packages.qtwebengine}" ''; outputs = [ "out" "dev" ]; dontWrapQtApps = true; - nativeBuildInputs = with qt6Packages; [ + nativeBuildInputs = [ pkg-config lndir - sip - qtwebengine - qmake - pyqt-builder + buildPackages.python3Packages.sip + pkgsHostTarget.qt6Packages.qtbase + pkgsHostTarget.qt6Packages.qmake + qt6Packages.qtbase + qt6Packages.qmake ]; buildInputs = with qt6Packages; [ + qtbase + qmake + qtdeclarative qtwebengine + qtwebengine.dev + pyqt6 + pyqt6-sip + pyqt-builder ]; propagatedBuildInputs = [ - pyqt6 + qt6Packages.qtbase + setuptools ]; passthru = {