Build: add the WESTON compositor for Linux

WESTON is used when WITH_UI_TESTS is enabled.

Note that the system WESTON installation can be used by setting
WESTON_BIN to a path on the users system.

Ref !114164.
This commit is contained in:
Campbell Barton
2023-11-07 12:57:45 +11:00
parent 126f3bcfc1
commit 865944734f
6 changed files with 87 additions and 0 deletions
@@ -168,6 +168,7 @@ if(UNIX AND NOT APPLE)
# Can be removed when the build-bot upgrades to v1.20.x or newer.
include(cmake/wayland.cmake)
include(cmake/wayland_libdecor.cmake)
include(cmake/wayland_weston.cmake)
endif()
include(cmake/shaderc_deps.cmake)
include(cmake/shaderc.cmake)
@@ -137,6 +137,7 @@ download_source(XR_OPENXR_SDK)
download_source(WL_PROTOCOLS)
download_source(WAYLAND)
download_source(WAYLAND_LIBDECOR)
download_source(WAYLAND_WESTON)
download_source(ISPC)
download_source(GMP)
download_source(POTRACE)
@@ -191,6 +191,14 @@ else()
harvest(wayland/bin wayland/bin "wayland-scanner")
harvest(wayland/include wayland/include "*.h")
harvest(wayland_libdecor/include wayland_libdecor/include "*.h")
# Only needed for running the WESTON compositor.
harvest(wayland/lib64 wayland/lib64 "*")
harvest(
wayland_weston/
wayland_weston/
"*"
)
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
@@ -574,6 +574,13 @@ set(WAYLAND_LIBDECOR_HASH 47b59eba76faa3787f0878bf8700e912)
set(WAYLAND_LIBDECOR_HASH_TYPE MD5)
set(WAYLAND_LIBDECOR_HOMEPAGE https://gitlab.freedesktop.org/libdecor/libdecor)
set(WAYLAND_WESTON_VERSION 12.0.92)
set(WAYLAND_WESTON_FILE weston-${WAYLAND_WESTON_VERSION}.tar.xz)
set(WAYLAND_WESTON_URI https://gitlab.freedesktop.org/wayland/weston/-/releases/${WAYLAND_WESTON_VERSION}/downloads/weston-${WAYLAND_WESTON_VERSION}.tar.xz)
set(WAYLAND_WESTON_HASH 44542b60bf9b9fe3add904af11bbad98)
set(WAYLAND_WESTON_HASH_TYPE MD5)
set(WAYLAND_WESTON_HOMEPAGE https://wayland.freedesktop.org)
set(ISPC_VERSION v1.17.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9)
@@ -0,0 +1,56 @@
# SPDX-FileCopyrightText: 2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(WAYLAND_WESTON_CONFIGURE_ENV ${CONFIGURE_ENV})
set(WAYLAND_WESTON_PKG_ENV "PKG_CONFIG_PATH=\
${LIBDIR}/wayland/lib64/pkgconfig:\
${LIBDIR}/wayland-protocols/share/pkgconfig:\
$PKG_CONFIG_PATH"
)
ExternalProject_Add(external_wayland_weston
URL file://${PACKAGE_DIR}/${WAYLAND_WESTON_FILE}
URL_HASH ${WAYLAND_WESTON_HASH_TYPE}=${WAYLAND_WESTON_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/wayland_weston
CONFIGURE_COMMAND ${WAYLAND_WESTON_CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E env ${WAYLAND_WESTON_PKG_ENV}
${MESON} setup
${MESON_BUILD_TYPE}
--prefix ${LIBDIR}/wayland_weston
--libdir lib
-Dbackend-default=headless # For tests.
-Dbackend-drm-screencast-vaapi=false
-Dbackend-drm=false
-Dbackend-pipewire=false
-Dbackend-rdp=false
-Dcolor-management-lcms=false
-Ddemo-clients=false
-Dimage-jpeg=false
-Dimage-webp=false
-Dpipewire=false
-Dremoting=false
-Dshell-fullscreen=false
-Dshell-kiosk=false
-Dsimple-clients=
-Dsystemd=false
-Dtest-junit-xml=false
-Dwcap-decode=false
-Dxwayland=false
${BUILD_DIR}/wayland_weston/src/external_wayland_weston-build
${BUILD_DIR}/wayland_weston/src/external_wayland_weston
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/wayland_weston
)
add_dependencies(
external_wayland_weston
external_wayland_protocols
external_wayland
# Needed for `MESON`.
external_python_site_packages
)
@@ -109,6 +109,20 @@ PACKAGES_FOR_LIBS=(
# Required by: `external_ssl` (build dependencies).
perl-IPC-Cmd
perl-Pod-Html
# Required by: `external_wayland_weston`
cairo-devel
libdrm-devel
pixman-devel
libffi-devel
libinput-devel
libevdev-devel
mesa-libEGL-devel
systemd-dev # for `libudev` (not so obvious!).
# Required by: `weston --headless` (run-time requirement for off screen rendering).
mesa-dri-drivers
mesa-libEGL
mesa-libGL
)
# Additional packages needed for building Blender.