Gentoo Archives: gentoo-dev

From: Luca Barbato <lu_zero@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] opengl: support gles only implementation
Date: Sun, 25 Mar 2012 01:10:14
Message-Id: 1332637740-31812-1-git-send-email-lu_zero@gentoo.org
1 Additionally make switching headers and libraries work for GLES OpenVG
2 and EGL.
3 ---
4 modules/opengl.eselect | 30 ++++++++++++++++++------------
5 1 files changed, 18 insertions(+), 12 deletions(-)
6
7 diff --git a/modules/opengl.eselect b/modules/opengl.eselect
8 index 2e8dd23..3f55ed5 100644
9 --- a/modules/opengl.eselect
10 +++ b/modules/opengl.eselect
11 @@ -140,14 +140,14 @@ setup_extensions_symlinks() {
12
13 setup_includes_symlinks() {
14 local target=$1
15 + local files=$2
16 local file
17 local sdir
18
19 - shift
20 -
21 + shift 2
22 mkdir -p "${target}" || die "Failed to create ${target}"
23 pushd "${target}" &> /dev/null
24 - for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
25 + for file in ${files}; do
26 for sdir in "$@"; do
27 if [[ -e ${sdir}/${file} ]]; then
28 upgrade_file "${sdir}/${file}" "${target}"
29 @@ -165,6 +165,7 @@ set_new_implementation() {
30 local moduledir
31 local gl_dir
32 local gl_local
33 + local -A gl_header
34
35 # Set a sane umask... bug #83115
36 umask 022
37 @@ -178,7 +179,7 @@ set_new_implementation() {
38 for libdir in $(list_libdirs); do
39 [[ ${ROOT} != / ]] && libdir=${libdir#${EROOT}}
40 [[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue
41 - [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" ]] && found_libgl=yes
42 + [[ -f "${PREFIX}/${libdir}/opengl/${gl_implem}/lib/libGL.so" || -f "${PREFIX}/${libdir}/opengl/${gl_implem}/.gles-only" ]] && found_libgl=yes
43 done
44
45 if [[ -z ${found_libgl} ]]; then
46 @@ -242,14 +243,19 @@ set_new_implementation() {
47 "${PREFIX}/${libdir}/opengl/${gl_local}/extensions" \
48 "${DST_PREFIX}/${libdir}/${moduledir}/extensions"
49
50 - setup_includes_symlinks \
51 - "${DST_PREFIX}/include/GL" \
52 - "${PREFIX}/${libdir}/opengl/${gl_implem}/include/GL/" \
53 - "${PREFIX}/${libdir}/opengl/${gl_implem}/include/" \
54 - "${PREFIX}/${libdir}/opengl/global/include/" \
55 - "${PREFIX}/${libdir}/opengl/xorg-x11/include/GL/" \
56 - "${PREFIX}/${libdir}/opengl/xorg-x11/include/"
57 -
58 + gl_header[GL]="gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h"
59 + gl_header[GLES]="egl.h gl_extensions.h glext.h gl.h glplatform.h"
60 + gl_header[GLES2]="gl2ext.h gl2.h gl2platform.h"
61 + gl_header[KHR]="khrplatform.h"
62 + gl_header[VG]="openvg.h vgext.h vgplatform.h vgu.h"
63 + for gl_dir in {GL,GLES,GLES2,KHR,VG}; do
64 + setup_includes_symlinks \
65 + "${DST_PREFIX}/include/${gl_dir}" \
66 + "${gl_header[${gl_dir}]}" \
67 + "${PREFIX}/${libdir}/opengl/${gl_implem}/include/${gl_dir}/" \
68 + "${PREFIX}/${libdir}/opengl/global/include/${gl_dir}" \
69 + "${PREFIX}/${libdir}/opengl/xorg-x11/include/${gl_dir}/"
70 + done
71 # Setup the $LDPATH
72 if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
73 # we need this relative to ROOT
74 --
75 1.7.8.rc1