GNOME Bugzilla – Bug 773927
wayland plugin fails to build
Last modified: 2016-11-18 22:52:59 UTC
$ make -j1 make[1]: Entering directory '/home/tpm/gst/master/gst-plugins-bad/ext/wayland' CC libgstwaylandsink_la-gstwaylandsink.lo In file included from gstwaylandsink.c:45:0: wlvideoformat.h:29:28: fatal error: drm/drm_fourcc.h: No such file or directory #include <drm/drm_fourcc.h> ^ $ pkg-config --cflags libdrm -I/usr/include/libdrm
Created attachment 339094 [details] [review] wayland: fix cflags/libs order
Created attachment 339095 [details] [review] wayland: include drm_fourcc.h properly and fix build
commit 9229e34a6b770f050ee4a5e01423b6ca5b9c55eb Author: Tim-Philipp Müller <tim@centricular.com> Date: Fri Nov 4 00:52:41 2016 +0000 wayland: include drm_fourcc.h properly and fix build commit dc6862bf704a8b44fa5fdeed9e1bae89dc5abfbb Author: Tim-Philipp Müller <tim@centricular.com> Date: Fri Nov 4 00:44:32 2016 +0000 wayland: fix cflags/libs order
Checking for libdrm is a bit weird. We depend on linux kernel headers, not the drm library.
Second thought, there is benefit to using lib drm. We can then bump the version check when new formats are added instead of adding ifdef, so let's keep it your way.
Created attachment 339921 [details] [review] continue build without libdrm commit 9229e34a6b770f050ee4a5e01423b6ca5b9c55eb wayland: include drm_fourcc.h properly and fix build broke the build for systems that don't have libdrm: ------------------------------------------------------------------------ configure: *** checking feature: wayland sink *** configure: *** for plug-ins: wayland *** checking for WAYLAND... yes checking for WAYLAND_DRM... configure: error: Package requirements (libdrm >= 2.4.55) were not met: No package 'libdrm' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WAYLAND_DRM_CFLAGS and WAYLAND_DRM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. configure failed ------------------------------------------------------------------------ This happens because the PKG_CHECK_MODULES for this library is missing the else clause to mark not to build wayland and continue. This patch fixes this. Sending it here for review because touching autotools files always scares me.
commit 2132b6b4529841de3ac619022b261507c95629c8 Author: Luis de Bethencourt <luisbg@osg.samsung.com> Date: Tue Nov 15 11:59:45 2016 +0000 configure: fix build if libdrm is not available If the NOT_FOUND part of the check PKG_CHECK_MODULES is not written, it defaults to error. Addind the else clause of this check as HAVE_WAYLAND="no" https://bugzilla.gnome.org/show_bug.cgi?id=773927
Review of attachment 339921 [details] [review]: Committed
Thanks Luis.
I think these changes cause build failures if wayland is not found: checking for wayland-scanner... no configure: *** checking feature: wayland sink *** configure: *** for plug-ins: wayland *** checking for WAYLAND... configure: error: Package requirements (wayland-client >= 1.4.0) were not met: No package 'wayland-client' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WAYLAND_CFLAGS and WAYLAND_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=dfd86de67a8c04f6d15800ea554a049159b8c148
Created attachment 340199 [details] [review] Avoid prefix clash in combined pkg-config check Above mentioned commit (dfd86de67a8c0) breaks building ext/wayland for me. IIUC, the combined PKG_CHECK_MODULES(WAYLAND.. clashes with the one setting GST_VULKAN_HAVE_WINDOW_WAYLAND (Same prefix, "WAYLAND") leading to the FLAGS/CLIBS for libdrm not being set. Relevant part of generated configure follows: [..] if test -n "$PKG_CONFIG"; then if test -n "$WAYLAND_CFLAGS"; then pkg_cv_WAYLAND_CFLAGS="$WAYLAND_CFLAGS" else if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.4.0 libdrm >= 2.4.55 wayland-protocols >= 1.4\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.4.0 libdrm >= 2.4.55 wayland-protocols >= 1.4") 2>&5 ac_status=$? [..] Not sure about the preferred solution. Possible fixes might include: using another prefix for the combined wayland-client + libdrm check, change the one in the vulkan section (attached patch) or add a separate PKG_CHECK_MODULES for libdrm.
Review of attachment 340199 [details] [review]: This can be pushed if Sebastian is OK with it. Will give him a bit of time to review.
Review of attachment 340199 [details] [review]: Yep, go ahead !
Review of attachment 340199 [details] [review]: pushed as: 7c64ea48329b9a8fa4b1100c10f7413da800a83d wayland: avoid prefix clash in combined pkg-config check