diff options
author | Donnie Berkholz <dberkholz@gentoo.org> | 2003-12-29 17:17:26 +0000 |
---|---|---|
committer | Donnie Berkholz <dberkholz@gentoo.org> | 2003-12-29 17:17:26 +0000 |
commit | 6519093c05389d08407b765a8041e16e553dddc0 (patch) | |
tree | 75662241e9f50c94051032c4dad1c48ef2705b73 /eclass/matrox.eclass | |
parent | And on the 7th day, the ~sparc keyword appeared. And the insane Gentoo/SPARC... (diff) | |
download | historical-6519093c05389d08407b765a8041e16e553dddc0.tar.gz historical-6519093c05389d08407b765a8041e16e553dddc0.tar.bz2 historical-6519093c05389d08407b765a8041e16e553dddc0.zip |
For media-video/mtxdrivers and media-video/mtxdrivers-pro, nearly the same except for GL stuff in pro.
Diffstat (limited to 'eclass/matrox.eclass')
-rw-r--r-- | eclass/matrox.eclass | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/eclass/matrox.eclass b/eclass/matrox.eclass new file mode 100644 index 000000000000..0cc011859cb8 --- /dev/null +++ b/eclass/matrox.eclass @@ -0,0 +1,88 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/matrox.eclass,v 1.1 2003/12/29 17:17:26 spyderous Exp $ +# +# Author: Donnie Berkholz <spyderous@gentoo.org> +# +# This eclass is designed to reduce code duplication in the mtxdrivers* ebuilds. +# The only addition to mtxdrivers-pro is OpenGL stuff. + +ECLASS="matrox" +INHERITED="${INHERITED} ${ECLASS}" + +EXPORT_FUNCTIONS pkg_setup src_compile + +HOMEPAGE="http://www.matrox.com/mga/products/parhelia/home.cfm" + +LICENSE="Matrox" +SLOT="${KV}" +RESTRICT="fetch nostrip" + +newrdepend ">=x11-base/xfree-4.2.0 + virtual/linux-sources" + +matrox_pkg_setup() { + # Require correct /usr/src/linux + check_KV + + # Force XFree86 4.3.0, 4.2.1 or 4.2.0 to be installed unless FORCE_VERSION + # is set. Need FORCE_VERSION for 4.3.99/4.4.0 compatibility until Matrox + # comes up with drivers (spyderous) + local INSTALLED_X="`best_version x11-base/xfree`" + GENTOO_X_VERSION_REVISION="${INSTALLED_X/x11-base\/xfree-}" + GENTOO_X_VERSION="${GENTOO_X_VERSION_REVISION%-*}" + if [ "${GENTOO_X_VERSION}" != "4.3.0" ] + then + if [ "${GENTOO_X_VERSION}" != "4.2.1" ] + then + if [ "${GENTOO_X_VERSION}" != "4.2.0" ] + then + if [ -n "${FORCE_VERSION}" ] + then + GENTOO_X_VERSION="${FORCE_VERSION}" + else + die "These drivers require XFree86 4.3.0, 4.2.1 or 4.2.0. Do FORCE_VERSION=version-you-want emerge ${PN} (4.3.0, 4.2.1 or 4.2.0) to force installation." + fi + fi + fi + fi +} + +matrox_src_compile() { + export PARHELIUX="${PWD}/src" + cd ${S}/src/kernel/parhelia + ln -sf ../../../kernel/mtx_parhelia.o . + cd .. + # Can't use emake here + make clean + make +} + +matrox_base_src_install() { + # Kernel Module + dodir /lib/modules/${KV}/kernel/drivers/video; insinto /lib/modules/${KV}/kernel/drivers/video + doins src/kernel/mtx.o + + # X Driver (2D) + dodir /usr/X11R6/lib/modules/drivers; insinto /usr/X11R6/lib/modules/drivers + doins xfree86/${GENTOO_X_VERSION}/mtx_drv.o +} + +matrox_base_pkg_postinst() { + if [ "${ROOT}" = "/" ] + then + /sbin/modules-update + fi + + if [ ! -d /dev/video ] + then + if [ -f /dev/video ] + then + einfo "NOTE: To be able to use busmastering, you MUST have /dev/video as" + einfo "a directory, which means you must remove anything there first" + einfo "(rm -f /dev/video), and mkdir /dev/video" + else + mkdir /dev/video + fi + fi +} |