Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   opengl: support gles only implementation (http://www.linux-archive.org/gentoo-development/648511-opengl-support-gles-only-implementation.html)

Luca Barbato 03-25-2012 12:07 AM

opengl: support gles only implementation
 
Additionally make switching headers and libraries work for GLES OpenVG
and EGL.
---
modules/opengl.eselect | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 2e8dd23..3f55ed5 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -140,14 +140,14 @@ setup_extensions_symlinks() {

setup_includes_symlinks() {
local target=$1
+ local files=$2
local file
local sdir

- shift
-
+ shift 2
mkdir -p "${target}" || die "Failed to create ${target}"
pushd "${target}" &> /dev/null
- for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
+ for file in ${files}; do
for sdir in "$@"; do
if [[ -e ${sdir}/${file} ]]; then
upgrade_file "${sdir}/${file}" "${target}"
@@ -165,6 +165,7 @@ set_new_implementation() {
local moduledir
local gl_dir
local gl_local
+ local -A gl_header

# Set a sane umask... bug #83115
umask 022
@@ -178,7 +179,7 @@ set_new_implementation() {
for libdir in $(list_libdirs); do
[[ ${ROOT} != / ]] && libdir=${libdir#${EROOT}}
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue
- [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" ]] && found_libgl=yes
+ [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" || -f "${PREFIX}/${libdir}/opengl/${gl_implem}/.gles-only" ]] && found_libgl=yes
done

if [[ -z ${found_libgl} ]]; then
@@ -242,14 +243,19 @@ set_new_implementation() {
"${PREFIX}/${libdir}/opengl/${gl_local}/extensions"
"${DST_PREFIX}/${libdir}/${moduledir}/extensions"

- setup_includes_symlinks
- "${DST_PREFIX}/include/GL"
- "${PREFIX}/${libdir}/opengl/${gl_implem}/include/GL/"
- "${PREFIX}/${libdir}/opengl/${gl_implem}/include/"
- "${PREFIX}/${libdir}/opengl/global/include/"
- "${PREFIX}/${libdir}/opengl/xorg-x11/include/GL/"
- "${PREFIX}/${libdir}/opengl/xorg-x11/include/"
-
+ gl_header[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
+ gl_header[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
+ gl_header[GLES2]="gl2ext.h gl2.h gl2platform.h"
+ gl_header[KHR]="khrplatform.h"
+ gl_header[VG]="openvg.h vgext.h vgplatform.h vgu.h"
+ for gl_dir in {GL,GLES,GLES2,KHR,VG}; do
+ setup_includes_symlinks
+ "${DST_PREFIX}/include/${gl_dir}"
+ "${gl_header[${gl_dir}]}"
+ "${PREFIX}/${libdir}/opengl/${gl_implem}/include/${gl_dir}/"
+ "${PREFIX}/${libdir}/opengl/global/include/${gl_dir}"
+ "${PREFIX}/${libdir}/opengl/xorg-x11/include/${gl_dir}/"
+ done
# Setup the $LDPATH
if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
# we need this relative to ROOT
--
1.7.8.rc1


--------------050408090901000603020002
Content-Type: text/plain;
name="amd-graphics-bin-2012.1.ebuild"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="amd-graphics-bin-2012.1.ebuild"

IyBDb3B5cmlnaHQgMTk5OS0yMDEyIEdlbnRvbyBGb3VuZGF0aW 9uCiMgRGlzdHJpYnV0ZWQg
dW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdW JsaWMgTGljZW5zZSB2Mgoj
ICRIZWFkZXI6ICQKCkVBUEk9MwoKaW5oZXJpdCBtdWx0aWxpYg oKREVTQ1JJUFRJT049IkNs
b3NlZCBzb3VyY2UgaW14NSBPcGVuR0wvT3BlblZHIGRyaXZlci IKSE9NRVBBR0U9Imh0dHA6
Ly9mcmVlc2N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dXNlLW9sZCAke2 9wZW5nbF9pbXB9Cn0K
--------------050408090901000603020002
Content-Type: text/x-patch;
name="mesa-8.0.1-r3.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="mesa-8.0.1-r3.diff"

--- /usr/portage/media-libs/mesa/mesa-8.0.1-r2.ebuild 2012-02-24 18:01:18.000000000 +0000
+++ /usr/portage/media-libs/mesa/mesa-8.0.1-r3.ebuild 2012-03-24 22:40:44.000000000 +0000
@@ -285,6 +287,9 @@
|| die "Failed to move ${x}"
fi
done
+ mv "${ED}"/usr/include/{EGL,GLES*,VG,KHR}/
+ "${ED}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/include
+ || die "Failed to move headers"
eend $?

if use classic || use gallium; then

--------------050408090901000603020002--

Luca Barbato 03-25-2012 12:09 AM

opengl: support gles only implementation
 
Additionally make switching headers and libraries work for GLES OpenVG
and EGL.
---
modules/opengl.eselect | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/modules/opengl.eselect b/modules/opengl.eselect
index 2e8dd23..3f55ed5 100644
--- a/modules/opengl.eselect
+++ b/modules/opengl.eselect
@@ -140,14 +140,14 @@ setup_extensions_symlinks() {

setup_includes_symlinks() {
local target=$1
+ local files=$2
local file
local sdir

- shift
-
+ shift 2
mkdir -p "${target}" || die "Failed to create ${target}"
pushd "${target}" &> /dev/null
- for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
+ for file in ${files}; do
for sdir in "$@"; do
if [[ -e ${sdir}/${file} ]]; then
upgrade_file "${sdir}/${file}" "${target}"
@@ -165,6 +165,7 @@ set_new_implementation() {
local moduledir
local gl_dir
local gl_local
+ local -A gl_header

# Set a sane umask... bug #83115
umask 022
@@ -178,7 +179,7 @@ set_new_implementation() {
for libdir in $(list_libdirs); do
[[ ${ROOT} != / ]] && libdir=${libdir#${EROOT}}
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue
- [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" ]] && found_libgl=yes
+ [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" || -f "${PREFIX}/${libdir}/opengl/${gl_implem}/.gles-only" ]] && found_libgl=yes
done

if [[ -z ${found_libgl} ]]; then
@@ -242,14 +243,19 @@ set_new_implementation() {
"${PREFIX}/${libdir}/opengl/${gl_local}/extensions"
"${DST_PREFIX}/${libdir}/${moduledir}/extensions"

- setup_includes_symlinks
- "${DST_PREFIX}/include/GL"
- "${PREFIX}/${libdir}/opengl/${gl_implem}/include/GL/"
- "${PREFIX}/${libdir}/opengl/${gl_implem}/include/"
- "${PREFIX}/${libdir}/opengl/global/include/"
- "${PREFIX}/${libdir}/opengl/xorg-x11/include/GL/"
- "${PREFIX}/${libdir}/opengl/xorg-x11/include/"
-
+ gl_header[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
+ gl_header[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
+ gl_header[GLES2]="gl2ext.h gl2.h gl2platform.h"
+ gl_header[KHR]="khrplatform.h"
+ gl_header[VG]="openvg.h vgext.h vgplatform.h vgu.h"
+ for gl_dir in {GL,GLES,GLES2,KHR,VG}; do
+ setup_includes_symlinks
+ "${DST_PREFIX}/include/${gl_dir}"
+ "${gl_header[${gl_dir}]}"
+ "${PREFIX}/${libdir}/opengl/${gl_implem}/include/${gl_dir}/"
+ "${PREFIX}/${libdir}/opengl/global/include/${gl_dir}"
+ "${PREFIX}/${libdir}/opengl/xorg-x11/include/${gl_dir}/"
+ done
# Setup the $LDPATH
if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
# we need this relative to ROOT
--
1.7.8.rc1


All times are GMT. The time now is 03:20 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.