Page MenuHomeFreeBSD

multimedia/kodi-devel: Add GBM flavor and prepare for Wayland support
AbandonedPublic

Authored by tobik on Dec 31 2017, 12:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 25, 1:44 PM
Unknown Object (File)
Thu, Mar 21, 8:36 PM
Unknown Object (File)
Tue, Mar 12, 4:50 AM
Unknown Object (File)
Jan 6 2024, 10:15 AM
Unknown Object (File)
Dec 28 2023, 4:21 PM
Unknown Object (File)
Dec 28 2023, 8:14 AM
Unknown Object (File)
Dec 20 2023, 3:50 AM
Unknown Object (File)
Dec 13 2023, 10:14 PM
Subscribers

Details

Reviewers
mat
bdrewery
Group Reviewers
Contributor Reviewers (ports)
Summary

This adds a 'gbm' flavor to kodi-devel with which we can run Kodi
directly from the console without Xorg or a Wayland compositor.

The gbm flavor requires graphics/drm-next-kmod and evdev support, so
there is no much point in building it for FreeBSD 11.1.

This also adds preliminary Wayland support to kodi-devel. It requires
a new port graphics/waylandpp (C++ bindings for Wayland) [1] that can
only be built when graphics/mesa-libs has been built with WAYLAND
support, which is still off by default, so I have not added it to
FLAVORS yet.

I hope I can get approval to commit it to the tree. Though kodi-devel
won't built on 12.0-CURRENT until the fix for RapidJSON (D13599) is
committed.

[1] https://github.com/t6/freebsd-ports-sndio/blob/sndio-rebase/graphics/waylandpp

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 14025
Build 14215: arc lint + arc unit

Event Timeline

Fix conflicts

The kodi wrapper script already tries to infer in what kind of
environment it runs and calls lib/kodi/kodi-{x11,gbm,wayland} as
appropriate. The data files and supporting libraries do not change
between the different flavors.

Make gbm the default flavor. It installs all necessary data files
and doesn't add any additional dependencies when compared to the x11
or wayland flavors. Users can then install additional platform
binaries with the kodi-devel-{x11,wayland} packages.

I admit I only use kodi on my π3 running openelec so I don't really know much about it, but, hum, what good is it without x11? I mean, you need to display videos, does it come with its own display thingie ?

Also, can the multiple flavors be installed at once?

In D13712#287419, @mat wrote:

I admit I only use kodi on my π3 running openelec so I don't really know much about it, but, hum, what good is it without x11? I mean, you need to display videos, does it come with its own display thingie ?

Yes, it uses the DRM drivers (via libgbm, libdrm, and libEGL) directly to display itself.

It also requires evdev support in the kernel if you want to control it with your keyboard/mouse (but using a smartphone or tablet remote control should work too).

In D13712#287420, @mat wrote:

Also, can the multiple flavors be installed at once?

Yes, they can all be installed at the same time. kodi-devel@gbm (which installs all necessary data files) has to be installed for the x11 and wayland flavors to even work.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

In D13712#287420, @mat wrote:

Also, can the multiple flavors be installed at once?

Yes, they can all be installed at the same time. kodi-devel@gbm (which installs all necessary data files) has to be installed for the x11 and wayland flavors to even work.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

Mmmm, as all the Python ports have flavors all over their dependencies, and it works just fine with poudriere, I guess it should work just fine here.

What exactly did you put in the Makefile ?

In D13712#287444, @mat wrote:
In D13712#287420, @mat wrote:

Also, can the multiple flavors be installed at once?

Yes, they can all be installed at the same time. kodi-devel@gbm (which installs all necessary data files) has to be installed for the x11 and wayland flavors to even work.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

Mmmm, as all the Python ports have flavors all over their dependencies, and it works just fine with poudriere, I guess it should work just fine here.

What exactly did you put in the Makefile ?

I basically just added

wayland_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm
x11_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm

Let me try removing @gbm...

What exactly did you put in the Makefile ?

I basically just added

wayland_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm
x11_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm

Let me try removing @gbm...

No, the @gbm is right. It should work.
I'm exhausted today, but I'll have a look tomorrow if it's ok with you.

In D13712#287420, @mat wrote:

Also, can the multiple flavors be installed at once?

Yes, they can all be installed at the same time. kodi-devel@gbm (which installs all necessary data files) has to be installed for the x11 and wayland flavors to even work.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

Where exactly are you adding the RUN_DEPENDS at? Which Makefile?

bdrewery requested changes to this revision.Jan 2 2018, 9:47 PM

Block pending potential Poudriere bug.

This revision now requires changes to proceed.Jan 2 2018, 9:47 PM
  • Add the broken *_RUN_DEPENDS
In D13712#287532, @mat wrote:

What exactly did you put in the Makefile ?

I basically just added

wayland_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm
x11_RUN_DEPENDS=        kodi-devel>=0:multimedia/kodi-devel@gbm

Let me try removing @gbm...

No, the @gbm is right. It should work.
I'm exhausted today, but I'll have a look tomorrow if it's ok with you.

Of course.

In D13712#287420, @mat wrote:

Also, can the multiple flavors be installed at once?

Yes, they can all be installed at the same time. kodi-devel@gbm (which installs all necessary data files) has to be installed for the x11 and wayland flavors to even work.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

Where exactly are you adding the RUN_DEPENDS at? Which Makefile?

multimedia/kodi-devel/Makefile

I've updated the differential to include them now.

multimedia/kodi-devel/Makefile
109

At that point, FLAVOR can be undefined, so using :U is right, but gbm is the default flavor, so it is also the value that is to be used when FLAVOR is undefined. So either change this to:

​.if ${FLAVOR:Ugbm} == gbm || ${FLAVOR:U} == wayland

Or just after the FLAVORS line, add a:

FLAVOR?=  ${FLAVORS:[1]}
168

same here, :Ugbm

tobik marked 2 inline comments as done.
  • Add FLAVOR?=${FLAVORS:[1]}

Side question, you can't ask kodi to build for x11/wayland/gbm at the same time?

In D13712#287675, @mat wrote:

Side question, you can't ask kodi to build for x11/wayland/gbm at the same time?

No, IIUC it's a singleton design and the build system just wires in the platform sources depending on whatever CORE_PLATFORM_NAME is set to.

In D13712#287675, @mat wrote:

Side question, you can't ask kodi to build for x11/wayland/gbm at the same time?

No, IIUC it's a singleton design and the build system just wires in the platform sources depending on whatever CORE_PLATFORM_NAME is set to.

Ok, just checking that this was flavors and not sub-packages :-)

multimedia/kodi-devel/Makefile
58

Ok yeah this is a problem. A port cannot depend on itself. It seems like you're trying to do a sub-package thing here by making kodi-devel a meta package of the 2 possible flavors?

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

The bug in Poudriere, IMHO, is that the error is obscure and needs to explicitly deny a port depending on itself: https://github.com/freebsd/poudriere/issues/574

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

The bug in Poudriere, IMHO, is that the error is obscure and needs to explicitly deny a port depending on itself: https://github.com/freebsd/poudriere/issues/574

Oddly with Poudriere 3.2.3 I actually get the proper error: [00:00:19] [Dry Run] Warning: (multimedia/kodi-devel@x11): Error: multimedia/kodi-devel incorrectly depends on itself. Please contact maintainer of the port to fix this.

Adding a RUN_DEPENDS on kodi-devel@gbm to the x11 and wayland flavors is something that Poudriere doesn't seem to like (the ports framework
itself appears to not mind):

[00:00:02] Gathering ports metadata
[00:00:03] Warning: (multimedia/kodi-devel): Error: gather_port_vars_port: Already had multimedia/kodi-devel (rdep=metadata gbm listed)
[00:00:03] Error: Fatal errors encountered gathering ports metadata

Do you think this is a bug in Poudriere? Or am I misusing flavors?

The bug in Poudriere, IMHO, is that the error is obscure and needs to explicitly deny a port depending on itself: https://github.com/freebsd/poudriere/issues/574

Oddly with Poudriere 3.2.3 I actually get the proper error: [00:00:19] [Dry Run] Warning: (multimedia/kodi-devel@x11): Error: multimedia/kodi-devel incorrectly depends on itself. Please contact maintainer of the port to fix this.

The error message I quoted came from poudriere testport.

multimedia/kodi-devel/Makefile
58

Can you explain why? Surely a package can depend on another package regardless of how it is built or what origin it has.

Let's assume I split multimedia/kodi-devel up into three ports: (1) multimedia/kodi-devel-gbm, (2) multimedia/kodi-devel-wayland, (3) multimedia/kodi-devel-x11. Then I would have no problems whatsoever to let (2) depend on (1), and (3) depend on (1).

Maybe I should do that instead.

multimedia/kodi-devel/Makefile
58

Your reasoning makes sense but it's just not the pattern we use in Ports right now.
Let's step back though...

Kodi depends on itself?
How so?
Is it some sub-component of Kodi that needs to be built before the larger piece?
Or is it just some module, like a core module, that can be different for the main package to use?

multimedia/kodi-devel/Makefile
58

Let me quote two earlier comments I wrote here:

Fix conflicts

The kodi wrapper script already tries to infer in what kind of
environment it runs and calls lib/kodi/kodi-{x11,gbm,wayland} as
appropriate. The data files and supporting libraries do not change
between the different flavors.

Make gbm the default flavor. It installs all necessary data files
and doesn't add any additional dependencies when compared to the x11
or wayland flavors. Users can then install additional platform
binaries with the kodi-devel-{x11,wayland} packages.

To prevent having to add CONFLICTS_INSTALL to all flavors (like I did in the initial revision of this differential), both x11 and wayland do not install the data files, but gbm does. So I want to add a RUN_DEPENDS to get them when someone only installs kodi-devel-x11. Having conflicts between them makes Kodi annoying to test and is really unnecessary.

In D13712#287675, @mat wrote:

Side question, you can't ask kodi to build for x11/wayland/gbm at the same time?

No, IIUC it's a singleton design and the build system just wires in the platform sources depending on whatever CORE_PLATFORM_NAME is set to.

To get lib/kodi/kodi-{x11,wayland,gbm} I have to rebuild Kodi three times (hence the use of flavors), but I'd like to be able to install them simultaneously.

So I'm really stuck between five choices:

Do I

  1. live with the conflicts?
  1. not care about this at all? (Users can figure this out, right?)
  1. add a pkg-message (the horror) to tell users to install gbm as well?
  1. add a RUN_DEPENDS on gbm to wayland and x11?
  1. add unique suffixes to lib/kodi, bin/kodi, include/kodi, share/kodi? (Which basically means supporting addons just became a lot harder than necessary)

IMHO the only sensible choice here is 4 or 3.

  • Enable build on armv6/armv7
  • Rename gbm flavor to native
  • Rename patch-wayland to the more accurate patch-evdev
  • Add armv* only RPI option in the native flavor to enable support for the Raspberry Pi. When enabled Kodi will be built with the rbpi platform instead of gbm.

The RPI option does not seem to have a description, also, it seems it is not enable when arch=arm*, but maybe it is normal.

In D13712#288405, @mat wrote:

The RPI option does not seem to have a description, also, it seems it is not enable when arch=arm*, but maybe it is normal.

Right, thanks. Added one.

Yes, it's off by default because of bad default options in ffmpeg (VAAPI=on adds libva which depends on mesa-libs which conflicts with raspberrpi-userland).

  • Fix build with all other flavors again
  • Slave VAAPI to wayland. It's always required.

I've added platform options to the port in rP458517 and I'm abandoning this for now. With the options in place I can easily flavorize it myself via Makefile.local for the time being.

Thank you for taking the time to review this.