/[gentoo-x86]/media-libs/svgalib/svgalib-1.9.19-r3.ebuild
Gentoo

Contents of /media-libs/svgalib/svgalib-1.9.19-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Wed Feb 8 01:11:55 2006 UTC (13 years, 8 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
cut old ebuilds to shut brix up #121961
(Portage version: 2.1_pre4-r1)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-libs/svgalib/svgalib-1.9.19-r3.ebuild,v 1.6 2006/01/05 03:06:10 vapier Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs kernel-mod
6
7 DESCRIPTION="A library for running svga graphics on the console"
8 HOMEPAGE="http://www.svgalib.org/"
9 SRC_URI="http://www.arava.co.il/matan/${PN}/${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="-* x86"
14 IUSE="build"
15
16 DEPEND=""
17
18 pkg_setup() {
19 ! use build && kernel-mod_modules_supported && check_KV
20 }
21
22 src_unpack() {
23 unpack ${A}
24
25 cd ${S}
26 epatch ${FILESDIR}/${P}-gentoo.patch
27
28 # Get it to work with kernel 2.6
29 epatch ${FILESDIR}/${P}-linux2.6.patch
30 sed -i '/^KDIR/s:=.*:=${ROOT}/usr/src/linux:' ${S}/kernel/svgalib_helper/Makefile
31
32 # Fix include bug #54198
33 epatch ${FILESDIR}/${PN}-1.9.18-utils-include.patch
34
35 # Have lrmi compile with our $CFLAGS
36 epatch ${FILESDIR}/${PN}-1.9.18-lrmi-gentoo-cflags.patch
37
38 # -fPIC does work for lrmi, see bug #51698
39 epatch ${FILESDIR}/${P}-pic.patch
40
41 # Don't let the ebuild screw around with ld.so.conf #64829
42 epatch ${FILESDIR}/${P}-dont-touch-ld.conf.patch
43
44 # PCI functions have been renamed with newer kernels #69580
45 epatch ${FILESDIR}/${P}-pci-get-class.patch
46
47 # devfs_mk_symlink no longer available #77186
48 #epatch ${FILESDIR}/${P}-devfs.patch
49
50 # Don't strip stuff, let portage do it
51 sed -i '/^INSTALL_PROGRAM/s: -s : :' Makefile.cfg
52
53 # Link like the other packages
54 sed -i 's:$(FLAGS):$(CFLAGS) $(LDFLAGS):' demos/Makefile || die
55 }
56
57 src_compile() {
58 filter-flags -fPIC
59 export CC="$(tc-getCC)"
60
61 # First build static
62 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
63 # Have to remove for shared to build ...
64 rm -f src/svgalib_helper.h
65 # Then build shared ...
66 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
67 # Missing in some cases ...
68 ln -s libvga.so.${PV} sharedlib/libvga.so
69 # Build lrmi and tools ...
70 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
71 textutils lrmi utils \
72 || die "Failed to build libraries and utils!"
73 # Build the gl stuff tpp
74 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
75 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
76 || die "Failed to build libvgagl.so.${PV}!"
77 # Missing in some cases ...
78 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
79 rm -f src/svgalib_helper.h
80 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
81 || die "Failed to build libvga.so.${PV}!"
82 cp -a src/libvga.so.${PV} sharedlib/
83 # Build threeDKit ...
84 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
85 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
86 # Build demo's ...
87 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
88 demoprogs || die "Failed to build demoprogs!"
89
90 if ! use build && kernel-mod_modules_supported ; then
91 cd "${S}"/kernel/svgalib_helper
92 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
93 env -u ARCH \
94 make -f Makefile.alt INCLUDEDIR="${ROOT}/usr/src/linux/include" \
95 clean modules || die "Failed to build kernel module!"
96 else
97 env -u ARCH make || die "Failed to build kernel module!"
98 fi
99 cd "${S}"
100 fi
101
102 cp Makefile Makefile.orig
103 sed -e 's/\(install: $(INSTALLAOUTLIB) \)installheaders \(.*\)/\1\2/g' \
104 Makefile.orig > Makefile
105 }
106
107 src_install() {
108 local x=
109
110 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
111
112 make \
113 TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
114 install || die "Failed to install svgalib!"
115 if ! use build && kernel-mod_modules_supported ; then
116 cd "${S}"/kernel/svgalib_helper
117 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
118 env -u ARCH \
119 make -f Makefile.alt TOPDIR="${D}" \
120 INCLUDEDIR="${ROOT}/usr/src/linux/include" \
121 modules_install || die "Failed to install svgalib module!"
122 else
123 insinto /lib/modules/${KV}/kernel/misc
124 doins svgalib_helper.ko
125 fi
126 cd "${S}"
127 fi
128
129 insinto /usr/include
130 doins gl/vgagl.h
131 dolib.a staticlib/libvga.a
132 dolib.a gl/libvgagl.a
133 dolib.a threeDKit/lib3dkit.a
134 dolib.so gl/libvgagl.so.${PV}
135 local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg)
136 for x in lib3dkit libvga libvgagl ; do
137 dosym ${x}.so.${PV} /usr/lib/${x}.so
138 dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver}
139 done
140
141 insinto /usr/include
142 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
143 doins src/keyboard/vgakeyboard.h
144
145 dodir /etc/modules.d
146 echo "probeall /dev/svga svgalib_helper" > ${D}/etc/modules.d/svgalib
147
148 if [[ -e ${ROOT}/dev/.devfsd ]] ; then
149 insinto /etc/devfs.d
150 newins ${FILESDIR}/svgalib.devfs svgalib
151 elif [[ -e ${ROOT}/dev/.udev ]] ; then
152 dodir /etc/udev/permissions.d
153 echo "svga*:root:video:0660" > \
154 "${D}"/etc/udev/permissions.d/30-${PN}.permissions
155 fi
156
157 exeinto /usr/lib/svgalib/demos
158 for x in "${S}"/demos/* ; do
159 [[ -x ${x} ]] && doexe ${x}
160 done
161
162 cd "${S}"/threeDKit
163 exeinto /usr/lib/svgalib/threeDKit
164 local THREED_PROGS="plane wrapdemo"
165 doexe ${THREED_PROGS}
166
167 cd "${S}"
168 dodoc 0-README
169 cd "${S}"/doc
170 dodoc CHANGES DESIGN TODO
171 docinto txt
172 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
173
174 mv "${D}"/usr/man/* "${D}"/usr/share/man
175 rmdir "${D}"/usr/man
176 }
177
178 pkg_postinst() {
179 if [[ -e ${ROOT}/dev/.devfsd ]] ; then
180 ebegin "Restarting devfsd to reread devfs rules"
181 killall -HUP devfsd
182 eend $?
183 elif [[ -e ${ROOT}/dev/.udev ]] ; then
184 ebegin "Restarting udev to reread udev rules"
185 udevstart
186 eend $?
187 fi
188
189 [[ ${ROOT} == "/" ]] && /sbin/modules-update &> /dev/null
190 einfo "When upgrading your kernel you'll need to rebuild the kernel module."
191 }

  ViewVC Help
Powered by ViewVC 1.1.20