{ qtModule, qtbase, qtlanguageserver, qtshadertools, qtsvg, openssl, darwin, stdenv, lib, pkgsBuildBuild, replaceVars, fetchpatch, }: qtModule { pname = "qtdeclarative"; propagatedBuildInputs = [ qtbase qtlanguageserver qtshadertools qtsvg openssl ]; strictDeps = true; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; patches = [ # don't cache bytecode of bare qml files in the store, as that never gets cleaned up (replaceVars ./dont-cache-nix-store-paths.patch { nixStore = builtins.storeDir; }) # add version specific QML import path ./use-versioned-import-path.patch # revert codesigning change on Darwin that doesn't work with our signing tools (fetchpatch { url = "https://github.com/qt/qtdeclarative/commit/a7084abd9778b955d80e7419e82f6f7b92f7978d.diff"; hash = "sha256-ESy35OlmsvI4yFQ/rFT8oelOUBCwCmlcbQJvwcTrCig="; revert = true; }) ]; cmakeFlags = [ "-DQt6ShaderToolsTools_DIR=${pkgsBuildBuild.qt6.qtshadertools}/lib/cmake/Qt6ShaderTools" # for some reason doesn't get found automatically on Darwin "-DPython_EXECUTABLE=${lib.getExe pkgsBuildBuild.python3}" ] # Conditional is required to prevent infinite recursion during a cross build ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "-DQt6QmlTools_DIR=${pkgsBuildBuild.qt6.qtdeclarative}/lib/cmake/Qt6QmlTools" ]; meta.maintainers = with lib.maintainers; [ nickcao outfoxxed ]; }