qt6.wrapQtAppsHook: don't include qtwayland

The base windowing integration for Wayland lives in qtbase now,
and qtwayland only provides libadwaita decorations, which are
only relevant on GNOME-likes without server-side decoration support,
and should probably be installed by the appropriate modules.
This commit is contained in:
K900
2025-10-21 16:20:17 +03:00
parent 39e5c3503a
commit 36dba6e1cc
7 changed files with 8 additions and 35 deletions

View File

@@ -25,15 +25,7 @@ stdenv.mkDerivation {
The same goes for Qt 5 where libraries and tools are under `libsForQt5`.
Any Qt package should include `wrapQtAppsHook` or `wrapQtAppsNoGuiHook` in `nativeBuildInputs`, or explicitly set `dontWrapQtApps` to bypass generating the wrappers.
::: {.note}
`wrapQtAppsHook` propagates plugins and QML components from `qtwayland` on platforms that support it, to allow applications to act as native Wayland clients. It should be used for all graphical applications.
`wrapQtAppsNoGuiHook` does not propagate `qtwayland` to reduce closure size for purely command-line applications.
:::
Any Qt package should include `wrapQtAppsHook` in `nativeBuildInputs`, or explicitly set `dontWrapQtApps` to bypass generating the wrappers.
## Packages supporting multiple Qt versions {#qt-versions}

View File

@@ -83,12 +83,7 @@ stdenv.mkDerivation rec {
extra-cmake-modules
rustc
rustPlatform.cargoSetupHook
(
if buildClient || buildServerGui then
qt6Packages.wrapQtAppsHook
else
qt6Packages.wrapQtAppsNoGuiHook
)
qt6Packages.wrapQtAppsHook
];
buildInputs = [

View File

@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
meson
ninja
pkg-config
qt6.wrapQtAppsNoGuiHook
qt6.wrapQtAppsHook
];
buildInputs = [

View File

@@ -89,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: {
cmake
copyDesktopItems
pkg-config
qt6Packages.wrapQtAppsNoGuiHook
qt6Packages.wrapQtAppsHook
];
postInstall = ''

View File

@@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake
kdePackages.wrapQtAppsNoGuiHook
kdePackages.wrapQtAppsHook
]
++ lib.optionals (withGstreamer || withOmemo) [
pkg-config

View File

@@ -131,20 +131,6 @@ let
makeSetupHook {
name = "wrap-qt6-apps-hook";
propagatedBuildInputs = [ makeBinaryWrapper ];
depsTargetTargetPropagated = [
(onlyPluginsAndQml qtbase)
]
++ lib.optionals (lib.meta.availableOn stdenv.targetPlatform qtwayland) [
(onlyPluginsAndQml qtwayland)
];
} ./hooks/wrap-qt-apps-hook.sh
) { };
wrapQtAppsNoGuiHook = callPackage (
{ makeBinaryWrapper, qtbase }:
makeSetupHook {
name = "wrap-qt6-apps-no-gui-hook";
propagatedBuildInputs = [ makeBinaryWrapper ];
depsTargetTargetPropagated = [
(onlyPluginsAndQml qtbase)
];
@@ -164,6 +150,7 @@ let
}
// lib.optionalAttrs config.allowAliases {
full = throw "qt6.full has been removed. Please use individual packages instead."; # Added 2025-10-21
wrapQtAppsNoGuiHook = lib.warn "wrapQtAppsNoGuiHook is deprecated, use wrapQtAppsHook instead" self.wrapQtAppsHook;
};
baseScope = makeScopeWithSplicing' {

View File

@@ -77,11 +77,10 @@ else # Only set up Qt once.
fi
qtPreHook() {
# Check that wrapQtAppsHook/wrapQtAppsNoGuiHook is used, or it is explicitly disabled.
# Check that wrapQtAppsHook is used, or it is explicitly disabled.
if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then
echo >&2 "Error: this derivation depends on qtbase, but no wrapping behavior was specified."
echo >&2 " - If this is a graphical application, add wrapQtAppsHook to nativeBuildInputs"
echo >&2 " - If this is a CLI application, add wrapQtAppsNoGuiHook to nativeBuildInputs"
echo >&2 " - If this is an application, add wrapQtAppsHook to nativeBuildInputs"
echo >&2 " - If this is a library or you need custom wrapping logic, set dontWrapQtApps = true"
exit 1
fi