Skip to contentSkip to conversation

cogl-1.0: put each library into its own package

PATCH In review Andreas Oberritter 4 participants 10 messages Jul 11, 2013

lore
Share & tools
lore
#1 lore raw

PATCH 2/3 cogl-1.0: make building cogl-pango optional

In reply to Andreas Oberritter

Add a 'cogl-pango' PACKAGECONFIG option and enable it by default.

---
 meta/recipes-graphics/cogl/cogl-1.0.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-graphics/cogl/cogl-1.0.inc +4 -2
index 8400668..c0d410e 100644
@@ -8,7 +8,7 @@ SRC_URI += "file://cogl_fixed_mul-constraint.patch \
 
 inherit clutter
 
-DEPENDS = "pango glib-2.0 gdk-pixbuf"
+DEPENDS = "glib-2.0 gdk-pixbuf"
 PACKAGES =+ "${PN}-examples \
              libcogl libcogl-dev \
              libcogl-gles2 libcogl-gles2-dev \
@@ -34,6 +34,8 @@ EXTRA_OECONF += "--disable-introspection	\
 	       	 --disable-gles1		\
 	    	"
 
+PACKAGECONFIG[cogl-pango] = "--enable-cogl-pango,--disable-cogl-pango,pango"
+
 # GL flavours
 PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,${EDEPENDS_GL},${ERDEPENDS_GL}"
 PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,${EDEPENDS_GLES2}, ${ERDEPENDS_GLES2}"
@@ -52,7 +54,7 @@ PACKAGECONFIG[wayland-server] = "--enable-wayland-egl-server,--disable-wayland-e
 
 # Respect the DISTRO_FEATURES to pull in GLX or Wayland as appropriate by
 # default.
-PACKAGECONFIG ??= "gl \
+PACKAGECONFIG ??= "cogl-pango gl \
                    ${@base_contains('DISTRO_FEATURES', 'wayland', 'egl-wayland', '', d)} \
                    ${@base_contains('DISTRO_FEATURES', 'x11', 'glx', '', d)}"
 
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 3/3 cogl-1.0: add option to enable GLES1

In reply to Andreas Oberritter

Only PACKAGECONFIG options for GL and GLES2 were available before.

---
 meta/recipes-graphics/cogl/cogl-1.0.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-graphics/cogl/cogl-1.0.inc +3 -0
index c0d410e..f2c1e26 100644
@@ -17,6 +17,7 @@ AUTOTOOLS_AUXDIR = "${S}/build"
 
 # Extra DEPENDS for PACKAGECONFIG
 EDEPENDS_GL = "virtual/libgl libdrm"
+EDEPENDS_GLES1 = "virtual/libgles1"
 EDEPENDS_GLES2 = "virtual/libgles2"
 EDEPENDS_KMS = "libdrm virtual/egl"
 EDEPENDS_EGL = "virtual/egl"
@@ -26,6 +27,7 @@ EDEPENDS_WAYLAND = "wayland"
 # Extra RDEPENDS for PACKAGECONFIG
 # This has to be explictly listed, because cogl dlopens the backends
 ERDEPENDS_GL    = "libgl"
+ERDEPENDS_GLES1 = "libgles1"
 ERDEPENDS_GLES2 = "libgles2"
 
 EXTRA_OECONF += "--disable-introspection	\
@@ -38,6 +40,7 @@ PACKAGECONFIG[cogl-pango] = "--enable-cogl-pango,--disable-cogl-pango,pango"
 
 # GL flavours
 PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,${EDEPENDS_GL},${ERDEPENDS_GL}"
+PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,${EDEPENDS_GLES1}, ${ERDEPENDS_GLES1}"
 PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,${EDEPENDS_GLES2}, ${ERDEPENDS_GLES2}"
 
 # EGL backends
Signature · 1 line
1.8.1.2
#0 lore raw

PATCH 1/3 cogl-1.0: put each library into its own package

This allows to install cogl-gles2 and cogl-pango only when needed and enables Debian package renaming. This stops cogl-pango from dragging in unwanted runtime dependencies, if cogl-pango isn't used.

---
 meta/recipes-graphics/cogl/cogl-1.0.inc | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
meta/recipes-graphics/cogl/cogl-1.0.inc +26 -1
index 55eb003..8400668 100644
@@ -9,7 +9,10 @@ SRC_URI += "file://cogl_fixed_mul-constraint.patch \
 inherit clutter
 
 DEPENDS = "pango glib-2.0 gdk-pixbuf"
-PACKAGES =+ "${PN}-examples"
+PACKAGES =+ "${PN}-examples \
+             libcogl libcogl-dev \
+             libcogl-gles2 libcogl-gles2-dev \
+             libcogl-pango libcogl-pango-dev"
 AUTOTOOLS_AUXDIR = "${S}/build"
 
 # Extra DEPENDS for PACKAGECONFIG
@@ -54,3 +57,25 @@ PACKAGECONFIG ??= "gl \
                    ${@base_contains('DISTRO_FEATURES', 'x11', 'glx', '', d)}"
 
 FILES_${PN}-examples = "${bindir}/* ${datadir}/cogl/examples-data/*"
+FILES_libcogl = "${libdir}/libcogl${SOLIBS}"
+FILES_libcogl-dev = "${includedir}/cogl/cogl \
+                     ${libdir}/libcogl${SOLIBSDEV} \
+                     ${libdir}/libcogl.la \
+                     ${libdir}/pkgconfig/cogl-1.0.pc \
+                     ${libdir}/pkgconfig/cogl-2.0-experimental.pc \
+                     ${libdir}/pkgconfig/cogl-gl-1.0.pc"
+FILES_libcogl-gles2 = "${libdir}/libcogl-gles2${SOLIBS}"
+FILES_libcogl-gles2-dev = "${includedir}/cogl/cogl-gles2 \
+                           ${libdir}/libcogl-gles2${SOLIBSDEV} \
+                           ${libdir}/libcogl-gles2.la \
+                           ${libdir}/pkgconfig/cogl-gles2-experimental.pc"
+FILES_libcogl-pango = "${libdir}/libcogl-pango${SOLIBS}"
+FILES_libcogl-pango-dev = "${includedir}/cogl/cogl-pango \
+                           ${libdir}/libcogl-pango${SOLIBSDEV} \
+                           ${libdir}/libcogl-pango.la \
+                           ${libdir}/pkgconfig/cogl-pango-1.0.pc"
+
+# For backwards compatibility after Debian-renaming
+RPROVIDES_libcogl = "cogl-1.0"
+RCONFLICTS_libcogl = "cogl-1.0"
+RREPLACES_libcogl = "cogl-1.0"
Signature · 1 line
1.8.1.2
#6 lore raw

Re: [PATCH 3/3] cogl-1.0: add option to enable GLES1

In reply to Andreas Oberritter
Quoted 1 line · Andreas Oberritter

Only PACKAGECONFIG options for GL and GLES2 were available before.

The rationale behind this was that the GLES1 support isn't tested, mainly as there's not a lot of hardware that can't also do GLESv2. Was this enabled for completeness or are you actually restricted to GLESv1?

Ross

#2 lore raw

Re: [PATCH 2/3] cogl-1.0: make building cogl-pango optional

In reply to Andreas Oberritter
Quoted 1 line · Andreas Oberritter

Add a 'cogl-pango' PACKAGECONFIG option and enable it by default.

Really picky, but can we call this just "pango"?

Ross

#3 lore raw

Re: [PATCH 2/3] cogl-1.0: make building cogl-pango optional

Quoted 4 lines · Ross
Quoted 1 line · Andreas Oberritter

Add a 'cogl-pango' PACKAGECONFIG option and enable it by default.

Really picky, but can we call this just "pango"?

+1 for that; otherwise, these patches makes good sense to me.

Tomas

Signature · 1 line
http://sleepfive.com
#7 lore raw

Re: [PATCH 3/3] cogl-1.0: add option to enable GLES1

In reply to Burton, Ross
Quoted 7 lines · Ross
Quoted 1 line · Andreas Oberritter

Only PACKAGECONFIG options for GL and GLES2 were available before.

The rationale behind this was that the GLES1 support isn't tested, mainly as there's not a lot of hardware that can't also do GLESv2. Was this enabled for completeness or are you actually restricted to GLESv1?

It's for completeness, so if you have libraries for both GLES1 and GLES2, you can compare them easily and then choose the one that works better for your application. If nothing else, then this may improve test coverage. Because it's disabled by default, introducing this option doesn't have any bad side effects. On the good side, it explicitly disables GLES1, so if a later version of cogl switches to auto-detection, the behaviour of the build won't change.

Regards,
Andreas

#4 lore raw

Re: [PATCH 2/3] cogl-1.0: make building cogl-pango optional

In reply to Burton, Ross
Quoted 4 lines · Ross
Quoted 1 line · Andreas Oberritter

Add a 'cogl-pango' PACKAGECONFIG option and enable it by default.

Really picky, but can we call this just "pango"?

I prefer cogl-pango, because I think it's more useful to derive the name from the configure option rather than from the dependency. This way it won't conflict with a future option --enable-pango or --enable-something-else-which-depends-on-pango. If you look at --enable-gles2 vs. --enable-cogl-gles2, this just seems to be the right thing to do.

Regards,
Andreas

#8 lore raw

Re: [PATCH 3/3] cogl-1.0: add option to enable GLES1

In reply to Andreas Oberritter
Quoted 5 lines · Andreas Oberritter
Quoted 4 lines

The rationale behind this was that the GLES1 support isn't tested, mainly as there's not a lot of hardware that can't also do GLESv2. Was this enabled for completeness or are you actually restricted to GLESv1?

Quoted 7 lines

It's for completeness, so if you have libraries for both GLES1 and GLES2, you can compare them easily and then choose the one that works better for your application. If nothing else, then this may improve test coverage. Because it's disabled by default, introducing this option doesn't have any bad side effects. On the good side, it explicitly disables GLES1, so if a later version of cogl switches to auto-detection, the behaviour of the build won't change.

The GLESv2 backend will work best, because the v1 backend is crippled by v1's limitations and lack of testing. And GLESv1 is already disabled explicitly in EXTRA_OECONF (that this patch should remove).

I'm leaning towards rejecting this as it doesn't serve a purpose, unless someone can say that they're actually using the GLESv1 backend (that upstream admits isn't tested).

Ross

#9 lore raw

Re: [PATCH 3/3] cogl-1.0: add option to enable GLES1

In reply to Andreas Oberritter
Quoted 4 lines · Andreas Oberritter
Quoted 3 lines · Ross
Quoted 1 line · Andreas Oberritter

Only PACKAGECONFIG options for GL and GLES2 were available before.

Quoted 8 lines
Quoted 4 lines

The rationale behind this was that the GLES1 support isn't tested, mainly as there's not a lot of hardware that can't also do GLESv2. Was this enabled for completeness or are you actually restricted to GLESv1?

It's for completeness, so if you have libraries for both GLES1 and GLES2, you can compare them easily and then choose the one that works better for your application.

If your hardware supports GLESv2 then it seems very unlikely that the GLESv1 backend is going to work better for any application. I suppose it's just about conceivable that there might be some or other bug in the GLESv2 driver which you could work around by using the GLESv1 API, but I've never heard of this happening in practice and it doesn't sound very likely.

I wouldn't be surprised if Cogl's GLESv1 backend went away altogether in the not-too-distant future. The gap in capabilities between GLESv1 and either GLESv2 or big GL is quite significant.

All that said, if there is genuine (even if possibly misguided) interest in experimenting with GLESv1 then I don't have any real objection to adding a PACKAGECONFIG option for it.

p.