Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 385153

Summary: x11-libs/mesa: Support building our own OpenGL library on Mac OS X
Product: Gentoo/Alt Reporter: Charles Davis <cdavis5x>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---

Description Charles Davis 2011-09-30 23:16:28 UTC
Right now, OpenGL "support" in prefix on Mac OS consists of linking to the "system" (read: the really old ones that come with the X11.app included with Mac OS) OpenGL binaries.

This ain't gonna fly with newer versions of the X11 libs. Any app (e.g. glxinfo) that links against these ancient OpenGL libs while also linking against newer X11 libs (like, say, the ones that get installed by portage) will die spectacularly (i.e. with a SIGBUS). Meanwhile, the "system" glxinfo, which uses both system X11 libs and system OpenGL libs, does not crash.

Either we should link to the "system" X11 libs, or we should start building our own Mesa. It is possible to do the latter; Jeremy Huddleston (the maintainer of XQuartz, and now apparently the release manager for X11 in general) figured out how to do it. He even maintains the port for MacPorts.

I know you masked mesa in favor of the hack that is x11-libs/opengl-apple. However, not only does XQuartz come with mesa, but anything in MacPorts that depends on OpenGL under X11 pulls in mesa as well. I think the situation has improved somewhat.

The real problem is that mesa pulls in lots of stuff it shouldn't be pulling in, like x11-libs/libpciaccess and x11-libs/libdrm. With a few slight modifications to my system headers, I was able to make libpciaccess work, but libdrm flat-out refuses to work because Mac OS doesn't have clock_gettime(2). These libraries aren't needed anyway.


Reproducible: Always

Steps to Reproduce:
1. emerge mesa

Actual Results:  
x11-libs/mesa is masked because (at the time) it was perceived not to work well on Mac OS X. Therefore, portage will refuse to install it unless it is unmasked.

Expected Results:  
It should be possible to emerge mesa on Mac OS X without a hitch. Not only that, but virtual/opengl should be changed to depend on mesa again.

Portage 2.2.01.19295-prefix (prefix/darwin/macos/10.6/x86, gcc-4.2.1, unavailable, 10.8.0 i386)
=================================================================
System uname: Darwin-10.8.0-i386-32bit
Timestamp of tree: Mon, 26 Sep 2011 17:12:00 +0000
distcc 3.1-toolwhip.1 i386-apple-darwin10.0 [disabled]
ccache version 3.1.4 [disabled]
app-shells/bash:      4.2_p10
dev-lang/python:      2.7.2
dev-util/ccache:      3.1.4
dev-util/cmake:       2.8.5-r2
dev-util/pkgconfig:   0.25-r2
sys-devel/autoconf:   2.68
sys-devel/automake:   1.10.3, 1.11.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:    2.4-r01.1
sys-devel/make:       3.82
Repositories: gentoo_prefix
Installed sets: 
ACCEPT_KEYWORDS="~x86-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-apple-darwin10"
CFLAGS="-O2 -pipe -march=core2"
CHOST="i686-apple-darwin10"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/portage /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core2"
DISTDIR="/Users/chip/Gentoo/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-dead_strip_dylibs"
MAKEOPTS="-j4"
PKGDIR="/Users/chip/Gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/chip/Gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/Users/chip/Gentoo/var/tmp"
PORTDIR="/Users/chip/Gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="X aqua bash-completion berkdb bzip2 cairo coreaudio cracklib crypt curl cxx dbus doc exceptions expat extensions fontconfig gdbm gmp gnutls gpg gzip iconv icu ipv6 jbig jpeg libssh2 lzma lzo mmx mmxext mng modules mysql ncurses nls objc objc++ opengl pch perl png prefix python qt3support readline ruby sasl sql sqlite3 sse sse2 ssl subversion tcl threads tiff tk truetype unicode vim-syntax x86-macos xinerama xml xpm xv zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" ELIBC="Darwin" GPSD_PROTOCOLS="garmin garmintxt gpsclock" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" SANE_BACKENDS="apple" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Fabian Groffen gentoo-dev 2011-10-01 07:56:36 UTC
The thing is, can we just bring in these libs, or do we need root privileges or something?  XQuartz is cool to have, of course.
Comment 2 Fabian Groffen gentoo-dev 2017-11-14 14:44:45 UTC
I'm not sure what the current stance of macOS is on X, but I think we need a lot of work to get things rolling here.  I'm going to close this bug, under the assumption that momentum on this got lost.