1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

weston: change to use meson build system

The changes include:
- Drop all autotools related patches.
- Move weston-launch setuid-install to do_install task since it's not
  supported yet by meson build.
- Drop cairo-glesv2 package config, it's not supported by meson build,
  the recommended value is hard-coded to cairo-image for now in weston
  source.
- Introduce remoting package config, to give this option a explicit
  value, or else the build would run into gstreamer missing error since
  it defaults to be true but gstreamer is not in depends list.
- Default to headless backend if neither x11 nor wayland is in
  DISTRO_FEATURES.

To be noticed, the packages built from meson would not be identical
with those built from autotools, for instance, libz dependency has been
dropped from meson build, and systemd-notify is always built in meson
when systemd packageconfig is enabled, which in autotools, it's
optional, and so on, it's not easy to list all the differences, but
you could get them by comparing the pkgdata directories built by meson
and autotools.

(From OE-Core rev: 8d68e3cb315137f73d1b0f5f80180c2d3526f99d)

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Ming Liu <ming.liu@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ming Liu
2019-08-02 17:14:41 +08:00
committed by Richard Purdie
parent 89a2768000
commit e5b0ad5dfa
3 changed files with 99 additions and 71 deletions
@@ -9,27 +9,14 @@ kind of systemsi e.g. musl.
Upstream-Status: Submitted Upstream-Status: Submitted
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ming Liu <ming.liu@toradex.com>
--- ---
configure.ac | 2 ++
libweston/weston-error.h | 20 ++++++++++++++++++++ libweston/weston-error.h | 20 ++++++++++++++++++++
libweston/weston-launch.c | 2 +- libweston/weston-launch.c | 2 +-
3 files changed, 23 insertions(+), 1 deletion(-) meson.build | 1 +
3 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 libweston/weston-error.h create mode 100644 libweston/weston-error.h
diff --git a/configure.ac b/configure.ac
index c05ad01..6da6e04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,6 +126,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")],
[[#include <time.h>]])
+AC_CHECK_HEADERS([error.h])
+
AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
# check for libdrm as a build-time dependency only
diff --git a/libweston/weston-error.h b/libweston/weston-error.h diff --git a/libweston/weston-error.h b/libweston/weston-error.h
new file mode 100644 new file mode 100644
index 0000000..2089d02 index 0000000..2089d02
@@ -76,3 +63,18 @@ index bf73e0d..9064439 100644
#define DRM_MAJOR 226 #define DRM_MAJOR 226
diff --git a/meson.build b/meson.build
index 2155b7b..baa52d9 100644
--- a/meson.build
+++ b/meson.build
@@ -94,6 +94,7 @@ foreach func : optional_libc_funcs
endforeach
optional_system_headers = [
+ 'error.h',
'linux/sync_file.h'
]
foreach hdr : optional_system_headers
--
2.7.4
@@ -15,44 +15,46 @@ Upstream-Status: Pending
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Ming Liu <ming.liu@toradex.com>
--- ---
configure.ac | 9 +++++++-- libweston/meson.build | 16 ++++++++++++----
libweston/weston-launch.c | 20 ++++++++++++++++++++ libweston/weston-launch.c | 20 ++++++++++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-) meson_options.txt | 7 +++++++
3 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/libweston/meson.build b/libweston/meson.build
index 6da6e04..681f7c8 100644 index 33ab970..32f495a 100644
--- a/configure.ac --- a/libweston/meson.build
+++ b/configure.ac +++ b/libweston/meson.build
@@ -515,13 +515,17 @@ AC_ARG_ENABLE(resize-optimization, @@ -472,16 +472,24 @@ if get_option('renderer-gl')
AS_IF([test "x$enable_resize_optimization" = "xyes"], endif
[AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
+AC_ARG_WITH(pam, if get_option('weston-launch')
+ AS_HELP_STRING([--with-pam], [Use PAM]), - dep_pam = cc.find_library('pam')
+ [use_pam=$withval], [use_pam=yes]) + deps_weston_launch = [systemd_dep, dep_libdrm]
AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
-if test x$enable_weston_launch = xyes; then
+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
if test x$have_pam = xno; then
- AC_ERROR([weston-launch requires pam])
+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
fi
+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
fi
AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes") - if not cc.has_function('pam_open_session', dependencies: dep_pam)
@@ -767,6 +771,7 @@ AC_MSG_RESULT([ - error('pam_open_session not found for weston-launch')
Enable developer documentation ${enable_devdocs} + if get_option('pam')
+ dep_pam = cc.find_library('pam')
weston-launch utility ${enable_weston_launch} + if not cc.has_function('pam_open_session', dependencies: dep_pam)
+ PAM support ${use_pam} + error('pam_open_session not found for weston-launch')
systemd-login support ${have_systemd_login} + endif
systemd notify support ${enable_systemd_notify} +
+ if dep_pam.found()
+ deps_weston_launch += dep_pam
+ config_h.set('HAVE_PAM', '1')
+ endif
endif
executable(
'weston-launch',
'weston-launch.c',
- dependencies: [dep_pam, systemd_dep, dep_libdrm],
+ dependencies: deps_weston_launch,
include_directories: include_directories('..'),
install: true
)
diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index 9064439..c6abe92 100644 index 9064439..c6abe92 100644
--- a/libweston/weston-launch.c --- a/libweston/weston-launch.c
@@ -172,3 +174,24 @@ index 9064439..c6abe92 100644
if (setup_launcher_socket(&wl) < 0) if (setup_launcher_socket(&wl) < 0)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
diff --git a/meson_options.txt b/meson_options.txt
index 0e1d183..9a5c3d5 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -73,6 +73,13 @@ option(
)
option(
+ 'pam',
+ type: 'boolean',
+ value: true,
+ description: 'Define if PAM is available'
+)
+
+option(
'xwayland',
type: 'boolean',
value: true,
--
2.7.4
+26 -23
View File
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
file://weston.png \ file://weston.png \
file://weston.desktop \ file://weston.desktop \
file://0001-make-error-portable.patch \
file://xwayland.weston-start \ file://xwayland.weston-start \
file://0001-make-error-portable.patch \
file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
" "
SRC_URI[md5sum] = "e7b10710ef1eac82258f97bfd41fe534" SRC_URI[md5sum] = "e7b10710ef1eac82258f97bfd41fe534"
@@ -17,7 +17,7 @@ SRC_URI[sha256sum] = "bf2f6d5aae2e11cabb6bd69a76bcf9edb084f8c3e14ca769bea7234a51
UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
inherit autotools pkgconfig useradd distro_features_check inherit meson pkgconfig useradd distro_features_check
# depends on virtual/egl # depends on virtual/egl
REQUIRED_DISTRO_FEATURES = "opengl" REQUIRED_DISTRO_FEATURES = "opengl"
@@ -26,49 +26,48 @@ DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
EXTRA_OECONF = "--enable-setuid-install \ EXTRA_OEMESON += "-Dbackend-default=auto -Dbackend-rdp=false"
--disable-rdp-compositor \
--enable-autotools \
"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \
clients launch" clients launch"
# #
# Compositor choices # Compositor choices
# #
# Weston on KMS # Weston on KMS
PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa virtual/libgbm mtdev" PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/mesa virtual/libgbm mtdev"
# Weston on Wayland (nested Weston) # Weston on Wayland (nested Weston)
PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa" PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/mesa"
# Weston on X11 # Weston on X11
PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo" PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo"
# Headless Weston # Headless Weston
PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor" PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false"
# Weston on framebuffer # Weston on framebuffer
PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev" PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev"
# weston-launch # weston-launch
PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm" PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm"
# VA-API desktop recorder # VA-API desktop recorder
PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva" PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva"
# Weston with EGL support # Weston with EGL support
PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl" PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl"
# Weston with cairo glesv2 support
PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
# Weston with lcms support # Weston with lcms support
PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms" PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms"
# Weston with webp support # Weston with webp support
PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp" PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp"
# Weston with systemd-login support # Weston with systemd-login support
PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus" PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus"
# Weston with Xwayland support (requires X11 and Wayland) # Weston with Xwayland support (requires X11 and Wayland)
PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland" PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false"
# colord CMS support # colord CMS support
PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord"
# Clients support # Clients support
PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients" PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
# Virtual remote output with GStreamer on DRM backend
PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer-1.0"
# Weston with PAM support # Weston with PAM support
PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam"
do_install_append() { do_install_append() {
# Weston doesn't need the .la files to load modules, so wipe them # Weston doesn't need the .la files to load modules, so wipe them
@@ -86,6 +85,10 @@ do_install_append() {
if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
fi fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then
chmod u+s ${D}${bindir}/weston-launch
fi
} }
PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \