Skip to content

Build gtk3 with wayland#7038

Merged
AenBleidd merged 1 commit intomasterfrom
vko_linux_enable_wayland
Apr 26, 2026
Merged

Build gtk3 with wayland#7038
AenBleidd merged 1 commit intomasterfrom
vko_linux_enable_wayland

Conversation

@AenBleidd
Copy link
Copy Markdown
Member

@AenBleidd AenBleidd commented Apr 26, 2026

Summary by cubic

Enable native Wayland support on Linux by adding gtk3[wayland] and force-building Wayland libraries. Improve CI/Snap builds by installing flex and passing the host triplet to vcpkg.

  • Dependencies
    • Added gtk3 with features: ["wayland"] and a custom port with patches to disable Meson post-install schema steps for cross builds, link GTK tools as C++ to fix Cairo linkage, and avoid a multiple-definition in the inspector; libxkbcommon is pulled via gtk3[wayland].
    • Force-built wayland and wayland-protocols; set X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES ON across Linux triplets; used the vcpkg wayland-scanner path; passed --host-triplet from snapcraft.yaml to linux/update_vcpkg_manager.sh.

Written for commit 30b53e1. Summary will update on new commits.

Copilot AI review requested due to automatic review settings April 26, 2026 01:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Linux CI vcpkg triplets and dependencies to build GTK3 with Wayland support.

Changes:

  • Force Wayland libraries in Linux CI vcpkg triplets.
  • Add gtk3 dependency configured with the wayland feature for the Linux manager vcpkg manifest.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
3rdParty/vcpkg_ports/triplets/ci/x64-linux.cmake Enables forced Wayland library selection in x64 Linux CI triplet.
3rdParty/vcpkg_ports/triplets/ci/snap-linux-arm64.cmake Enables forced Wayland library selection in arm64 Snap CI triplet.
3rdParty/vcpkg_ports/triplets/ci/snap-linux-amd64.cmake Enables forced Wayland library selection in amd64 Snap CI triplet.
3rdParty/vcpkg_ports/triplets/ci/arm64-linux-release.cmake Enables forced Wayland library selection in arm64 Linux CI triplet.
3rdParty/vcpkg_ports/triplets/ci/arm-linux-release.cmake Enables forced Wayland library selection in arm Linux CI triplet.
3rdParty/vcpkg_ports/configs/manager/linux/vcpkg.json Adds gtk3 dependency with Wayland feature enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +36
"features": ["wayland"],
"default-features": false
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting "default-features": false for gtk3 while the CI triplets still force X libraries (X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON) can produce a mismatched build (e.g., GTK built without X11 backend while the rest of the dependency set expects/uses X11). If the intent is “GTK with Wayland support in addition to existing X11 support”, prefer keeping default features enabled or explicitly enabling both relevant GTK features (e.g., include x11 alongside wayland) so the build configuration matches the triplet’s forced X library usage.

Suggested change
"features": ["wayland"],
"default-features": false
"features": ["wayland"]

Copilot uses AI. Check for mistakes.
@@ -19,4 +19,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/../../vcpkg_root_find.cmake)
include(${VCPKG_ROOT}/triplets/x64-linux.cmake)

set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new CI-wide behavior toggle, but the triplet doesn’t document what consumes X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES (e.g., which ports/toolchain logic checks it, and what effect it has). Add a brief comment near this line explaining its purpose and expected impact so future triplet changes don’t accidentally remove/duplicate it.

Suggested change
set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
# CI-only toggle consumed by vcpkg port/toolchain logic that honors this variable
# to prefer vcpkg-provided Wayland libraries over system ones; keep this alongside
# the X11 equivalent above so Wayland dependency resolution stays consistent in CI.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to +22
set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
set(X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES ON)
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same flag is now repeated across multiple CI triplets. To reduce drift (e.g., one triplet missing the flag later), consider factoring this into a shared included .cmake (similar to how vcpkg_root_find.cmake is included) or a common “ci linux defaults” triplet fragment that each CI triplet includes.

Suggested change
set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
set(X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES ON)
set(BOINC_CI_FORCED_VCPKG_LIBRARIES
X_VCPKG_FORCE_VCPKG_X_LIBRARIES
X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES
)
foreach(BOINC_CI_FORCED_VCPKG_LIBRARY IN LISTS BOINC_CI_FORCED_VCPKG_LIBRARIES)
set(${BOINC_CI_FORCED_VCPKG_LIBRARY} ON)
endforeach()

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 26, 2026 02:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 21 to 23
set(X_VCPKG_FORCE_VCPKG_X_LIBRARIES ON)
set(X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES ON)
set(VCPKG_BUILD_TYPE release)
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set(X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES ON) is duplicated across multiple CI triplets in this PR. To reduce drift and make future updates easier, consider factoring this into a shared include (similar to vcpkg_root_find.cmake) or a common base triplet that the CI triplets include.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 26, 2026 03:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"port-version": 1,
"description": "Portable library for creating graphical user interfaces.",
"homepage": "https://www.gtk.org/",
"license": null,
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license is set to null. Other in-repo overlay ports provide an SPDX license string (e.g., gdk-pixbuf uses LGPL-2.1-or-later). Set this to GTK's correct SPDX identifier so downstream tooling and compliance checks can rely on it.

Suggested change
"license": null,
"license": "LGPL-2.1-or-later",

Copilot uses AI. Check for mistakes.
"supports": "linux | freebsd | openbsd",
"dependencies": [
"libxkbcommon",
"wayland",
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The portfile optionally injects wayland-scanner from ${CURRENT_HOST_INSTALLED_DIR}/tools/wayland/..., but the wayland feature only declares target dependencies. For cross-compiles (e.g. arm/arm64), this can fail because the host triplet won’t have wayland-scanner installed. Add a host dependency on wayland (and any other build-time Wayland tools, if needed) under the wayland feature so the scanner is available in the host installed dir.

Suggested change
"wayland",
"wayland",
{
"name": "wayland",
"host": true
},

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 26, 2026 04:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread snap/snapcraft.yaml
linux/update_vcpkg_manager.sh $triplet
# first parameter is the target triplet
# second parameter is the host triplet
# this needs to be changed is ever this will support a cross-compilation scenario
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added comment lines are not indented to the same level as the override-build: | block content, which will terminate the YAML block scalar early and make the subsequent linux/update_vcpkg_manager.sh ... line invalid YAML. Indent these comments to match the other script lines (or move them outside the block), and while touching it fix the wording (“if ever this will support…”) to avoid confusion.

Suggested change
# this needs to be changed is ever this will support a cross-compilation scenario
# this needs to be changed if this ever supports a cross-compilation scenario

Copilot uses AI. Check for mistakes.
if("wayland" IN_LIST FEATURES)
list(APPEND OPTIONS -Dwayland_backend=true)
if(X_VCPKG_FORCE_VCPKG_WAYLAND_LIBRARIES)
list(APPEND BINARIES "wayland-scanner = '${CURRENT_HOST_INSTALLED_DIR}/tools/wayland/wayland-scanner${VCPKG_HOST_EXECUTABLE_SUFFIX}'")
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Meson native-file binaries entry is added as "wayland-scanner = '…'" with spaces around =. Other ports in this repo pass ADDITIONAL_BINARIES entries without spaces (e.g., glib-genmarshal='…'). Use the same format here to avoid subtle parsing issues in the generated native file and to keep the overlay consistent.

Suggested change
list(APPEND BINARIES "wayland-scanner = '${CURRENT_HOST_INSTALLED_DIR}/tools/wayland/wayland-scanner${VCPKG_HOST_EXECUTABLE_SUFFIX}'")
list(APPEND BINARIES "wayland-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/wayland/wayland-scanner${VCPKG_HOST_EXECUTABLE_SUFFIX}'")

Copilot uses AI. Check for mistakes.
install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal'))

-if not meson.is_cross_build()
+if false
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch disables gnome.post_install() unconditionally (if false). That post-install step is responsible for generating runtime artifacts like gschemas.compiled (and module cache updates) as indicated by glib_compile_schemas: true in the same block. Disabling it for native builds can lead to missing compiled schemas at runtime. Prefer keeping the original if not meson.is_cross_build() guard, or replicate the required post-install actions in the portfile after vcpkg_install_meson() so the installed package remains usable.

Suggested change
+if false
+if not meson.is_cross_build()

Copilot uses AI. Check for mistakes.
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

@AenBleidd AenBleidd merged commit 666c0da into master Apr 26, 2026
469 checks passed
@AenBleidd AenBleidd deleted the vko_linux_enable_wayland branch April 26, 2026 06:44
@github-project-automation github-project-automation Bot moved this from In progress to Merged in Client/Manager Apr 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread snap/snapcraft.yaml
linux/update_vcpkg_manager.sh $triplet
# first parameter is the target triplet
# second parameter is the host triplet
# this needs to be changed is ever this will support a cross-compilation scenario
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo/grammar in the comment: "this needs to be changed is ever" should be "this needs to be changed if ever" (or rephrase) to avoid confusion for future cross-compilation work.

Suggested change
# this needs to be changed is ever this will support a cross-compilation scenario
# this needs to be changed if we ever support a cross-compilation scenario

Copilot uses AI. Check for mistakes.
AenBleidd added a commit that referenced this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

2 participants