#721199 cairo: enable gles2 backend on ARM and alternative depends

#721199#5
Date:
2013-08-28 23:31:10 UTC
From:
To:
Hello,

  We are building cairo with GL backend on all architecture. For the ARM architecture, it would be nice to enable GLES2 backend.

  It would also be nice to enable third party alternatives for EGL/GL/GLES stack.

  The following patch does both things in one, let me know if I should split the patch or the bug report.


diff -Nru cairo-1.12.14/debian/changelog cairo-1.12.14/debian/changelog
--- cairo-1.12.14/debian/changelog	2013-06-12 19:33:49.000000000 +0200
+++ cairo-1.12.14/debian/changelog	2013-08-28 23:45:26.000000000 +0200
@@ -1,3 +1,11 @@
+cairo (1.12.14-5.1) unstable; urgency=low
+
+  * d/control:
+    - enable gles2 backend on ARM.
+    - alternative depends on third party EGL/GL/GLES2 libs
+
+ -- Hector Oron <hector.oron@collabora.co.uk>  Wed, 28 Aug 2013 23:43:27 +0200
+
 cairo (1.12.14-5) unstable; urgency=low

   * Add gl/egl support back now that wayland has been multi-archified.
diff -Nru cairo-1.12.14/debian/control cairo-1.12.14/debian/control
--- cairo-1.12.14/debian/control	2013-06-12 19:33:49.000000000 +0200
+++ cairo-1.12.14/debian/control	2013-08-29 00:04:25.000000000 +0200
@@ -21,8 +21,9 @@
                libxcb1-dev (>= 1.6),
                libxcb-render0-dev (>= 1.6),
                libxcb-shm0-dev,
-               libgl1-mesa-dev,
-               libegl1-mesa-dev [!hurd-any],
+               libgl1-mesa-dev [!armel !armhf] | libgl1-dev [!armel !armhf],
+               libegl1-mesa-dev [!hurd-any] | libegl1-dev [!hurd-any],
+               libgles2-mesa-dev [armel armhf] | libgles2-dev [armel armhf],
                libglib2.0-dev,
                zlib1g-dev,
                liblzo2-dev
@@ -48,8 +49,9 @@
          libxcb1-dev (>= 1.6),
          libxcb-render0-dev (>= 1.6),
          libxcb-shm0-dev,
-         libgl1-mesa-dev,
-         libegl1-mesa-dev [!hurd-any],
+         libgl1-mesa-dev [!armhf !armel] | libgl1-dev [!armhf !armel],
+         libegl1-mesa-dev [!hurd-any] | libegl1-dev [!hurd-any],
+         libgles2-mesa-dev [armhf armel] | libgles2-dev [armhf armel],
          libglib2.0-dev,
          ${shlibs:Depends},
          ${misc:Depends}
diff -Nru cairo-1.12.14/debian/rules cairo-1.12.14/debian/rules
--- cairo-1.12.14/debian/rules	2013-06-12 19:33:49.000000000 +0200
+++ cairo-1.12.14/debian/rules	2013-08-29 00:16:13.000000000 +0200
@@ -35,6 +35,8 @@
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

 configure_flags += \
 --prefix=/usr \
@@ -52,11 +54,21 @@
 configure_flags += --host=$(DEB_HOST_GNU_TYPE)
 endif

+ifeq (,$(findstring $(DEB_HOST_ARCH_OS),hurd))
+	configure_flags += --enable-egl=yes
+endif
+
+ifneq (,$(findstring $(DEB_HOST_ARCH),armel armhf))
+	configure_flags += --enable-glesv2=yes
+else
+	configure_flags += --enable-gl
+endif
+
 main_configure_flags += \
 $(configure_flags) \
 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
 --enable-xlib --enable-svg \
---enable-xcb --enable-perf-utils --enable-gl
+--enable-xcb --enable-perf-utils

 udeb_configure_flags += \
 $(configure_flags) \

Regards

#721199#10
Date:
2013-08-29 10:32:55 UTC
From:
To:
Doesn't this need different symbol files for arm then? Also why GLES on
ARM but not on x86? :) I think the real solution to all this would be if
cairo would become more modular with its backends and desktop GL and
GLES could be built both.

#721199#15
Date:
2013-08-29 10:55:43 UTC
From:
To:
You can't currently build with --enable-gl and --enable-glesv2, see
https://bugs.freedesktop.org/show_bug.cgi?id=57379

That would probably also avoid things like
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712169

Emilio