Gentoo Archives: gentoo-alt

From: Fabian Groffen <grobian@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] Re: Mesa header in media-libs/apple-opengl-2
Date: Thu, 30 Apr 2009 19:53:24
Message-Id: 20090430195247.GG14596@gentoo.org
In Reply to: [gentoo-alt] Re: Mesa header in media-libs/apple-opengl-2 by Dirk Tilger
1 On 28-04-2009 07:38:22 +0000, Dirk Tilger wrote:
2 > > Ok, have you tried if stuff works with modified apple-opengl not to
3 > > provide osmesa.h? If so, I'm happy to remove the file from the ebuild.
4 >
5 > No, in fact I haven't any OpenGL application coming with an ebuild that
6 > compiles on my box. ;) But I can provide strong evidence:
7
8 SDL needs it and compiles against it.
9
10 > | dirk@Snake ~ $ for PROC in `grep ^OSMesa /usr/X11R6/include/GL/osmesa.h|sed 's!(.*!!'`; do for LIB in `equery f apple-opengl|grep dylib`; do grep -H ${PROC} ${LIB}; done; done
11 > | dirk@Snake ~ $
12 >
13 > None of the methods defined in /usr/X11R6/include/GL/osmesa.h are
14 > used or provided in any of the libraries in apple-opengl. ;)
15 >
16 > I think the ebuild needs a few more changes: It's symlinking GL dylib's
17 > from /System/Library/Frameworks, which might have side-effects.
18
19 All I tried to do, is create something similar to mesa on Linux, with
20 whatever Apple provides. It seems to work for some apps (SDL) at least.
21 I tried to be as close to mesa as possible, since it's just eselect-ed,
22 and hence used as drop-in replacement.
23
24 > As I came to understand OpenGL, it is a setup of platform independent
25 > graphics routines that is used together with a set of platform dependent
26 > setup routines. GLX provides the setup routines when OpenGL is used with
27 > X11, AGL provides the setup routines when OpenGL is used with Quartz.
28 > There are others for all kinds of other environments including Windows.
29 >
30 > /usr/X11R6/README says on my system:
31 > | Direct rendering has exactly the same performance as the native Mac
32 > | OS X OpenGL framework. Indirect rendering also uses the native GL
33 > | implementation, but incurs the penalty of marshalling, transmitting
34 > | and unmarshalling all GL primitives.
35 >
36 > I take from that paragraph is what they do is they are translating the
37 > X11 OpenGL calls into Quartz OpenGL calls. That's probably why `otool -L
38 > /usr/X11R6/lib/libGL.dylib` shows it has linked
39 >
40 > /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
41 >
42 > When I look at the symlinks of media-libs/apple-opengl-2, I see some
43 > pointing to /System/Library/Frameworks. I believe since GLX is the
44 > classical Un*x way of doing OpenGL, we should probably take all OpenGL
45 > files from within /usr/X11R6. For the ones that are actually running on
46 > Quartz natively (let's say a OpenGL extension for vim ^^), I would
47 > expect that they pick the OpenGL using '-framework OpenGL' and then they
48 > get the files from /System/Library/Frameworks/OpenGL.framework
49 > automatically..
50
51 Yeah, but the idea was to get automagically the best (native) for apps
52 that just don't know (and don't want to know) about frameworks.
53
54 Perhaps we just need two ebuilds instead of one?
55
56
57 --
58 Fabian Groffen
59 Gentoo on a different level