/[gentoo-alt]/trunk/prefix/eclass/matrox.eclass
Gentoo

Contents of /trunk/prefix/eclass/matrox.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 2941 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/matrox.eclass,v 1.14 2006/01/18 23:59:50 spyderous Exp $
4 #
5 # Author: Donnie Berkholz <spyderous@gentoo.org>
6 #
7 # This eclass is designed to reduce code duplication in the mtxdrivers* ebuilds.
8 # The only addition to mtxdrivers-pro is OpenGL stuff.
9
10 inherit eutils
11
12
13 EXPORT_FUNCTIONS pkg_setup src_compile
14
15 HOMEPAGE="http://www.matrox.com/mga/products/parhelia/home.cfm"
16
17 LICENSE="Matrox"
18 SLOT="${KV}"
19 RESTRICT="fetch nostrip"
20
21 RDEPEND="virtual/linux-sources"
22
23 matrox_pkg_setup() {
24 # Require correct /usr/src/linux
25 check_KV
26
27 # Set up X11 implementation
28 X11_IMPLEM_P="$(best_version virtual/x11)"
29 X11_IMPLEM="${X11_IMPLEM_P%-[0-9]*}"
30 X11_IMPLEM="${X11_IMPLEM##*\/}"
31 einfo "X11 implementation is ${X11_IMPLEM}."
32
33 # Force XFree86 4.3.0, 4.2.1 or 4.2.0 to be installed unless FORCE_VERSION
34 # is set. Need FORCE_VERSION for 4.3.99/4.4.0 compatibility until Matrox
35 # comes up with drivers (spyderous)
36 if has_version "x11-base/xfree"
37 then
38 local INSTALLED_X="`best_version x11-base/xfree`"
39 GENTOO_X_VERSION_REVISION="${INSTALLED_X/x11-base\/xfree-}"
40 GENTOO_X_VERSION="${GENTOO_X_VERSION_REVISION%-*}"
41 if [ "${GENTOO_X_VERSION}" != "4.3.0" ]
42 then
43 if [ "${GENTOO_X_VERSION}" != "4.2.1" ]
44 then
45 if [ "${GENTOO_X_VERSION}" != "4.2.0" ]
46 then
47 if [ -n "${FORCE_VERSION}" ]
48 then
49 GENTOO_X_VERSION="${FORCE_VERSION}"
50 else
51 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."
52 fi
53 fi
54 fi
55 fi
56 # xorg-x11 compatibility
57 elif has_version "x11-base/xorg-x11"
58 then
59 if [ "${FORCE_VERSION}" != "4.3.0" ]
60 then
61 die "Set FORCE_VERSION=4.3.0 to emerge this. Use at your own risk."
62 fi
63 GENTOO_X_VERSION="${FORCE_VERSION}"
64 fi
65 }
66
67 matrox_src_compile() {
68 # 2.6 builds use the ARCH variable
69 set_arch_to_kernel
70 export PARHELIUX="${PWD}/src"
71 cd ${S}/src/kernel/parhelia
72 ln -sf ../../../kernel/mtx_parhelia.o .
73 cd ..
74 # Can't use emake here
75 make clean
76 make || die "make failed"
77 set_arch_to_portage
78 }
79
80 matrox_base_src_install() {
81 # Kernel Module
82 dodir /$(get_libdir)/modules/${KV}/kernel/drivers/video; insinto /$(get_libdir)/modules/${KV}/kernel/drivers/video
83 doins src/kernel/mtx.o
84
85 # X Driver (2D)
86 dodir /usr/X11R6/$(get_libdir)/modules/drivers; insinto /usr/X11R6/$(get_libdir)/modules/drivers
87 doins xfree86/${GENTOO_X_VERSION}/mtx_drv.o
88 }
89
90 matrox_base_pkg_postinst() {
91 if [ "${ROOT}" = "/" ]
92 then
93 /sbin/modules-update
94 fi
95
96 if [ ! -d /dev/video ]
97 then
98 if [ -f /dev/video ]
99 then
100 einfo "NOTE: To be able to use busmastering, you MUST have /dev/video as"
101 einfo "a directory, which means you must remove anything there first"
102 einfo "(rm -f /dev/video), and mkdir /dev/video"
103 else
104 mkdir /dev/video
105 fi
106 fi
107 }

  ViewVC Help
Powered by ViewVC 1.1.20