# Copyright (c) 2008 Daniel Mierswa # Distributed under the terms of the GNU General Public License v2 SCM_REPOSITORY="git://anongit.freedesktop.org/git/nouveau/mesa" SCM_BRANCH="gallium-0.1" require eutils multilib scm-git toolchain-funcs SUMMARY="nouveau mesa driver" DESCRIPTION="The nouveau driver for the mesa OpenGL implementation." HOMEPAGE="http://nouveau.freedesktop.org/wiki/GalliumHowto" LICENCES="FIXME" SLOT="0" PLATFORMS="~amd64 ~x86" MYOPTIONS="platform:amd64 platform:x86" DEPENDENCIES=" build+run: x11-dri/mesa " get_target() { option platform:amd64 && TARGET="linux-dri-x86-64" option platform:x86 && TARGET="linux-dri-x86" [[ -z "${TARGET}" ]] \ && die "Sorry, I don't know how to build gallium for your platform." } src_prepare() { get_target sed \ -e '/^ARCH_FLAGS/s: = : = -DGLX_USE_TLS :' \ -i "configs/${TARGET}" \ || die "sed configs/${TARGET} failed" sed \ -e '/^OPT_FLAGS =/s:=.*:=:' \ -e "/^CFLAGS = /s:= := ${CFLAGS} :" \ -e "/^CXXFLAGS = /s:= := ${CXXFLAGS} :" \ -i "configs/linux-dri" \ || die "sed configs/linux-dri failed" } src_compile() { get_target emake DRI_DIRS="nouveau" "${TARGET}" \ CC=$(tc-getCC) \ CXX=$(tc-getCXX) } src_install() { mkdir -p "${IMAGE}/usr/$(get_libdir)/dri" || die "mkdir failed" cp "$(get_libdir)/nouveau_dri.so" "${IMAGE}/usr/$(get_libdir)/dri" || die "cp failed" bin/installmesa "${IMAGE}/usr/$(get_libdir)/opengl/gallium" \ || die "bin/installmesa failed" cd "${IMAGE}/usr/$(get_libdir)/opengl/gallium" || die "cd failed" mv include/{GL/*,} || die "mv failed" rmdir include/GL || die "rmdir failed" } pkg_postinst() { einfo "If you encounter a black screen while rendering, you may have to add" einfo " Option \"GlxVisuals\" \"all\"" einfo "to your xorg.conf, see ${HOMEPAGE}." }