Merge lp:~saiarcot895/ubuntu/utopic/openscenegraph/armhf-support into lp:ubuntu/utopic/openscenegraph

Proposed by Saikrishna Arcot
Status: Merged
Merged at revision: 41
Proposed branch: lp:~saiarcot895/ubuntu/utopic/openscenegraph/armhf-support
Merge into: lp:ubuntu/utopic/openscenegraph
Diff against target: 120 lines (+65/-2)
6 files modified
debian/changelog (+11/-0)
debian/control (+4/-2)
debian/patches/change-typedef.patch (+13/-0)
debian/patches/dont-build-osgframerenderer-on-gles.patch (+24/-0)
debian/patches/series (+2/-0)
debian/rules (+11/-0)
To merge this branch: bzr merge lp:~saiarcot895/ubuntu/utopic/openscenegraph/armhf-support
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+229453@code.launchpad.net

Description of the change

This adds support for building on Ubuntu armhf by building OpenSceneGraph with OpenGL ES 2.0. To do this, two build dependencies needed to be added: libegl1-mesa-dev and libgles2-mesa-dev. libgl1-mesa-dev isn't needed for OpenGL ES, and so it has been excluded from armhf.

In addition, a patch that changes the method of selecting what version of OpenGL/OpenGL ES contained a change that excluded one of the examples from being built under certain conditions. That part of the change is included here (as it would otherwise cause a build failure).

Note that OpenSceneGraph will still FTBFS, but will fail at a later point. This is because one of the examples uses freeglut, which still uses OpenGL. The option of building freeglut with OpenGL ES is still in the trunk and is expected to be released with version 3.0. While this example could be temporarily excluded, any application that uses both openscenegraph and freeglut will still FTBFS. The intention for this MP is so that when freetype 3.0 is released, only that package's packaging will have to be changed.

To post a comment you must log in.
Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

In commit 42, there is a build error with regards to typedef'ing GLdouble if it isn't defined. Openscenegraph typedefs it to double, while Qt typedefs it to GLfloat (which will be a float). Because of this, a build error occurs. In addition, Qt uses checks if GLdouble is defined using #ifndef, which returns true (that it's not defined), since the typedef doesn't affect #defines.

Revision history for this message
Daniel Holbach (dholbach) wrote :
review: Needs Fixing
Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

(Copied from bug)

Something's odd there. Openscenegraph shouldn't be building with Qt5 in Ubuntu (although it is supported, IIRC). I take it this is not in a chroot?

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for pointing this out. This was in a chroot, where Qt5 was installed. I'll upload this to a test ppa which does armhf builds in a bit.

Revision history for this message
Daniel Holbach (dholbach) wrote :
Revision history for this message
Saikrishna Arcot (saiarcot895) wrote :

That is due to the freeglut dependency not yet supporting OpenGL ES and therefore giving an error (as mentioned in the 3rd paragraph of my description). It looks like freeglut is only used in the examples section, so I'm excluding that dependency for armhf.

QGIS and simgear (the library for flightgear) might build, but flightgear won't build until freeglut 3.0 is released.

Revision history for this message
Daniel Holbach (dholbach) wrote :
Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks. Uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-05-17 16:52:38 +0000
3+++ debian/changelog 2014-08-12 11:30:57 +0000
4@@ -1,3 +1,14 @@
5+openscenegraph (3.2.0~rc1-5.1ubuntu1) utopic; urgency=low
6+
7+ * Add support for building on armhf by building with OpenGL ES 2.0
8+ (LP: #1284190).
9+ * Backport part of a commit to not build osgframerenderer example.
10+ * Add change-typedef.patch to fix conflicting typedefs for GLdouble
11+ with OpenGL ES 2.0
12+ * Exclude freeglut3-dev from dependencies for armhf
13+
14+ -- Saikrishna Arcot <saiarcot895@gmail.com> Wed, 06 Aug 2014 17:41:46 -0500
15+
16 openscenegraph (3.2.0~rc1-5.1) unstable; urgency=low
17
18 * Non-maintainer upload.
19
20=== modified file 'debian/control'
21--- debian/control 2014-05-17 16:52:38 +0000
22+++ debian/control 2014-08-12 11:30:57 +0000
23@@ -20,8 +20,10 @@
24 libgdal-dev,
25 libx11-dev,
26 libxmu-dev,
27- freeglut3-dev,
28- libgl1-mesa-dev | libgl-dev,
29+ freeglut3-dev [!armhf],
30+ libgl1-mesa-dev [!armhf] | libgl-dev [!armhf],
31+ libegl1-mesa-dev [armhf],
32+ libgles2-mesa-dev [armhf],
33 libxine2-dev,
34 libavcodec-dev,
35 libswscale-dev,
36
37=== added file 'debian/patches/change-typedef.patch'
38--- debian/patches/change-typedef.patch 1970-01-01 00:00:00 +0000
39+++ debian/patches/change-typedef.patch 2014-08-12 11:30:57 +0000
40@@ -0,0 +1,13 @@
41+Index: openscenegraph/OpenSceneGraph/include/osg/GL
42+===================================================================
43+--- openscenegraph.orig/OpenSceneGraph/include/osg/GL 2014-08-05 16:58:36.000000000 -0500
44++++ openscenegraph/OpenSceneGraph/include/osg/GL 2014-08-06 06:45:29.857287930 -0500
45+@@ -168,7 +168,7 @@
46+ // add defines for OpenGL targets that don't define them, just to ease compatibility across targets
47+ #ifndef GL_DOUBLE
48+ #define GL_DOUBLE 0x140A
49+- typedef double GLdouble;
50++ #define GLdouble double
51+ #endif
52+
53+ #ifndef GL_INT
54
55=== added file 'debian/patches/dont-build-osgframerenderer-on-gles.patch'
56--- debian/patches/dont-build-osgframerenderer-on-gles.patch 1970-01-01 00:00:00 +0000
57+++ debian/patches/dont-build-osgframerenderer-on-gles.patch 2014-08-12 11:30:57 +0000
58@@ -0,0 +1,24 @@
59+Description: Don't build the osgframerenderer example if building for
60+ OpenGL ES 1, OpenGL ES 2, or OpenGL 3. This is a portion of the full commit.
61+Origin: upstream, https://github.com/openscenegraph/osg/commit/3f812e42c7bb257e1e19604318becd359d21f469
62+
63+Index: openscenegraph/OpenSceneGraph/examples/CMakeLists.txt
64+===================================================================
65+--- openscenegraph.orig/OpenSceneGraph/examples/CMakeLists.txt 2014-07-26 08:49:44.583787000 -0500
66++++ openscenegraph/OpenSceneGraph/examples/CMakeLists.txt 2014-08-03 11:41:48.439983802 -0500
67+@@ -46,7 +46,6 @@
68+ ADD_SUBDIRECTORY(osgfont)
69+ ADD_SUBDIRECTORY(osgforest)
70+ ADD_SUBDIRECTORY(osgfxbrowser)
71+- ADD_SUBDIRECTORY(osgframerenderer)
72+ ADD_SUBDIRECTORY(osgoutline)
73+ ADD_SUBDIRECTORY(osggameoflife)
74+ ADD_SUBDIRECTORY(osggeometry)
75+@@ -173,6 +172,7 @@
76+
77+ IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
78+ ADD_SUBDIRECTORY(osgscreencapture)
79++ ADD_SUBDIRECTORY(osgframerenderer)
80+ ADD_SUBDIRECTORY(osgmotionblur)
81+ ADD_SUBDIRECTORY(osgteapot)
82+ ENDIF()
83
84=== modified file 'debian/patches/series'
85--- debian/patches/series 2014-05-17 16:52:38 +0000
86+++ debian/patches/series 2014-08-12 11:30:57 +0000
87@@ -6,3 +6,5 @@
88 fix_for_multithreaded_vrml_loading
89 osgDB_freetype.so_no_longer_built
90 libav10.patch
91+dont-build-osgframerenderer-on-gles.patch
92+change-typedef.patch
93
94=== modified file 'debian/rules'
95--- debian/rules 2013-07-30 13:07:57 +0000
96+++ debian/rules 2014-08-12 11:30:57 +0000
97@@ -66,6 +66,16 @@
98
99 LDFLAGS += -Wl,--as-needed
100
101+ifeq (armhf,$(DEB_HOST_ARCH))
102+EGL_LDFLAGS=$(shell pkg-config egl --libs)
103+OPENGLES_LDFLAGS=$(shell pkg-config glesv2 --libs)
104+ARMHF_DEFINES=-D OSG_GL1_AVAILABLE:BOOL=OFF \
105+ -D OSG_GL2_AVAILABLE:BOOL=OFF \
106+ -D OSG_GLES2_AVAILABLE:BOOL=ON \
107+ -D OPENGL_gl_LIBRARY:STRING="${OPENGLES_LDFLAGS}" \
108+ -D OPENGL_egl_LIBRARY:STRING="${EGL_LDFLAGS}"
109+endif
110+
111 #
112 # Shared libraries version numbers
113 #
114@@ -419,6 +429,7 @@
115 -D CMAKE_INSTALL_PREFIX:PATH=/usr \
116 -D BUILD_OSG_EXAMPLES:BOOL=ON \
117 -D LIB_POSTFIX="" \
118+ ${ARMHF_DEFINES} \
119 ../../${OSG}
120 ${MAKE} ${PARALLEL_OPTIONS} VERBOSE=1 -C build/osg
121

Subscribers

People subscribed via source and target branches