aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <donnie@supernova.(none)>2006-04-17 22:30:24 -0700
committerDonnie Berkholz <donnie@supernova.(none)>2006-04-17 22:30:24 -0700
commitb084e8250f714a5d67587f1d43f40d5774d25643 (patch)
treebc819fff34c32bd0c8c4c68df3a846f0b47316ca /eclass/matrox.eclass
downloaddberkholz-b084e8250f714a5d67587f1d43f40d5774d25643.tar.gz
dberkholz-b084e8250f714a5d67587f1d43f40d5774d25643.tar.bz2
dberkholz-b084e8250f714a5d67587f1d43f40d5774d25643.zip
Initial commit of portage overlay.
Diffstat (limited to 'eclass/matrox.eclass')
-rw-r--r--eclass/matrox.eclass107
1 files changed, 107 insertions, 0 deletions
diff --git a/eclass/matrox.eclass b/eclass/matrox.eclass
new file mode 100644
index 0000000..9d69d87
--- /dev/null
+++ b/eclass/matrox.eclass
@@ -0,0 +1,107 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/matrox.eclass,v 1.13 2005/07/06 20:23:20 agriffis 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.
+
+inherit eutils
+
+
+EXPORT_FUNCTIONS pkg_setup src_compile
+
+HOMEPAGE="http://www.matrox.com/mga/products/parhelia/home.cfm"
+
+LICENSE="Matrox"
+SLOT="${KV}"
+RESTRICT="fetch nostrip"
+
+RDEPEND="virtual/linux-sources"
+
+matrox_pkg_setup() {
+ # Require correct /usr/src/linux
+ check_KV
+
+ # Set up X11 implementation
+ X11_IMPLEM_P="$(best_version virtual/x11)"
+ X11_IMPLEM="${X11_IMPLEM_P%-[0-9]*}"
+ X11_IMPLEM="${X11_IMPLEM##*\/}"
+ einfo "X11 implementation is ${X11_IMPLEM}."
+
+ # 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)
+ if has_version "x11-base/xfree"
+ then
+ 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
+ # xorg-x11 compatibility
+ elif has_version "x11-base/xorg-x11"
+ then
+ if [ "${FORCE_VERSION}" != "4.3.0" ]
+ then
+ die "Set FORCE_VERSION=4.3.0 to emerge this. Use at your own risk."
+ fi
+ GENTOO_X_VERSION="${FORCE_VERSION}"
+ fi
+}
+
+matrox_src_compile() {
+ # 2.6 builds use the ARCH variable
+ set_arch_to_kernel
+ export PARHELIUX="${PWD}/src"
+ cd ${S}/src/kernel/parhelia
+ ln -sf ../../../kernel/mtx_parhelia.o .
+ cd ..
+ # Can't use emake here
+ make clean
+ make || die "make failed"
+ set_arch_to_portage
+}
+
+matrox_base_src_install() {
+ # Kernel Module
+ dodir /$(get_libdir)/modules/${KV}/kernel/drivers/video; insinto /$(get_libdir)/modules/${KV}/kernel/drivers/video
+ doins src/kernel/mtx.o
+
+ # X Driver (2D)
+ dodir /usr/X11R6/$(get_libdir)/modules/drivers; insinto /usr/X11R6/$(get_libdir)/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
+}