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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Apr 24 07:24:10 2005 UTC (14 years, 5 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
remove wrong gcc4 patch
(Portage version: 2.0.51.20)

1 # Copyright 1999-2005 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-r1.ebuild,v 1.7 2005/01/12 19:43:14 dsd 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="virtual/libc"
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 # Link like the other packages
51 sed -i 's:$(FLAGS):$(CFLAGS) $(LDFLAGS):' demos/Makefile || die
52 }
53
54 src_compile() {
55 filter-flags -fPIC
56 export CC="$(tc-getCC)"
57
58 # First build static
59 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
60 # Have to remove for shared to build ...
61 rm -f src/svgalib_helper.h
62 # Then build shared ...
63 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
64 # Missing in some cases ...
65 ln -s libvga.so.${PV} sharedlib/libvga.so
66 # Build lrmi and tools ...
67 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
68 textutils lrmi utils \
69 || die "Failed to build libraries and utils!"
70 # Build the gl stuff tpp
71 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
72 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
73 || die "Failed to build libvgagl.so.${PV}!"
74 # Missing in some cases ...
75 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
76 rm -f src/svgalib_helper.h
77 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
78 || die "Failed to build libvga.so.${PV}!"
79 cp -a src/libvga.so.${PV} sharedlib/
80 # Build threeDKit ...
81 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
82 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
83 # Build demo's ...
84 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
85 demoprogs || die "Failed to build demoprogs!"
86
87 if ! use build && kernel-mod_modules_supported
88 then
89 cd ${S}/kernel/svgalib_helper
90 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
91 env -u ARCH \
92 make -f Makefile.alt INCLUDEDIR="${ROOT}/usr/src/linux/include" \
93 clean modules || die "Failed to build kernel module!"
94 else
95 env -u ARCH make || die "Failed to build kernel module!"
96 fi
97 cd ${S}
98 fi
99
100 cp Makefile Makefile.orig
101 sed -e 's/\(install: $(INSTALLAOUTLIB) \)installheaders \(.*\)/\1\2/g' \
102 Makefile.orig > Makefile
103 }
104
105 src_install() {
106 local x=
107
108 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
109
110 make \
111 TOPDIR=${D} OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
112 install || die "Failed to install svgalib!"
113 if ! use build && kernel-mod_modules_supported
114 then
115 cd ${S}/kernel/svgalib_helper
116 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
117 env -u ARCH \
118 make -f Makefile.alt TOPDIR=${D} \
119 INCLUDEDIR="${ROOT}/usr/src/linux/include" \
120 modules_install || die "Failed to install svgalib module!"
121 else
122 insinto /lib/modules/${KV}/kernel/misc
123 doins svgalib_helper.ko
124 fi
125 cd ${S}
126 fi
127
128 insinto /usr/include
129 doins gl/vgagl.h
130 dolib.a staticlib/libvga.a
131 dolib.a gl/libvgagl.a
132 dolib.a threeDKit/lib3dkit.a
133 dolib.so gl/libvgagl.so.${PV}
134 dosym libvgagl.so.${PV} /usr/lib/libvgagl.so
135 preplib
136
137 insinto /usr/include
138 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
139 doins src/keyboard/vgakeyboard.h
140
141 dodir /etc/modules.d
142 echo "probeall /dev/svga svgalib_helper" > ${D}/etc/modules.d/svgalib
143
144 dodir /etc/devfs.d
145 newins ${FILESDIR}/svgalib.devfs svgalib
146
147 exeinto /usr/lib/svgalib/demos
148 for x in ${S}/demos/*
149 do
150 [ -x "${x}" ] && doexe ${x}
151 done
152
153 cd ${S}/threeDKit
154 exeinto /usr/lib/svgalib/threeDKit
155 local THREED_PROGS="plane wrapdemo"
156 doexe ${THREED_PROGS}
157
158 cd ${S}
159 dodoc 0-README
160 cd ${S}/doc
161 dodoc CHANGES DESIGN TODO
162 docinto txt
163 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
164
165 mv ${D}/usr/man/* ${D}/usr/share/man
166 rmdir ${D}/usr/man
167 }
168
169 pkg_postinst() {
170 [ "${ROOT}" = "/" ] && /sbin/modules-update &> /dev/null
171 einfo "When upgrading your kernel you'll need to rebuild the kernel module."
172 }

  ViewVC Help
Powered by ViewVC 1.1.20