Bug 267100 - graphics/gstreamer1-plugins-gl: fails to build if graphics/libdrm is installed
Summary: graphics/gstreamer1-plugins-gl: fails to build if graphics/libdrm is installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Thomas Zander
URL:
Keywords: regression
Depends on:
Blocks: 261585
  Show dependency treegraph
 
Reported: 2022-10-15 18:53 UTC by rkoberman
Modified: 2022-11-01 23:32 UTC (History)
16 users (show)

See Also:


Attachments
Guard against masked token in gst-libs/gst/allocators/meson.build (3.82 KB, patch)
2022-10-25 04:06 UTC, Bryan Baldwin
no flags Details | Diff
Guard against masked token in gst-libs/gst/allocators/meson.build (3.82 KB, patch)
2022-10-25 04:08 UTC, Bryan Baldwin
no flags Details | Diff
Guard against masked token in gst-libs/gst/allocators/meson.build (880 bytes, patch)
2022-10-25 04:10 UTC, Bryan Baldwin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rkoberman 2022-10-15 18:53:00 UTC
graphics/gstreamer1-plugins-gl fails to configure.

Has header "libdrm/drm_fourcc.h" : YES 

gst-libs/gst/gl/meson.build:558:6: ERROR: Unknown variable "allocators_dep".

This is on CURRENT on an Alder Lake system that lacks DRM support and is running scfb.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2022-10-16 04:45:40 UTC
Same on 2 hosts with 13.1-p2 amd64: 1st with x11/nvidia-driver-390 and 2nd with x11/nvidia-driver-340.
Comment 2 John Hein 2022-10-17 11:46:36 UTC
This patch was added:

% cat /usr/ports/multimedia//gstreamer1-plugins/files/patch-gst-libs_gst_allocators_meson.build
--- gst-libs/gst/allocators/meson.build.orig    2022-09-06 20:56:00 UTC
+++ gst-libs/gst/allocators/meson.build
@@ -1,3 +1,4 @@
+if get_option('allocators').enabled()
 gst_allocators_headers = files([
   'allocators.h',
   'allocators-prelude.h',
@@ -58,3 +59,4 @@ allocators_dep = declare_dependency(link_with: gstallo
   sources : allocators_gen_sources)

 meson.override_dependency('gstreamer-allocators-1.0', allocators_dep)
+endif


So, unless 'allocators' is explicitly enabled, allocators_dep is not defined.  

It's not clear from the commit or review why that is there (committer, maintainter CC'd for comment).

But if you remove that patch, gstreamer1-plugins-gl gets past 'configure' when libdrm is installed.

Because the intent of the patch is not documented, I don't know what to test for breakage if the patch is removed.  It may be something that fails to build, or it could cause some run-time problem, or maybe the patch should just not be there at all and everything works fine without it.  An answer from the patch author would be helpful here.


By the way, the reason this only shows up when libdrm is installed is from this meson.build snippet in work/gst-plugins-base-1.20.3/gts-libs/gl/meson.build:

if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h')
  optional_deps += allocators_dep
endif
Comment 3 John Hein 2022-10-17 11:59:04 UTC
Passing -Dallocators=enabled to meson is an option (to get past the configure failure instead of deleting the patch) as well.

Before deciding how to proceed with a fix for this bug, it would be good to understand why the option to disable allocators was added.
Comment 4 Bryan Baldwin 2022-10-25 04:06:37 UTC
Created attachment 237598 [details]
Guard against masked token in gst-libs/gst/allocators/meson.build
Comment 5 Bryan Baldwin 2022-10-25 04:08:41 UTC
Created attachment 237599 [details]
Guard against masked token in gst-libs/gst/allocators/meson.build

If we are guarding the entire file here --> gst-libs/gst/allocators/meson.build
with

if get_option('allocators').enabled()

then the token `allocators_dep` remains undefined.
Should we not then guard the other calls to this token, as well?

See patches submitted:

patch-ext_gl_meson.build
patch-gst-libs_gst_gl_meson.build
Comment 6 Bryan Baldwin 2022-10-25 04:10:29 UTC
Created attachment 237600 [details]
Guard against masked token in gst-libs/gst/allocators/meson.build
Comment 7 Joel Rodriguez 2022-11-01 16:56:59 UTC
Running FreeBSD 12.3-RELEASE-p6 GENERIC

Will this issue be resolved soon? This issue is holding up all downstream dependencies.

Thanks
Joel
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-11-01 23:25:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=040e9e09916bc42675bb0d3aa94fee4787bb15c3

commit 040e9e09916bc42675bb0d3aa94fee4787bb15c3
Author:     Thomas Zander <riggs@FreeBSD.org>
AuthorDate: 2022-11-01 22:36:11 +0000
Commit:     Thomas Zander <riggs@FreeBSD.org>
CommitDate: 2022-11-01 23:24:41 +0000

    multimedia/gstreamer1-plugins: Fix build in the presence of libdrm

    PR:             267100
    Reported by:    rkoberman@gmail.com

 .../files/patch-ext_gl_meson.build                 | 15 ++++++++++--
 .../files/patch-gst-libs_gst_gl_meson.build        | 28 +++++++++++++++-------
 2 files changed, 33 insertions(+), 10 deletions(-)
Comment 9 Thomas Zander freebsd_committer freebsd_triage 2022-11-01 23:32:45 UTC
https://cgit.freebsd.org/ports/commit/?id=040e9e09916bc42675bb0d3aa94fee4787bb15c3 should build the port without the allocator dependency despite the presence of libdrm, producing a plugin like from the package build in a clean environment.

We can reopen this bug if it still does not work after this change.