After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773927 - wayland plugin fails to build
wayland plugin fails to build
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: Luis de Bethencourt
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-04 00:54 UTC by Tim-Philipp Müller
Modified: 2016-11-18 22:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: fix cflags/libs order (1.31 KB, patch)
2016-11-04 00:55 UTC, Tim-Philipp Müller
committed Details | Review
wayland: include drm_fourcc.h properly and fix build (2.01 KB, patch)
2016-11-04 00:55 UTC, Tim-Philipp Müller
committed Details | Review
continue build without libdrm (1.69 KB, patch)
2016-11-15 12:05 UTC, Luis de Bethencourt
committed Details | Review
Avoid prefix clash in combined pkg-config check (2.27 KB, patch)
2016-11-18 00:31 UTC, Reynaldo H. Verdejo Pinochet
committed Details | Review

Description Tim-Philipp Müller 2016-11-04 00:54:05 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
Comment 1 Tim-Philipp Müller 2016-11-04 00:55:05 UTC
Created attachment 339094 [details] [review]
wayland: fix cflags/libs order
Comment 2 Tim-Philipp Müller 2016-11-04 00:55:34 UTC
Created attachment 339095 [details] [review]
wayland: include drm_fourcc.h properly and fix build
Comment 3 Tim-Philipp Müller 2016-11-04 09:28:00 UTC
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
Comment 4 Nicolas Dufresne (ndufresne) 2016-11-04 11:55:01 UTC
Checking for libdrm is a bit weird. We depend on linux kernel headers, not the drm library.
Comment 5 Nicolas Dufresne (ndufresne) 2016-11-04 12:06:43 UTC
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.
Comment 6 Luis de Bethencourt 2016-11-15 12:05:57 UTC
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.
Comment 7 Luis de Bethencourt 2016-11-15 15:02:43 UTC
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
Comment 8 Luis de Bethencourt 2016-11-15 15:03:35 UTC
Review of attachment 339921 [details] [review]:

Committed
Comment 9 Tim-Philipp Müller 2016-11-15 15:17:37 UTC
Thanks Luis.
Comment 10 Philippe Renon 2016-11-15 17:04:15 UTC
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.
Comment 12 Reynaldo H. Verdejo Pinochet 2016-11-18 00:31:13 UTC
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.
Comment 13 Luis de Bethencourt 2016-11-18 18:23:36 UTC
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.
Comment 14 Nicolas Dufresne (ndufresne) 2016-11-18 19:19:08 UTC
Review of attachment 340199 [details] [review]:

Yep, go ahead !
Comment 15 Reynaldo H. Verdejo Pinochet 2016-11-18 22:52:59 UTC
Review of attachment 340199 [details] [review]:

pushed as:

7c64ea48329b9a8fa4b1100c10f7413da800a83d wayland: avoid prefix clash in combined pkg-config check