Skip to content
Commits on Source (229)
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 8
max_line_length = 80
[*.xml]
indent_style = space
indent_size = 2
tab_width = 8
......@@ -9,12 +9,14 @@ before_script:
- echo '#!/bin/sh' > /usr/sbin/policy-rc.d
- echo 'exit 101' >> /usr/sbin/policy-rc.d
- chmod +x /usr/sbin/policy-rc.d
- echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list
- apt-get update
- apt-get -y --no-install-recommends install build-essential automake autoconf libtool pkg-config libexpat1-dev libffi-dev libxml2-dev libpixman-1-dev libpng-dev libjpeg-dev libcolord-dev mesa-common-dev libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev libxcb1-dev libxcb-composite0-dev libxcb-xfixes0-dev libxcb-xkb-dev libx11-xcb-dev libx11-dev libudev-dev libgbm-dev libxkbcommon-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libxcursor-dev libmtdev-dev libpam0g-dev libvpx-dev libsystemd-dev libinput-dev libwebp-dev libjpeg-dev libva-dev liblcms2-dev git
- apt-get -y --no-install-recommends install build-essential automake autoconf libtool pkg-config libexpat1-dev libffi-dev libxml2-dev libpixman-1-dev libpng-dev libjpeg-dev libcolord-dev mesa-common-dev libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev libxcb1-dev libxcb-composite0-dev libxcb-xfixes0-dev libxcb-xkb-dev libx11-xcb-dev libx11-dev libudev-dev libgbm-dev libxkbcommon-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libxcursor-dev libmtdev-dev libpam0g-dev libvpx-dev libsystemd-dev libevdev-dev libinput-dev libwebp-dev libjpeg-dev libva-dev liblcms2-dev git libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev freerdp2-dev curl python3-pip python3-setuptools ninja-build
- pip3 install --user git+https://github.com/mesonbuild/meson.git@0.49
- mkdir -p /tmp/.X11-unix
- chmod 777 /tmp/.X11-unix
build-native:
build-native-autotools:
stage: build
script:
- git clone --depth=1 git://anongit.freedesktop.org/git/wayland/wayland-protocols
......@@ -34,7 +36,7 @@ build-native:
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- mkdir "$BUILDDIR" "$PREFIX"
- cd "$BUILDDIR"
- ../autogen.sh --prefix="$PREFIX" --disable-setuid-install --enable-xwayland --enable-x11-compositor --enable-drm-compositor --enable-wayland-compositor --enable-headless-compositor --enable-fbdev-compositor --disable-rdp-compositor --enable-screen-sharing --enable-vaapi-recorder --enable-simple-clients --enable-simple-egl-clients --enable-simple-dmabuf-drm-client --enable-simple-dmabuf-v4l-client --enable-clients --enable-resize-optimization --enable-weston-launch --enable-fullscreen-shell --enable-colord --enable-dbus --enable-systemd-login --enable-junit-xml --enable-ivi-shell --enable-wcap-tools --disable-libunwind --enable-demo-clients-install --enable-lcms --with-cairo=image
- ../autogen.sh --prefix="$PREFIX" --disable-setuid-install --enable-xwayland --enable-x11-compositor --enable-drm-compositor --enable-wayland-compositor --enable-headless-compositor --enable-fbdev-compositor --enable-rdp-compositor --enable-screen-sharing --enable-vaapi-recorder --enable-simple-clients --enable-simple-egl-clients --enable-simple-dmabuf-drm-client --enable-simple-dmabuf-v4l-client --enable-clients --enable-resize-optimization --enable-weston-launch --enable-fullscreen-shell --enable-colord --enable-dbus --enable-systemd-login --enable-junit-xml --enable-ivi-shell --enable-wcap-tools --disable-libunwind --enable-demo-clients-install --enable-lcms --with-cairo=image --enable-remoting --enable-autotools
- make all
- make check
- make install
......@@ -47,3 +49,36 @@ build-native:
- build-*/*.log
- build-*/logs
- prefix-*
build-native-meson:
stage: build
script:
- git clone --depth=1 git://anongit.freedesktop.org/git/wayland/wayland-protocols
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
- export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH"
- export MAKEFLAGS="-j4"
- cd wayland-protocols
- git show -s HEAD
- mkdir build
- cd build
- ../autogen.sh --prefix="$WAYLAND_PROTOCOLS_DIR"
- make install
- cd ../../
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
- export BUILD_ID="weston-$CI_JOB_NAME_$CI_COMMIT_SHA-$CI_JOB_ID"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- export PATH=~/.local/bin:$PATH
- mkdir "$BUILDDIR" "$PREFIX"
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" -Dsimple-dmabuf-drm=intel ..
- ninja -k0
- ninja install
- ninja test
- ninja clean
artifacts:
name: weston-$CI_COMMIT_SHA-$CI_JOB_ID
when: always
paths:
- build-*/meson-logs
- prefix-*
Contributing to Weston
=======================
Finding something to work on
----------------------------
Weston's development is [tracked on GitLab](https://gitlab.freedesktop.org/wayland/weston).
In addition to reviewing code submissions (see below), we use the issue tracker
to discuss both bugfixes and development of new features.
The '[good for new contributors](https://gitlab.freedesktop.org/wayland/weston/issues?label_name%5B%5D=Good+for+new+contributors)'
label is used for issues the development team thinks are a good place to begin
working on Weston. These issues cover features or bugfixes which are small,
self-contained, don't require much specific background knowledge, and aren't
blocked by more complex work.
If you have picked an issue you would like to work on, you may want to mention
in the issue tracker that you would like to pick it up. You can also discuss
it with the developers in the issue tracker, or on the
[mailing list](https://lists.freedesktop.org/mailman/listinfo/wayland-devel).
Many developers also use IRC through [Freenode](https://freenode.net)'s
`#wayland` channel; however you may need to wait some time for a response on
IRC, which requires keeping your client connected. If you cannot stay for a
long time (potentially some hours due to timezone differences), then you
may want to send your question to the list or issue tracker instead.
Sending patches
---------------
......@@ -234,7 +258,7 @@ During review, the following matters should be checked:
- Stable ABI or API additions must be justified by actual use cases, not only
by speculation. They must also be documented, and it is strongly recommended to
include tests excercising the additions in the test suite.
include tests exercising the additions in the test suite.
- The code fits the existing software architecture, e.g. no layering
violations.
......
......@@ -10,7 +10,7 @@ libweston_module_LTLIBRARIES =
noinst_LTLIBRARIES =
BUILT_SOURCES =
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install --enable-autotools
EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in
......@@ -57,7 +57,7 @@ CLEANFILES = weston.ini \
install-libweston_moduleLTLIBRARIES install-moduleLTLIBRARIES: install-libLTLIBRARIES
lib_LTLIBRARIES = libweston-@LIBWESTON_MAJOR@.la
libweston_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
libweston_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS)
libweston_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) \
$(COMPOSITOR_CFLAGS) $(EGL_CFLAGS) $(LIBDRM_CFLAGS)
libweston_@LIBWESTON_MAJOR@_la_LIBADD = $(COMPOSITOR_LIBS) \
......@@ -94,8 +94,15 @@ libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
libweston/timeline-object.h \
libweston/linux-dmabuf.c \
libweston/linux-dmabuf.h \
libweston/linux-explicit-synchronization.c \
libweston/linux-explicit-synchronization.h \
libweston/linux-sync-file.c \
libweston/linux-sync-file.h \
libweston/pixel-formats.c \
libweston/pixel-formats.h \
libweston/weston-debug.c \
libweston/weston-debug.h \
shared/fd-util.h \
shared/helpers.h \
shared/matrix.c \
shared/matrix.h \
......@@ -104,8 +111,12 @@ libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
shared/platform.h \
shared/weston-egl-ext.h
libweston_@LIBWESTON_MAJOR@_datadir = $(datadir)/weston/protocols
dist_libweston_@LIBWESTON_MAJOR@_data_DATA = \
protocol/weston-debug.xml
lib_LTLIBRARIES += libweston-desktop-@LIBWESTON_MAJOR@.la
libweston_desktop_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
libweston_desktop_@LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS)
libweston_desktop_@LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
libweston_desktop_@LIBWESTON_MAJOR@_la_LIBADD = \
libweston-@LIBWESTON_MAJOR@.la \
......@@ -121,15 +132,19 @@ libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES = \
libweston-desktop/surface.c \
libweston-desktop/wl-shell.c \
libweston-desktop/xdg-shell-v6.c \
libweston-desktop/xdg-shell.c \
libweston-desktop/xwayland.c
nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-server-protocol.h
protocol/xdg-shell-unstable-v6-server-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-server-protocol.h
BUILT_SOURCES += $(nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES)
libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-shell-v6.lo: protocol/xdg-shell-unstable-v6-server-protocol.h
libweston-desktop-@LIBWESTON_MAJOR@.la libweston-desktop/libweston_desktop_@LIBWESTON_MAJOR@_la-xdg-wm-shell.lo: protocol/xdg-shell-server-protocol.h
if SYSTEMD_NOTIFY_SUPPORT
module_LTLIBRARIES += systemd-notify.la
......@@ -150,6 +165,8 @@ endif
nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
protocol/weston-screenshooter-protocol.c \
protocol/weston-screenshooter-server-protocol.h \
protocol/weston-debug-protocol.c \
protocol/weston-debug-server-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-cursor-position-server-protocol.h \
protocol/text-input-unstable-v1-protocol.c \
......@@ -169,28 +186,35 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \
protocol/input-timestamps-unstable-v1-protocol.c \
protocol/input-timestamps-unstable-v1-server-protocol.h \
protocol/weston-touch-calibration-protocol.c \
protocol/weston-touch-calibration-server-protocol.h
protocol/weston-touch-calibration-server-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES)
bin_PROGRAMS += weston
weston_LDFLAGS = -export-dynamic
weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON \
-DMODULEDIR='"$(moduledir)"' \
weston_CPPFLAGS = $(AM_CPPFLAGS) -DMODULEDIR='"$(moduledir)"' \
-DXSERVER_PATH='"@XSERVER_PATH@"'
weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBINPUT_BACKEND_CFLAGS)
weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBINPUT_BACKEND_CFLAGS) \
$(PTHREAD_CFLAGS) $(LIBEVDEV_CFLAGS)
weston_LDADD = libshared.la libweston-@LIBWESTON_MAJOR@.la \
$(COMPOSITOR_LIBS) \
$(DL_LIBS) $(LIBINPUT_BACKEND_LIBS) \
$(CLOCK_GETRES_LIBS) \
$(PTHREAD_LIBS) \
$(LIBEVDEV_LIBS) \
-lm
weston_SOURCES = \
compositor/main.c \
compositor/weston-screenshooter.c \
compositor/text-backend.c \
compositor/text-backend.c
if ENABLE_XWAYLAND
weston_SOURCES += \
compositor/xwayland.c
endif
# Track this dependency explicitly instead of using BUILT_SOURCES. We
# add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h
......@@ -274,6 +298,10 @@ pkgconfig_DATA = \
libweston-desktop/libweston-desktop-${LIBWESTON_MAJOR}.pc \
compositor/weston.pc
noarch_pkgconfigdir = $(datadir)/pkgconfig
noarch_pkgconfig_DATA = \
libweston/libweston-${LIBWESTON_MAJOR}-protocols.pc
wayland_sessiondir = $(datadir)/wayland-sessions
dist_wayland_session_DATA = compositor/weston.desktop
......@@ -322,7 +350,9 @@ gl_renderer_la_SOURCES = \
libweston/gl-renderer.c \
libweston/vertex-clipping.c \
libweston/vertex-clipping.h \
libweston/weston-sync-file.h \
libweston/linux-sync-file.c \
libweston/linux-sync-file.h \
libweston/linux-sync-file-uapi.h \
shared/helpers.h
endif
......@@ -388,6 +418,23 @@ drm_backend_la_LIBADD += $(LIBVA_LIBS)
drm_backend_la_LDFLAGS += -pthread
drm_backend_la_CFLAGS += $(LIBVA_CFLAGS)
endif
# remoting
if ENABLE_REMOTING
libweston_module_LTLIBRARIES += remoting-plugin.la
remoting_plugin_la_LDFLAGS = -module -avoid-version
remoting_plugin_la_LIBADD = \
$(COMPOSITOR_LIBS) \
$(REMOTING_GST_LIBS)
remoting_plugin_la_CFLAGS = \
$(COMPOSITOR_CFLAGS) \
$(REMOTING_GST_CFLAGS) \
$(AM_CFLAGS)
remoting_plugin_la_SOURCES = \
remoting/remoting-plugin.c \
remoting/remoting-plugin.h
endif
endif
if ENABLE_WAYLAND_COMPOSITOR
......@@ -413,8 +460,8 @@ wayland_backend_la_SOURCES = \
nodist_wayland_backend_la_SOURCES = \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h
endif
if ENABLE_HEADLESS_COMPOSITOR
......@@ -517,11 +564,10 @@ spring_tool_SOURCES = \
if BUILD_CLIENTS
bin_PROGRAMS += weston-terminal weston-info
bin_PROGRAMS += weston-terminal weston-info weston-debug weston-screenshooter
libexec_PROGRAMS += \
weston-desktop-shell \
weston-screenshooter \
weston-keyboard \
weston-simple-im
......@@ -564,12 +610,10 @@ demo_clients += \
weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
......@@ -577,8 +621,8 @@ weston_simple_damage_SOURCES = clients/simple-damage.c
nodist_weston_simple_damage_SOURCES = \
protocol/viewporter-protocol.c \
protocol/viewporter-client-protocol.h \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
......@@ -608,10 +652,8 @@ if BUILD_SIMPLE_EGL_CLIENTS
demo_clients += weston-simple-egl
weston_simple_egl_SOURCES = clients/simple-egl.c
nodist_weston_simple_egl_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h
weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
endif
......@@ -622,8 +664,8 @@ weston_simple_dmabuf_drm_SOURCES = \
clients/simple-dmabuf-drm.c \
clients/simple-dmabuf-drm-data.h
nodist_weston_simple_dmabuf_drm_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
......@@ -640,8 +682,8 @@ if BUILD_SIMPLE_DMABUF_V4L_CLIENT
demo_clients += weston-simple-dmabuf-v4l
weston_simple_dmabuf_v4l_SOURCES = clients/simple-dmabuf-v4l.c
nodist_weston_simple_dmabuf_v4l_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
......@@ -650,6 +692,22 @@ weston_simple_dmabuf_v4l_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_V4L_CLIENT_CFLAGS
weston_simple_dmabuf_v4l_LDADD = $(SIMPLE_DMABUF_V4L_CLIENT_LIBS) libshared.la
endif
if BUILD_SIMPLE_DMABUF_EGL_CLIENT
demo_clients += weston-simple-dmabuf-egl
weston_simple_dmabuf_egl_SOURCES = clients/simple-dmabuf-egl.c
nodist_weston_simple_dmabuf_egl_SOURCES = \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
protocol/linux-dmabuf-unstable-v1-client-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h
weston_simple_dmabuf_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_EGL_CLIENT_CFLAGS)
weston_simple_dmabuf_egl_LDADD = $(SIMPLE_DMABUF_EGL_CLIENT_LIBS) libshared.la -lm
endif
noinst_LTLIBRARIES += libtoytoolkit.la
libtoytoolkit_la_SOURCES = \
......@@ -662,10 +720,8 @@ nodist_libtoytoolkit_la_SOURCES = \
protocol/text-cursor-position-client-protocol.h \
protocol/viewporter-protocol.c \
protocol/viewporter-client-protocol.h \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/pointer-constraints-unstable-v1-protocol.c \
protocol/pointer-constraints-unstable-v1-client-protocol.h \
protocol/relative-pointer-unstable-v1-protocol.c \
......@@ -844,10 +900,21 @@ nodist_weston_info_SOURCES = \
protocol/linux-dmabuf-unstable-v1-protocol.c \
protocol/linux-dmabuf-unstable-v1-client-protocol.h \
protocol/tablet-unstable-v2-protocol.c \
protocol/tablet-unstable-v2-client-protocol.h
protocol/tablet-unstable-v2-client-protocol.h \
protocol/xdg-output-unstable-v1-protocol.c \
protocol/xdg-output-unstable-v1-client-protocol.h
weston_info_LDADD = $(WESTON_INFO_LIBS) libshared.la
weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_debug_SOURCES = \
clients/weston-debug.c \
shared/helpers.h
nodist_weston_debug_SOURCES = \
protocol/weston-debug-protocol.c \
protocol/weston-debug-client-protocol.h
weston_debug_LDADD = $(WESTON_INFO_LIBS) libshared.la
weston_debug_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_desktop_shell_SOURCES = \
clients/desktop-shell.c \
shared/helpers.h
......@@ -884,6 +951,8 @@ BUILT_SOURCES += \
protocol/weston-screenshooter-client-protocol.h \
protocol/weston-touch-calibration-protocol.c \
protocol/weston-touch-calibration-client-protocol.h \
protocol/weston-debug-protocol.c \
protocol/weston-debug-client-protocol.h \
protocol/text-cursor-position-client-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-input-unstable-v1-protocol.c \
......@@ -900,6 +969,8 @@ BUILT_SOURCES += \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-unstable-v6-protocol.c \
protocol/xdg-shell-unstable-v6-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
protocol/ivi-hmi-controller-client-protocol.h \
protocol/ivi-application-protocol.c \
......@@ -909,7 +980,11 @@ BUILT_SOURCES += \
protocol/tablet-unstable-v2-protocol.c \
protocol/tablet-unstable-v2-client-protocol.h \
protocol/input-timestamps-unstable-v1-protocol.c \
protocol/input-timestamps-unstable-v1-client-protocol.h
protocol/input-timestamps-unstable-v1-client-protocol.h \
protocol/xdg-output-unstable-v1-protocol.c \
protocol/xdg-output-unstable-v1-client-protocol.h \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h
westondatadir = $(datadir)/weston
dist_westondata_DATA = \
......@@ -967,8 +1042,7 @@ desktop_shell_la_CPPFLAGS = \
-I$(top_srcdir)/libweston \
-I$(top_builddir)/desktop-shell \
-DMODULEDIR='"$(moduledir)"' \
-DLIBEXECDIR='"$(libexecdir)"' \
-DIN_WESTON
-DLIBEXECDIR='"$(libexecdir)"'
desktop_shell_la_LDFLAGS = -module -avoid-version
desktop_shell_la_LIBADD = libshared.la libweston-desktop-@LIBWESTON_MAJOR@.la $(COMPOSITOR_LIBS)
......@@ -994,8 +1068,7 @@ fullscreen_shell_la_CPPFLAGS = \
-I$(top_builddir)/protocol \
-I$(top_srcdir)/shared \
-I$(top_builddir)/libweston \
-I$(top_srcdir)/libweston \
-DIN_WESTON
-I$(top_srcdir)/libweston
fullscreen_shell_la_LDFLAGS = -module -avoid-version
fullscreen_shell_la_LIBADD = \
......@@ -1023,6 +1096,7 @@ ivi_shell_la_LDFLAGS = -module -avoid-version
ivi_shell_la_LIBADD = \
libshared.la \
libweston-@LIBWESTON_MAJOR@.la \
libweston-desktop-@LIBWESTON_MAJOR@.la \
$(COMPOSITOR_LIBS)
ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
ivi_shell_la_SOURCES = \
......@@ -1033,7 +1107,6 @@ ivi_shell_la_SOURCES = \
ivi-shell/ivi-layout-transition.c \
ivi-shell/ivi-shell.h \
ivi-shell/ivi-shell.c \
ivi-shell/input-panel-ivi.c \
shared/helpers.h
nodist_ivi_shell_la_SOURCES = \
protocol/ivi-application-protocol.c \
......@@ -1252,7 +1325,8 @@ weston_tests = \
subsurface.weston \
subsurface-shot.weston \
devices.weston \
touch.weston
touch.weston \
linux-explicit-synchronization.weston
AM_TESTS_ENVIRONMENT = \
abs_builddir='$(abs_builddir)'; export abs_builddir; \
......@@ -1321,11 +1395,6 @@ weston_test_desktop_shell_la_SOURCES = \
tests/weston-test-desktop-shell.c \
shared/helpers.h
if ENABLE_EGL
weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS)
weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS)
endif
libtest_runner_la_SOURCES = \
tests/weston-test-runner.c \
tests/weston-test-runner.h
......@@ -1451,6 +1520,14 @@ touch_weston_SOURCES = tests/touch-test.c
touch_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
touch_weston_LDADD = libtest-client.la
linux_explicit_synchronization_weston_SOURCES = \
tests/linux-explicit-synchronization-test.c
nodist_linux_explicit_synchronization_weston_SOURCES = \
protocol/linux-explicit-synchronization-unstable-v1-protocol.c \
protocol/linux-explicit-synchronization-unstable-v1-client-protocol.h
linux_explicit_synchronization_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
linux_explicit_synchronization_weston_LDADD = libtest-client.la
if ENABLE_XWAYLAND_TEST
weston_tests += xwayland-test.weston
xwayland_test_weston_SOURCES = tests/xwayland-test.c
......@@ -1574,14 +1651,14 @@ noinst_LTLIBRARIES += \
surface_screenshot_la_LIBADD = libshared.la $(test_module_libadd)
surface_screenshot_la_LDFLAGS = $(test_module_ldflags)
surface_screenshot_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS)
surface_screenshot_la_SOURCES = tests/surface-screenshot.c
surface_screenshot_la_SOURCES = tests/surface-screenshot-test.c
#
# Documentation
#
man_MANS = weston.1 weston.ini.5
man_MANS = weston.1 weston.ini.5 weston-debug.1
if ENABLE_DRM_COMPOSITOR
man_MANS += weston-drm.7
......@@ -1592,14 +1669,14 @@ man_MANS += weston-rdp.7
endif
MAN_SUBSTS = \
-e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
-e 's|__weston_modules_dir__|$(moduledir)|g' \
-e 's|__libweston_modules_dir__|$(libweston_moduledir)|g' \
-e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \
-e 's|__weston_libexecdir__|$(libexecdir)|g' \
-e 's|__weston_bindir__|$(bindir)|g' \
-e 's|__xserver_path__|$(XSERVER_PATH)|g' \
-e 's|__version__|$(PACKAGE_VERSION)|g'
-e 's|@weston_native_backend@|$(WESTON_NATIVE_BACKEND)|g' \
-e 's|@weston_modules_dir@|$(moduledir)|g' \
-e 's|@libweston_modules_dir@|$(libweston_moduledir)|g' \
-e 's|@weston_shell_client@|$(WESTON_SHELL_CLIENT)|g' \
-e 's|@weston_libexecdir@|$(libexecdir)|g' \
-e 's|@weston_bindir@|$(bindir)|g' \
-e 's|@xserver_path@|$(XSERVER_PATH)|g' \
-e 's|@version@|$(PACKAGE_VERSION)|g'
SUFFIXES = .1 .5 .7 .man
......@@ -1612,6 +1689,7 @@ EXTRA_DIST += \
doc/wayland-screenshot.jpg \
doc/calibration-helper.bash \
man/weston.man \
man/weston-debug.man \
man/weston-drm.man \
man/weston-rdp.man \
man/weston.ini.man
......@@ -1666,3 +1744,23 @@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
EXTRA_DIST += \
clients/meson.build \
compositor/meson.build \
data/meson.build \
desktop-shell/meson.build \
fullscreen-shell/meson.build \
ivi-shell/meson.build \
libweston-desktop/meson.build \
libweston/git-version.h.meson \
libweston/meson.build \
man/meson.build \
meson.build \
meson_options.txt \
protocol/meson.build \
remoting/meson.build \
shared/meson.build \
tests/meson.build \
wcap/meson.build \
xwayland/meson.build
......@@ -39,11 +39,38 @@ to make code or non-technical contributions to Weston.
Building Weston
===============
Weston is built using autotools, with `autogen.sh` and `make`. It often depends
Weston is built using [Meson](https://mesonbuild.com/). Weston often depends
on the current release versions of
[Wayland](https://gitlab.freedesktop.org/wayland/wayland) and
[wayland-protocols](https://cgit.freedesktop.org/wayland/wayland-protocols).
If necessary, the latest Meson can be installed as a user with:
$ pip3 install --user meson
Weston's Meson build does not do autodetection and it defaults to all
features enabled, which means you likely hit missing dependencies on the first
try. If a dependency is avoidable through a build option, the error message
should tell you what option can be used to avoid it. You may need to disable
several features if you want to avoid certain dependencies.
$ git clone https://gitlab.freedesktop.org/wayland/weston.git
$ cd weston
$ meson build/ --prefix=...
$ ninja -C build/ install
$ cd ..
The `meson` command populates the build directory. This step can
fail due to missing dependencies. Any build options you want can be added on
that line, e.g. `meson build/ --prefix=... -Dsimple-dmabuf-drm=intel`.
All the build options can be found in the file
[meson_options.txt](meson_options.txt).
Once the build directory has been successfully populated, you can inspect the
configuration with `meson configure build/`. If you need to change an
option, you can do e.g.
`meson configure build/ -Dsimple-dmabuf-drm=intel`.
Every push to the Weston master repository and its forks is built using GitLab
CI. [Reading the configuration](.gitlab-ci.yml) may provide a useful example of
how to build and install Weston.
......@@ -88,6 +115,13 @@ Libweston was first introduced in Weston 1.12, and is expected to
continue evolving through many Weston releases before it achieves a
stable API and feature completeness.
Libweston's primary purpose is exporting an API for creating Wayland
compositors. Libweston's secondary purpose is to export the weston_config API
so that third party plugins and helper programs can read `weston.ini` if they
want to. However, these two scopes are orthogonal and independent. At no point
will the compositor functionality use or depend on the weston_config
functionality.
API/ABI (in)stability and parallel installability
-------------------------------------------------
......
......@@ -32,6 +32,7 @@
#include <math.h>
#include <assert.h>
#include <getopt.h>
#include <errno.h>
#include <linux/input.h>
#include <wayland-client.h>
......@@ -290,7 +291,8 @@ main(int argc, char *argv[])
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -34,6 +34,7 @@
#include <assert.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <linux/input.h>
#include <wayland-client.h>
......@@ -328,7 +329,8 @@ main(int argc, char *argv[])
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -45,6 +45,7 @@
#include <cairo.h>
#include <float.h>
#include <assert.h>
#include <errno.h>
#include <linux/input.h>
#include <wayland-client.h>
......@@ -621,7 +622,8 @@ main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -34,6 +34,7 @@
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include <errno.h>
#include <linux/input.h>
#include <wayland-client.h>
......@@ -490,7 +491,8 @@ main(int argc, char *argv[])
display = display_create(&argc, argv);
if (display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -212,7 +212,7 @@ panel_launcher_activate(struct panel_launcher *widget)
pid = fork();
if (pid < 0) {
fprintf(stderr, "fork failed: %m\n");
fprintf(stderr, "fork failed: %s\n", strerror(errno));
return;
}
......@@ -225,7 +225,8 @@ panel_launcher_activate(struct panel_launcher *widget)
exit(EXIT_FAILURE);
if (execve(argv[0], argv, widget->envp.data) < 0) {
fprintf(stderr, "execl '%s' failed: %m\n", argv[0]);
fprintf(stderr, "execl '%s' failed: %s\n", argv[0],
strerror(errno));
exit(1);
}
}
......@@ -736,7 +737,8 @@ panel_add_launcher(struct panel *panel, const char *icon, const char *path)
enum {
BACKGROUND_SCALE,
BACKGROUND_SCALE_CROP,
BACKGROUND_TILE
BACKGROUND_TILE,
BACKGROUND_CENTERED
};
static void
......@@ -756,7 +758,10 @@ background_draw(struct widget *widget, void *data)
cr = widget_cairo_create(background->widget);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
if (background->color == 0)
cairo_set_source_rgba(cr, 0.0, 0.0, 0.2, 1.0);
else
set_hex_color(cr, background->color);
cairo_paint(cr);
widget_get_allocation(widget, &allocation);
......@@ -797,16 +802,27 @@ background_draw(struct widget *widget, void *data)
case BACKGROUND_TILE:
cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
break;
case BACKGROUND_CENTERED:
s = (sx < sy) ? sx : sy;
if (s < 1.0)
s = 1.0;
/* align center */
tx = (im_w - s * allocation.width) * 0.5;
ty = (im_h - s * allocation.height) * 0.5;
cairo_matrix_init_translate(&matrix, tx, ty);
cairo_matrix_scale(&matrix, s, s);
cairo_pattern_set_matrix(pattern, &matrix);
break;
}
cairo_set_source(cr, pattern);
cairo_pattern_destroy (pattern);
cairo_surface_destroy(image);
} else {
set_hex_color(cr, background->color);
cairo_mask(cr, pattern);
}
cairo_paint(cr);
cairo_destroy(cr);
cairo_surface_destroy(surface);
......@@ -1142,6 +1158,8 @@ background_create(struct desktop *desktop, struct output *output)
background->type = BACKGROUND_SCALE_CROP;
} else if (strcmp(type, "tile") == 0) {
background->type = BACKGROUND_TILE;
} else if (strcmp(type, "centered") == 0) {
background->type = BACKGROUND_CENTERED;
} else {
background->type = -1;
fprintf(stderr, "invalid background-type: %s\n",
......@@ -1502,7 +1520,8 @@ int main(int argc, char *argv[])
desktop.display = display_create(&argc, argv);
if (desktop.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -35,6 +35,7 @@
#include <cairo.h>
#include <sys/epoll.h>
#include <stdbool.h>
#include <errno.h>
#include <wayland-client.h>
#include <wayland-cursor.h>
......@@ -848,7 +849,8 @@ main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -580,7 +580,7 @@ data_source_send(void *data,
struct editor *editor = data;
if (write(fd, editor->selected_text, strlen(editor->selected_text) + 1) < 0)
fprintf(stderr, "write failed: %m\n");
fprintf(stderr, "write failed: %s\n", strerror(errno));
close(fd);
}
......@@ -1609,7 +1609,8 @@ main(int argc, char *argv[])
text_buffer = read_file(argv[1]);
if (text_buffer == NULL) {
fprintf(stderr, "could not read file '%s': %m\n", argv[1]);
fprintf(stderr, "could not read file '%s': %s\n",
argv[1], strerror(errno));
return -1;
}
}
......@@ -1618,7 +1619,8 @@ main(int argc, char *argv[])
editor.display = display_create(&argc, argv);
if (editor.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
free(text_buffer);
return -1;
}
......
......@@ -37,6 +37,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <cairo.h>
......@@ -515,14 +517,16 @@ main(int argc, char *argv[])
/* Connect to the display and have the arguments parsed */
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
/* Create new eventdemo window */
e = eventdemo_create(d);
if (e == NULL) {
fprintf(stderr, "failed to create eventdemo: %m\n");
fprintf(stderr, "failed to create eventdemo: %s\n",
strerror(errno));
return -1;
}
......
......@@ -30,6 +30,7 @@
#include <time.h>
#include <math.h>
#include <cairo.h>
#include <errno.h>
#include <sys/time.h>
#include <linux/input.h>
......@@ -172,7 +173,8 @@ int main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -30,6 +30,7 @@
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include <cairo.h>
#include <linux/input.h>
......@@ -518,7 +519,8 @@ int main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -30,6 +30,7 @@
#include <string.h>
#include <math.h>
#include <time.h>
#include <errno.h>
#include <GL/gl.h>
#include <EGL/egl.h>
......@@ -488,7 +489,8 @@ int main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
gears = gears_create(d);
......
......@@ -36,6 +36,7 @@
#include <time.h>
#include <cairo.h>
#include <assert.h>
#include <errno.h>
#include <linux/input.h>
#include <wayland-client.h>
......@@ -419,7 +420,8 @@ main(int argc, char *argv[])
d = display_create(&argc, argv);
if (d == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
......@@ -35,6 +35,7 @@
#include <signal.h>
#include <sys/mman.h>
#include <getopt.h>
#include <errno.h>
#include <wayland-cursor.h>
#include <wayland-client-protocol.h>
#include "shared/cairo-util.h"
......@@ -806,8 +807,8 @@ createShmBuffer(struct wlContextStruct *p_wlCtx)
fd = os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %m\n",
size);
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));
return ;
}
......@@ -815,7 +816,7 @@ createShmBuffer(struct wlContextStruct *p_wlCtx)
mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (MAP_FAILED == p_wlCtx->data) {
fprintf(stderr, "mmap failed: %m\n");
fprintf(stderr, "mmap failed: %s\n", strerror(errno));
close(fd);
return;
}
......@@ -828,7 +829,8 @@ createShmBuffer(struct wlContextStruct *p_wlCtx)
WL_SHM_FORMAT_ARGB8888);
if (NULL == p_wlCtx->wlBuffer) {
fprintf(stderr, "wl_shm_create_buffer failed: %m\n");
fprintf(stderr, "wl_shm_create_buffer failed: %s\n",
strerror(errno));
close(fd);
return;
}
......
......@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <linux/input.h>
#include <cairo.h>
......@@ -273,11 +274,10 @@ static void __attribute__ ((format (printf, 1, 2)))
dbg(const char *fmt, ...)
{
#ifdef DEBUG
int l;
va_list argp;
va_start(argp, fmt);
l = vfprintf(stderr, fmt, argp);
vfprintf(stderr, fmt, argp);
va_end(argp);
#endif
}
......@@ -1020,7 +1020,8 @@ main(int argc, char *argv[])
virtual_keyboard.display = display_create(&argc, argv);
if (virtual_keyboard.display == NULL) {
fprintf(stderr, "failed to create display: %m\n");
fprintf(stderr, "failed to create display: %s\n",
strerror(errno));
return -1;
}
......
if get_option('resize-pool')
config_h.set('USE_RESIZE_POOL', '1')
endif
srcs_toytoolkit = [
'window.c',
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
text_cursor_position_client_protocol_h,
text_cursor_position_protocol_c,
relative_pointer_unstable_v1_client_protocol_h,
relative_pointer_unstable_v1_protocol_c,
pointer_constraints_unstable_v1_client_protocol_h,
pointer_constraints_unstable_v1_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
]
deps_toytoolkit = [
dep_wayland_client,
dep_lib_cairo_shared,
dep_xkbcommon,
dependency('wayland-cursor'),
cc.find_library('util'),
]
lib_toytoolkit = static_library(
'toytoolkit',
srcs_toytoolkit,
include_directories: include_directories('..', '../shared'),
dependencies: deps_toytoolkit,
install: false,
)
dep_toytoolkit = declare_dependency(
link_with: lib_toytoolkit,
dependencies: deps_toytoolkit,
)
simple_clients = [
{
'name': 'damage',
'sources': [
'simple-damage.c',
viewporter_client_protocol_h,
viewporter_protocol_c,
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'dmabuf-egl',
'sources': [
'simple-dmabuf-egl.c',
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
linux_explicit_synchronization_unstable_v1_client_protocol_h,
linux_explicit_synchronization_unstable_v1_protocol_c,
xdg_shell_unstable_v6_client_protocol_h,
xdg_shell_unstable_v6_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [
dep_wayland_client,
dep_libdrm,
dep_libm
],
'deps': [ 'egl', 'glesv2', 'gbm' ]
},
{
'name': 'dmabuf-v4l',
'sources': [
'simple-dmabuf-v4l.c',
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libdrm_headers ]
},
{
'name': 'egl',
'sources': [
'simple-egl.c',
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared, dep_libm ],
'deps': [ 'egl', 'wayland-egl', 'glesv2', 'wayland-cursor' ]
},
# weston-simple-im is handled specially separately due to install_dir and odd window.h usage
{
'name': 'shm',
'sources': [
'simple-shm.c',
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'touch',
'sources': [
'simple-touch.c',
],
'dep_objs': [ dep_wayland_client, dep_libshared ]
},
]
simple_clients_enabled = get_option('simple-clients')
simple_build_all = simple_clients_enabled.contains('all')
foreach t : simple_clients
if simple_build_all or simple_clients_enabled.contains(t.get('name'))
t_name = 'weston-simple-' + t.get('name')
t_deps = t.get('dep_objs', [])
foreach depname : t.get('deps', [])
dep = dependency(depname, required: false)
if not dep.found()
error('@0@ requires @1@ which was not found. If you rather not build this, drop "@2@" from simple-clients option.'.format(t_name, depname, t.get('name')))
endif
t_deps += dep
endforeach
executable(
t_name, t.get('sources'),
include_directories: include_directories('..'),
dependencies: t_deps,
install: true
)
endif
endforeach
if simple_build_all or simple_clients_enabled.contains('im')
executable(
'weston-simple-im', [
'simple-im.c',
input_method_unstable_v1_client_protocol_h,
input_method_unstable_v1_protocol_c,
],
include_directories: include_directories('..'),
dependencies: [
dep_libshared,
dep_wayland_client,
dep_xkbcommon,
dependency('wayland-cursor'),
dependency('cairo')
],
install: true,
install_dir: dir_libexec
)
endif
tools_enabled = get_option('tools')
tools_list = [
{
'name': 'calibrator',
'sources': [
'calibrator.c',
'../shared/matrix.c',
],
'deps': [ dep_toytoolkit ],
},
{
'name': 'debug',
'sources': [
'weston-debug.c',
weston_debug_client_protocol_h,
weston_debug_protocol_c,
],
'deps': [ dep_wayland_client ]
},
{
'name': 'info',
'sources': [
'weston-info.c',
presentation_time_client_protocol_h,
presentation_time_protocol_c,
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
tablet_unstable_v2_client_protocol_h,
tablet_unstable_v2_protocol_c,
xdg_output_unstable_v1_client_protocol_h,
xdg_output_unstable_v1_protocol_c,
],
'deps': [ dep_wayland_client, dep_libshared ]
},
{
'name': 'terminal',
'sources': [ 'terminal.c' ],
'deps': [ dep_toytoolkit ],
},
{
'name': 'touch-calibrator',
'sources': [
'touch-calibrator.c',
'../shared/matrix.c',
weston_touch_calibration_client_protocol_h,
weston_touch_calibration_protocol_c,
],
'deps': [ dep_toytoolkit ],
},
]
foreach t : tools_list
if tools_enabled.contains(t.get('name'))
executable(
'weston-@0@'.format(t.get('name')),
t.get('sources'),
include_directories: include_directories('..', '../shared'),
dependencies: t.get('deps', []),
install: true
)
endif
endforeach
demo_clients = [
{ 'basename': 'clickdot' },
{
'basename': 'cliptest',
'add_sources': [ '../libweston/vertex-clipping.c' ]
},
{ 'basename': 'confine' },
{ 'basename': 'dnd' },
{
'basename': 'editor',
'add_sources': [
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
],
'deps': [ 'pangocairo', 'gobject-2.0' ]
},
{ 'basename': 'eventdemo' },
{ 'basename': 'flower' },
{
'basename': 'fullscreen',
'add_sources': [
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
]
},
{ 'basename': 'image' },
{ 'basename': 'multi-resource' },
{
'basename': 'presentation-shm',
'add_sources': [
presentation_time_client_protocol_h,
presentation_time_protocol_c,
]
},
{ 'basename': 'resizor' },
{
'basename': 'scaler',
'add_sources': [
viewporter_client_protocol_h,
viewporter_protocol_c,
]
},
{ 'basename': 'smoke' },
{ 'basename': 'stacking' },
{
'basename': 'subsurfaces',
'deps': [ 'egl', 'glesv2', 'wayland-egl' ]
},
{ 'basename': 'transformed' },
]
if get_option('demo-clients')
foreach t : demo_clients
t_name = 'weston-' + t.get('basename')
t_srcs = [ t.get('basename') + '.c' ] + t.get('add_sources', [])
t_deps = [ dep_toytoolkit ]
foreach depname : t.get('deps', [])
dep = dependency(depname, required: false)
if not dep.found()
error('@0@ requires \'@1@\' which was not found. If you rather not build this, set \'-Ddemo-clients=false\'.'.format(t_name, depname))
endif
t_deps += dep
endforeach
executable(
t_name, t_srcs,
include_directories: include_directories('..', '../shared'),
dependencies: t_deps,
install: true
)
endforeach
endif
simple_dmabuf_drm_opts = get_option('simple-dmabuf-drm')
simple_dmabuf_drm_deps = []
foreach driver : [ 'etnaviv', 'intel', 'freedreno' ]
if simple_dmabuf_drm_opts.contains(driver)
required = true
enabled = true
elif simple_dmabuf_drm_opts.contains('auto')
required = get_option('auto_features').enabled()
enabled = not get_option('auto_features').disabled()
else
enabled = false
endif
if enabled
dep = dependency('libdrm_' + driver, required: false)
if dep.found()
simple_dmabuf_drm_deps += dep
config_h.set('HAVE_LIBDRM_' + driver.to_upper(), 1)
elif required
error('simple-dmabuf-drm is configured to use @0@ but it was not found. Or, you can remove @1@ from \'-Dsimple-dmabuf-drm\' list.'.format('libdrm_' + driver, driver))
endif
endif
endforeach
if simple_dmabuf_drm_deps.length() > 0
executable(
'weston-simple-dmabuf-drm',
'simple-dmabuf-drm.c',
xdg_shell_client_protocol_h,
xdg_shell_protocol_c,
fullscreen_shell_unstable_v1_client_protocol_h,
fullscreen_shell_unstable_v1_protocol_c,
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
include_directories: include_directories('..'),
dependencies: [
dep_wayland_client,
dep_libdrm,
simple_dmabuf_drm_deps
],
install: true
)
endif
if get_option('shell-desktop')
exe_keyboard = executable(
'weston-keyboard',
'keyboard.c',
text_input_unstable_v1_client_protocol_h,
text_input_unstable_v1_protocol_c,
input_method_unstable_v1_client_protocol_h,
input_method_unstable_v1_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('libexecdir'),
install: true
)
env_modmap += 'weston-keyboard=@0@;'.format(exe_keyboard.full_path())
exe_shooter = executable(
'weston-screenshooter',
'screenshot.c',
weston_screenshooter_client_protocol_h,
weston_screenshooter_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('bindir'),
install: true
)
env_modmap += 'weston-screenshooter=@0@;'.format(exe_shooter.full_path())
exe_shell_desktop = executable(
'weston-desktop-shell',
'desktop-shell.c',
weston_desktop_shell_client_protocol_h,
weston_desktop_shell_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install_dir: get_option('libexecdir'),
install: true
)
env_modmap += 'weston-desktop-shell=@0@;'.format(exe_shell_desktop.full_path())
endif
if get_option('shell-ivi')
exe_shell_ivi_ui = executable(
'weston-ivi-shell-user-interface',
'ivi-shell-user-interface.c',
ivi_hmi_controller_client_protocol_h,
ivi_hmi_controller_protocol_c,
ivi_application_client_protocol_h,
ivi_application_protocol_c,
include_directories: include_directories('..'),
dependencies: dep_toytoolkit,
install: true,
install_dir: get_option('libexecdir')
)
env_modmap += 'weston-ivi-shell-user-interface=@0@;'.format(exe_shell_ivi_ui.full_path())
endif