public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Luca Barbato <lu_zero@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Supporting GLES-only implementations
Date: Sat, 24 Mar 2012 18:14:55 -0700	[thread overview]
Message-ID: <4F6E718F.6010204@gentoo.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

Provided with the eselect opengl patch an implementation and the mesa
changes. If they are ok for everybody I'd change the ati and nvidia
drivers as well. (a better name for the amd-graphics driver would be
welcome btw)

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero


[-- Attachment #2: 0001-opengl-support-gles-only-implementation.patch --]
[-- Type: text/x-patch, Size: 3019 bytes --]

From 17add6bb04836ee49f4babad51ed9f15b3fd9abe Mon Sep 17 00:00:00 2001
From: Luca Barbato <lu_zero@gentoo.org>
Date: Sat, 24 Mar 2012 18:07:06 -0700
Subject: [PATCH] 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


[-- Attachment #3: amd-graphics-bin-2012.1.ebuild --]
[-- Type: text/plain, Size: 1023 bytes --]

# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

inherit multilib

DESCRIPTION="Closed source imx5 OpenGL/OpenVG driver"
HOMEPAGE="http://freescale.com"
SRC_URI="http://localhost/${P}.tar.xz"

LICENSE="EULA"
SLOT="0"
KEYWORDS="~arm"
IUSE=""

DEPEND=">=app-admin/eselect-opengl-1.2.6"
RDEPEND="${DEPEND}
		x11-libs/libX11
		x11-libs/libXrender
		x11-libs/libXext
"

RESTRICT="test"


src_install() {
	local opengl_imp="amd-graphics"
	local opengl_dir="/usr/$(get_libdir)/opengl/${opengl_imp}"
	dodir "$opengl_dir"/lib  "$opengl_dir"/include
	local x
	for x in usr/lib/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
		if [ -f ${x} -o -L ${x} ]; then
			mv "${x}" "${ED}"/${opengl_dir}/lib \
				|| die "Failed to move ${x}"
		fi
	done
	mv usr/include/{EGL,GLES*,VG,KHR}/  \
		"${ED}"/${opengl_dir}/include || die "Failed to move headers"
	insinto /usr
	doins -r usr/include
	dolib usr/lib/*
}

pkg_postinst() {
	eselect opengl set --use-old ${opengl_imp}
}

[-- Attachment #4: mesa-8.0.1-r3.diff --]
[-- Type: text/x-patch, Size: 445 bytes --]

--- /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

             reply	other threads:[~2012-03-25  1:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-25  1:14 Luca Barbato [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-03 17:26 [gentoo-dev] Supporting GLES-only implementations Luca Barbato
2012-03-04 13:40 ` Luca Barbato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F6E718F.6010204@gentoo.org \
    --to=lu_zero@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox