<div class="gmail_quote">On Thu, Sep 6, 2012 at 4:25 PM, Koen Kooi <span dir="ltr">&lt;<a href="mailto:koen@dominion.thruhere.net" target="_blank">koen@dominion.thruhere.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Op 6 sep. 2012, om 15:04 heeft &quot;Burton, Ross&quot; &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt; het volgende geschreven:<br>
<div><div class="h5"><br>
&gt; (CCing oe-core, discussion should happen there really)<br>
&gt;<br>
&gt; On 6 September 2012 11:00, Andrei Gherzan &lt;<a href="mailto:andrei@gherzan.ro">andrei@gherzan.ro</a>&gt; wrote:<br>
&gt;&gt; In DISTRO_FEATURES we have opengl. That is pretty vague and generally we<br>
&gt;&gt; don&#39;t want to have mesa on machines where there is no libgl but only gles +<br>
&gt;&gt; egl. For example if we want to compile something that adds a DEPENDS based<br>
&gt;&gt; on DISTRO_FEATURE opengl, this dependency will be added even if there is no<br>
&gt;&gt; libgl implemented for that specific machine.<br>
&gt;&gt;<br>
&gt;&gt; First idea would be that opengl (gl / gles) are machine related. On the<br>
&gt;&gt; other hand opengl can be a DISTRO_FEATURE as we have a software<br>
&gt;&gt; implementation - mesa.<br>
&gt;&gt;<br>
&gt;&gt; How would you guys see a solution for this? The idea that came into my mind<br>
&gt;&gt; was to map opengl to libgl or libgles. Or to both if there is the case.<br>
&gt;<br>
&gt; (First I must apologise for the uneven flow of this mail - my mornings<br>
&gt; been pretty choppy but hopefully people can see what I&#39;m thinking)<br>
&gt;<br>
&gt; I&#39;ve been thinking about this quite a lot recently, as the current<br>
&gt; setup is broken in some way on most hardware.  There is a bigger<br>
&gt; problem than just distro or machine features - the packaging isn&#39;t<br>
&gt; obvious or correct either.<br>
&gt;<br>
&gt; First, we need a concrete definition of the &quot;opengl&quot; distro feature.<br>
&gt; I propose just &quot;some form of OpenGL functionality&quot; without any<br>
&gt; implications about what specification is present.<br>
&gt;<br>
&gt; Then, machine features for the portions of OpenGL that the hardware<br>
&gt; supports - gl, gles1, gles2.  I&#39;d love to say &quot;gles&quot; means GLESv2 but<br>
&gt; I suspect we&#39;re not quite safe from the horrors of hardware that only<br>
&gt; supports GLESv1 yet.<br>
&gt;<br>
&gt; We then need more virtual providers for the GL libraries.  Mesa is an<br>
&gt; obvious provider - it provides libgl, libglesv1, libglesv2 and libegl.<br>
&gt; On Raspberry Pi the binary drivers provide libglesv1, glesv2, and<br>
&gt; egl.  As the performance of the software renderer will be terrible,<br>
&gt; unsetting the libgl provider makes a lot of sense.<br>
&gt;<br>
&gt; Because there are multiple providers of the GL libraries, and they are<br>
&gt; not all specific to a single machine, every package that provides GL<br>
&gt; packages need to be namespaced.  The Debian-renaming makes this<br>
&gt; trickier but luckily it can be overridden in the recipe, so Mesa<br>
&gt; should be building libgl-mesa, libegl-mesa, and so on.  Every other<br>
&gt; provider of the GL libraries should do this too.<br>
&gt;<br>
&gt; Library dependencies are also broken, of course.  A package that links<br>
&gt; to libGL.so.1 shouldn&#39;t get a dependency on mesa-dri or whatever was<br>
&gt; installed to provide that library, but a dependency on a virtual<br>
&gt; &quot;libgl&quot; package.  As far as I&#39;m aware this isn&#39;t something that the<br>
&gt; automatic shlibs dependency generation handles, but there is plenty of<br>
&gt; prior art for this.<br>
<br>
</div></div>It&#39;s not automatic, but you can do something like this:<br>
<br>
        <a href="http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/commit/?id=23b02134" target="_blank">http://git.yoctoproject.org/cgit/cgit.cgi/meta-ti/commit/?id=23b02134</a><br>
<br>
That recipe ships multiple copies of the libraries to account for different silicon revisions (the shader compiler will offload different things to the CPU), but we don&#39;t want the shlibs code to pickup the copies. So for mesa you can do:<br>


<br>
        PRIVATE_LIBS_${PN}-dri = &quot;libGL.so&quot;<br>
        RPROVIDES_${PN}-dri = $magic_python_function(PACKAGE_CONFIG, sometthing, something, libgl)<br>
<br>
And in the recipes that link to a GL lib you do:<br>
<br>
        RDEPENDS_${PN} = &quot;libGL&quot;<br>
<br>
Which only leaves the DISTRO to sort out the runtime preferred provider, which is likely a conf file with a bunch of PACKAGE_CONFIG entries for all the machines the DISTRO wants to support.<br><br></blockquote><div>I&#39;m not sure how this would work as there are recipes like libsdl with:</div>

<div>${@base_contains(&#39;DISTRO_FEATURES&#39;, &#39;opengl&#39;, &#39;virtual/libgl&#39;, &#39;&#39;, d)} </div><div><br></div><div>ag </div></div>