- download these ebuilds:
- /usr/local/portage/x11-base/x11-drm/x11-drm-99999999.ebuild
Code: Select all
# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/x11-drm-20070314.ebuild,v 1.2 2007/03/14 18:18:53 battousai Exp $ EGIT_BRANCH="r6xx-r7xx-3d" EAPI="2" EGIT_REPO_URI="git://anongit.freedesktop.org/~agd5f/drm" EGIT_PROJECT="libdrm" [[ ${PV} = 9999* ]] && GIT_ECLASS="git" inherit eutils x11 linux-mod ${GIT_ECLASS} DESCRIPTION="DRM Kernel Modules for X11" HOMEPAGE="http://dri.sf.net" PATCHVER="0.2" #SRC_PATCHES="http://dev.gentoo.org/~dberkholz/distfiles/${P}-gentoo-${PATCHVER}.tar.bz2" if [[ $PV = 9999* ]]; then SRC_URI="" else SRC_URI="${SRC_PATCHES} mirror://gentoo/linux-drm-${PV}-kernelsource.tar.bz2" fi LICENSE="X11" SLOT="0" KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86 ~x86-fbsd" # ! IMPORTANT: # this is really out of sync with MESA, should we add here or remove from mesa? IUSE_VIDEO_CARDS=" video_cards_mach64 video_cards_mga video_cards_r128 video_cards_radeon video_cards_radeonhd video_cards_savage video_cards_sis video_cards_sunffb video_cards_tdfx video_cards_via" IUSE="${IUSE_VIDEO_CARDS} kernel_FreeBSD kernel_linux" # Make sure Portage does _NOT_ strip symbols. We will do it later and make sure # that only we only strip stuff that are safe to strip ... # Tests require user intervention (see bug #236845) RESTRICT="strip test" DEPEND=" kernel_linux? ( virtual/linux-sources ) kernel_FreeBSD? ( sys-freebsd/freebsd-sources sys-freebsd/freebsd-mk-defs ) " RDEPEND="${DEPEND}" S="${WORKDIR}/drm" pkg_setup() { _set_build_type # Setup the kernel's stuff. kernel_setup # Set video cards to build for. set_vidcards # Determine which -core dir we build in. if [[ $CORE = fbsd ]]; then SRC_BUILD="${S}/bsd-core" else SRC_BUILD="${S}/linux-core" fi } src_unpack() { [[ $PV = 9999* ]] && git_src_unpack || unpack ${A} } src_prepare() { cd "${WORKDIR}" # Apply patches if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then EPATCH_FORCE="yes" \ EPATCH_SOURCE="${WORKDIR}/patches" \ EPATCH_SUFFIX="patch" \ epatch fi # fix the makes for bsd/linux if [[ $CORE = fbsd ]]; then # Link in freebsd kernel. ln -s "/usr/src/sys-${K_RV}" "${WORKDIR}/sys" # SUBDIR variable gets to all Makefiles, we need it only in the main one. SUBDIRS=${VIDCARDS//.ko} sed -i \ -e "s:SUBDIR\ =.*:SUBDIR\ =\ drm ${SUBDIRS}:" \ "${SRC_BUILD}"/Makefile || die "Fixing SUBDIRS failed." else convert_to_m "${SRC_BUILD}"/Makefile fi } src_compile() { einfo "Building DRM in ${SRC_BUILD}..." src_compile_${CORE} } src_install() { cd "${SRC_BUILD}" src_install_${CORE} dodoc "${S}/linux-core/README.drm" } pkg_postinst() { if use video_cards_sis; then einfo "SiS direct rendering only works on 300 series chipsets." einfo "SiS framebuffer also needs to be enabled in the kernel." fi if use video_cards_mach64; then einfo "The Mach64 DRI driver is insecure." einfo "Malicious clients can write to system memory." einfo "For more information, see:" einfo "http://dri.freedesktop.org/wiki/ATIMach64." fi [[ ${CORE} = linux ]] && linux-mod_pkg_postinst } # Functions used above are defined below: _set_build_type() { # here we check if we are using linux kernel or the fbsd one use kernel_FreeBSD && CORE="fbsd" use kernel_linux && CORE="linux" ! use kernel_FreeBSD && ! use kernel_linux && die "Unsupported kernel type" } kernel_setup() { if [[ ${CORE} = fbsd ]] ; then K_RV=${CHOST/*-freebsd/} else CONFIG_CHECK="!DRM" ERROR_DRM="Please disable DRM in the kernel config. (CONFIG_DRM = n)" linux-mod_pkg_setup if kernel_is 2 4; then eerror "Upstream support for 2.4 kernels has been removed, so this package will no" eerror "longer support them." die "Please use in-kernel DRM or switch to a 2.6 kernel." fi fi } set_vidcards() { VIDCARDS="" if [[ -n "${VIDEO_CARDS}" ]]; then use video_cards_mach64 && \ VIDCARDS="${VIDCARDS} mach64.${KV_OBJ}" use video_cards_mga && \ VIDCARDS="${VIDCARDS} mga.${KV_OBJ}" use video_cards_r128 && \ VIDCARDS="${VIDCARDS} r128.${KV_OBJ}" use video_cards_radeon || use video_cards_radeonhd && \ VIDCARDS="${VIDCARDS} radeon.${KV_OBJ}" use video_cards_savage && \ VIDCARDS="${VIDCARDS} savage.${KV_OBJ}" use video_cards_sis && \ VIDCARDS="${VIDCARDS} sis.${KV_OBJ}" use video_cards_via && \ VIDCARDS="${VIDCARDS} via.${KV_OBJ}" use video_cards_sunffb && \ VIDCARDS="${VIDCARDS} ffb.${KV_OBJ}" use video_cards_tdfx && \ VIDCARDS="${VIDCARDS} tdfx.${KV_OBJ}" fi } src_compile_linux() { # remove leading and trailing space VIDCARDS="${VIDCARDS% }" VIDCARDS="${VIDCARDS# }" check_modules_supported MODULE_NAMES="" for i in drm.${KV_OBJ} ${VIDCARDS}; do MODULE_NAMES="${MODULE_NAMES} ${i/.${KV_OBJ}}(${PN}:${SRC_BUILD})" i=$(echo ${i/.${KV_OBJ}} | tr '[:lower:]' '[:upper:]') eval MODULESD_${i}_ENABLED="yes" done # This now uses an M= build system. Makefile does most of the work. cd "${SRC_BUILD}" unset ARCH BUILD_TARGETS="modules" BUILD_PARAMS="DRM_MODULES='${VIDCARDS}' LINUXDIR='${KERNEL_DIR}' M='${SRC_BUILD}'" ECONF_PARAMS='' S="${SRC_BUILD}" linux-mod_src_compile } src_compile_fbsd() { cd "${SRC_BUILD}" # Environment CFLAGS overwrite kernel CFLAGS which is bad. local svcflags=${CFLAGS}; local svldflags=${LDFLAGS} unset CFLAGS; unset LDFLAGS MAKE=make \ emake \ NO_WERROR= \ SYSDIR="${WORKDIR}/sys" \ KMODDIR="/boot/modules" \ || die "pmake failed." export CFLAGS=${svcflags}; export LDFLAGS=${svldflags} } src_install_linux() { linux-mod_src_install # Strip binaries, leaving /lib/modules untouched (bug #24415) strip_bins \/lib\/modules } src_install_fbsd() { cd "${SRC_BUILD}" dodir "/boot/modules" MAKE=make \ emake \ install \ NO_WERROR= \ DESTDIR="${D}" \ KMODDIR="/boot/modules" \ || die "Install failed." } - /usr/local/portage/media-libs/mesa/mesa-9999.ebuild
Code: Select all
# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-7.0.2.ebuild,v 1.6 2007/11/16 18:16:30 dberkholz Exp $ EAPI="2" EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa" if [[ ${PV} = 9999* ]]; then GIT_ECLASS="git" EXPERIMENTAL="true" IUSE_VIDEO_CARDS_UNSTABLE="video_cards_nouveau" IUSE_UNSTABLE="gallium" fi inherit autotools multilib flag-o-matic ${GIT_ECLASS} portability OPENGL_DIR="xorg-x11" MY_PN="${PN/m/M}" MY_P="${MY_PN}-${PV/_/-}" MY_SRC_P="${MY_PN}Lib-${PV/_/-}" DESCRIPTION="OpenGL-like graphic library for Linux" HOMEPAGE="http://mesa3d.sourceforge.net/" #SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2" if [[ $PV = *_rc* ]]; then SRC_URI="http://www.mesa3d.org/beta/${MY_SRC_P}.tar.gz ${SRC_PATCHES}" elif [[ $PV = 9999* ]]; then SRC_URI="${SRC_PATCHES}" else SRC_URI="mirror://sourceforge/mesa3d/${MY_SRC_P}.tar.bz2 ${SRC_PATCHES}" fi LICENSE="LGPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" IUSE_VIDEO_CARDS="${IUSE_VIDEO_CARDS_UNSTABLE} video_cards_intel video_cards_mach64 video_cards_mga video_cards_none video_cards_r128 video_cards_radeon video_cards_radeonhd video_cards_s3virge video_cards_savage video_cards_sis video_cards_sunffb video_cards_tdfx video_cards_trident video_cards_via" IUSE="${IUSE_VIDEO_CARDS} ${IUSE_UNSTABLE} debug doc motif nptl pic xcb kernel_FreeBSD" # keep correct libdrm and dri2proto dep # keep blocks in rdepend for binpkg RDEPEND="!<=x11-base/xorg-x11-6.9 !<=x11-proto/xf86driproto-2.0.3 app-admin/eselect-opengl dev-libs/expat >=x11-libs/libdrm-9999 x11-libs/libICE x11-libs/libX11[xcb?] x11-libs/libXdamage x11-libs/libXext x11-libs/libXi x11-libs/libXmu x11-libs/libXxf86vm motif? ( x11-libs/openmotif ) doc? ( app-doc/opengl-manpages ) " DEPEND="${RDEPEND} dev-util/pkgconfig x11-misc/makedepend >=x11-proto/dri2proto-1.99.3 >=x11-proto/glproto-1.4.8 x11-proto/inputproto x11-proto/xextproto x11-proto/xf86driproto x11-proto/xf86vidmodeproto " S="${WORKDIR}/${MY_P}" # Think about: ggi, svga, fbcon, no-X configs pkg_setup() { # gcc 4.2 has buggy ivopts if [[ $(gcc-version) = "4.2" ]]; then append-flags -fno-ivopts fi # recommended by upstream append-flags -ffast-math } src_unpack() { [[ $PV = 9999* ]] && git_src_unpack || unpack ${A} } src_prepare() { # apply patches if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then EPATCH_FORCE="yes" \ EPATCH_SOURCE="${WORKDIR}/patches" \ EPATCH_SUFFIX="patch" \ epatch fi # FreeBSD 6.* doesn't have posix_memalign(). [[ ${CHOST} == *-freebsd6.* ]] && \ sed -i -e "s/-DHAVE_POSIX_MEMALIGN//" configure.ac eautoreconf } src_configure() { local myconf r600 # Configurable DRI drivers driver_enable swrast driver_enable video_cards_intel i810 i915 i965 driver_enable video_cards_mach64 mach64 driver_enable video_cards_mga mga driver_enable video_cards_r128 r128 # ATI has two implementations as video_cards driver_enable video_cards_radeon radeon r200 r300 r600 driver_enable video_cards_radeonhd r300 r600 # driver_enable video_cards_radeon r600 # driver_enable video_cards_radeonhd r600 driver_enable video_cards_s3virge s3v driver_enable video_cards_savage savage driver_enable video_cards_sis sis driver_enable video_cards_sunffb ffb driver_enable video_cards_tdfx tdfx driver_enable video_cards_trident trident driver_enable video_cards_via unichrome # all live (experimental) stuff is wrapped around with experimental variable # so the users cant get to this parts even with enabled useflags (downgrade # from live to stable for example) if [[ -n ${EXPERIMENTAL} ]]; then # nouveau works only with gallium and intel, radeon, radeonhd can use # gallium as alternative implementation (NOTE: THIS IS EXPERIMENTAL) if use video_cards_nouveau && ! use gallium ; then elog "Nouveau driver is available only via gallium interface." elog "Enable gallium useflag if you want to use nouveau." echo fi # state trackers, for now enable the one i want # think about this bit more... myconf="${myconf} $(use_enable gallium)" if use gallium; then elog "Warning gallium interface is highly experimental so use" elog "it only if you feel really really brave." elog elog "Intel: works only i915." elog "Nouveau: only available implementation, so no other choice" elog "Radeon: implementation up to the r500." echo myconf="${myconf} --with-state-trackers=glx,dri,egl $(use_enable video_cards_nouveau gallium-nouveau) $(use_enable video_cards_intel gallium-intel)" if ! use video_cards_radeon && ! use video_cards_radeonhd; then myconf="${myconf} --disable-gallium-radeon" else myconf="${myconf} --enable-gallium-radeon" fi fi fi # Deactivate assembly code for pic build myconf="${myconf} $(use_enable !pic asm)" # --with-driver=dri|xlib|osmesa ; might get changed later to something # else than dri econf \ --with-driver=dri \ --disable-glut \ --without-demos \ $(use_enable debug) \ $(use_enable motif glw) \ $(use_enable motif) \ $(use_enable nptl glx-tls) \ $(use_enable xcb) \ --with-dri-drivers=${DRI_DRIVERS} \ ${myconf} } src_install() { dodir /usr emake DESTDIR="${D}" install || die "Installation failed" # Remove redundant headers # GLUT thing rm -f "${D}"/usr/include/GL/glut*.h || die "Removing glut include failed." # Glew includes rm -f "${D}"/usr/include/GL/{glew,glxew,wglew}.h \ || die "Removing glew includes failed." # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib # because user can eselect desired GL provider. ebegin "Moving libGL and friends for dynamic switching" dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/{lib,extensions,include} local x for x in "${D}"/usr/$(get_libdir)/libGL.{la,a,so*}; do if [ -f ${x} -o -L ${x} ]; then mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/lib \ || die "Failed to move ${x}" fi done for x in "${D}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do if [ -f ${x} -o -L ${x} ]; then mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/include \ || die "Failed to move ${x}" fi done eend $? } pkg_postinst() { # Switch to the xorg implementation. echo eselect opengl set --use-old ${OPENGL_DIR} # info about removal of .la file elog "Mesa no-longer ships the libGL.la file." elog "This file was broken by design and thus removed." elog "For fixing all sort of configure issues please run:" elog " lafilefixer --justfixit" elog "or run revdep-rebuild." elog "(lafilefixer package can be found as dev-util/lafilefixer)" } # $1 - VIDEO_CARDS flag # other args - names of DRI drivers to enable driver_enable() { case $# in # for enabling unconditionally 1) DRI_DRIVERS="${DRI_DRIVERS},$1" ;; *) if use $1; then shift for i in $@; do DRI_DRIVERS="${DRI_DRIVERS},${i}" done fi ;; esac } - /usr/local/portage/x11-libs/libdrm/libdrm-9999.ebuild
Code: Select all
# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/libdrm-2.3.0.ebuild,v 1.8 2007/05/20 20:47:52 jer Exp $ # Must be before x-modular eclass is inherited #SNAPSHOT="yes" EGIT_BRANCH="r6xx-r7xx-3d" inherit autotools x-modular EGIT_REPO_URI="git://anongit.freedesktop.org/~agd5f/drm" DESCRIPTION="X.Org libdrm library" HOMEPAGE="http://dri.freedesktop.org/" SRC_URI="" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" IUSE="" RDEPEND="dev-libs/libpthread-stubs" DEPEND="${RDEPEND}" RESTRICT="test" # see bug #236845 CONFIGURE_OPTIONS="--enable-udev --enable-radeon-experimental-api" pkg_postinst() { x-modular_pkg_postinst ewarn "libdrm's ABI may have changed without change in library name" ewarn "Please rebuild media-libs/mesa, x11-base/xorg-server and" ewarn "your video drivers in x11-drivers/*." } - /usr/local/portage/x11-drivers/xf86-video-ati/xf86-video-ati-9999.ebuild
Code: Select all
# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-ati/xf86-video-ati-6.6.192.ebuild,v 1.1 2007/05/21 05:25:33 dberkholz Exp $ # Must be before x-modular eclass is inherited #SNAPSHOT="yes" inherit x-modular DESCRIPTION="ATI video driver" KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" SRC_URI="" IUSE="dri" RDEPEND=">=x11-base/xorg-server-1.2" DEPEND="${RDEPEND} >=x11-misc/util-macros-1.1.3 x11-proto/fontsproto x11-proto/randrproto x11-proto/videoproto x11-proto/xextproto x11-proto/xineramaproto x11-proto/xf86miscproto x11-proto/xproto dri? ( x11-proto/glproto x11-proto/xf86driproto >=x11-libs/libdrm-2 )" CONFIGURE_OPTIONS="$(use_enable dri)"
- /usr/local/portage/x11-base/x11-drm/x11-drm-99999999.ebuild
- unkeyword them.
- update world
- if all compiles well, enable dri in xorg.conf
- reboot the system and wait till it boots up, then run glxinfo and glxgears.
- if all went well, the output of glxinfo | grep OpenGL should show this:
Code: Select all
OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: Mesa DRI R600 (RV620 95C4) 20090101 TCL OpenGL version string: 1.4 Mesa 7.6-devel OpenGL extensions:


