From 435aee2b1ea022df34e77cfee7302e1f7f6cc727 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 24 Jun 2025 17:18:25 -0600 Subject: [PATCH] Meta: Patch angle vcpkg to build on Linux This involves removing x11 dependencies, and not setting angle_use_x11. --- Libraries/LibWeb/CMakeLists.txt | 4 ++-- .../angle/cmake-buildsystem/CMakeLists.txt | 13 ------------- .../angle/cmake-buildsystem/PlatformLinux.cmake | 2 +- .../angle/cmake-buildsystem/PlatformWin.cmake | 2 +- Meta/CMake/vcpkg/overlay-ports/angle/portfile.cmake | 2 +- .../angle/unofficial-angle-config.cmake | 3 --- Meta/CMake/vcpkg/overlay-ports/angle/vcpkg.json | 12 ------------ vcpkg.json | 4 ++++ 8 files changed, 9 insertions(+), 33 deletions(-) diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 51f5b03bedb..45486a8a733 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -2,7 +2,7 @@ include(libweb_generators) include(vulkan) include(skia) -if (APPLE) +if (APPLE OR LINUX) find_package(unofficial-angle REQUIRED CONFIG) endif() @@ -1016,7 +1016,7 @@ serenity_lib(LibWeb web) target_link_libraries(LibWeb PRIVATE LibCore LibCompress LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests LibGC LibThreading skia) -if (APPLE) +if (APPLE OR LINUX) target_link_libraries(LibWeb PRIVATE unofficial::angle::libEGL unofficial::angle::libGLESv2) else() target_link_libraries(LibWeb PRIVATE GL) diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/CMakeLists.txt b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/CMakeLists.txt index e3129c6eb6f..e9491301210 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/CMakeLists.txt +++ b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/CMakeLists.txt @@ -106,9 +106,6 @@ elseif (WIN32) set(angle_enable_d3d11 TRUE) elseif (UNIX) set(is_linux TRUE) - if(LINUX) - set(angle_use_x11 TRUE) - endif() endif () # VCPKG EDIT: end vcpkg modified block @@ -384,16 +381,6 @@ add_library(ANGLE::ANGLE ALIAS ANGLEFramework) #### VCPKG EDIT: #### various vcpkg additions and install commands -# X11 support -if (angle_use_x11) - find_package(X11 COMPONENTS Xext Xi REQUIRED) - target_include_directories(ANGLE PRIVATE ${X11_INCLUDE_DIR}) - target_sources(ANGLE PRIVATE ${libangle_gpu_info_util_x11_sources}) - target_sources(ANGLE PRIVATE "src/gpu_info_util/SystemInfo_x11.cpp") - target_compile_definitions(ANGLE PRIVATE ANGLE_USE_X11 GPU_INFO_USE_X11) - target_link_libraries(ANGLE PRIVATE ${X11_LIBRARIES} X11::X11 X11::Xi X11::Xext) -endif() - # set export names of some targets to match prior vcpkg port buildsystem if(TARGET EGL) set_target_properties(EGL PROPERTIES EXPORT_NAME libEGL) diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformLinux.cmake b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformLinux.cmake index 018bf7f85e3..4a1f9ca3a2b 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformLinux.cmake +++ b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformLinux.cmake @@ -8,7 +8,7 @@ endif () if (USE_ANGLE_EGL OR ENABLE_WEBGL) list(APPEND ANGLE_SOURCES - ${_gl_backend_sources} + ${gl_backend_sources} ${angle_system_utils_sources_linux} ${angle_system_utils_sources_posix} diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformWin.cmake b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformWin.cmake index 97ac61915f7..cb059f1cfae 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformWin.cmake +++ b/Meta/CMake/vcpkg/overlay-ports/angle/cmake-buildsystem/PlatformWin.cmake @@ -52,7 +52,7 @@ if(USE_OPENGL) if(USE_ANGLE_EGL OR ENABLE_WEBGL) list(APPEND ANGLE_SOURCES - ${_gl_backend_sources} + ${gl_backend_sources} ${libangle_gl_egl_dl_sources} ${libangle_gl_egl_sources} diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/angle/portfile.cmake index 5e5a54d04c7..d57039c6948 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/portfile.cmake +++ b/Meta/CMake/vcpkg/overlay-ports/angle/portfile.cmake @@ -1,6 +1,6 @@ if (VCPKG_TARGET_IS_LINUX) message(WARNING "Building with a gcc version less than 6.1 is not supported.") - message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n libx11-dev\n mesa-common-dev\n libxi-dev\n libxext-dev\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev mesa-common-dev libxi-dev libxext-dev.") + message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n mesa-common-dev\n\nThese can be installed on Ubuntu systems via apt-get install mesa-common-dev.") endif() if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/unofficial-angle-config.cmake b/Meta/CMake/vcpkg/overlay-ports/angle/unofficial-angle-config.cmake index 79abf89d784..f0b712b9904 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/unofficial-angle-config.cmake +++ b/Meta/CMake/vcpkg/overlay-ports/angle/unofficial-angle-config.cmake @@ -1,7 +1,4 @@ include(CMakeFindDependencyMacro) find_dependency(ZLIB) -if(UNIX AND NOT APPLE) - find_dependency(X11 COMPONENTS Xext Xi) -endif() include("${CMAKE_CURRENT_LIST_DIR}/unofficial-angle-targets.cmake") diff --git a/Meta/CMake/vcpkg/overlay-ports/angle/vcpkg.json b/Meta/CMake/vcpkg/overlay-ports/angle/vcpkg.json index 1a98457e066..ca7bc2c3f77 100644 --- a/Meta/CMake/vcpkg/overlay-ports/angle/vcpkg.json +++ b/Meta/CMake/vcpkg/overlay-ports/angle/vcpkg.json @@ -10,18 +10,6 @@ "license": "BSD-3-Clause", "dependencies": [ "egl-registry", - { - "name": "libx11", - "platform": "linux" - }, - { - "name": "libxext", - "platform": "linux" - }, - { - "name": "libxi", - "platform": "linux" - }, "opengl-registry", { "name": "vcpkg-cmake", diff --git a/vcpkg.json b/vcpkg.json index dabea42c4af..04cb8382db1 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,6 +8,10 @@ "metal" ] }, + { + "name": "angle", + "platform": "linux" + }, { "name": "curl", "features": [