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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Fri Sep 24 01:06:20 2004 UTC (15 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
dont touch ld.so.conf #64829

1 # Copyright 1999-2004 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.ebuild,v 1.10 2004/08/08 13:30:11 dragonheart Exp $
4
5 inherit eutils flag-o-matic
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 kernel_supports_modules() {
19 grep '^CONFIG_MODULES=y$' ${ROOT}/usr/src/linux/.config >& /dev/null
20 }
21
22 pkg_setup() {
23 ! use build && kernel_supports_modules && check_KV
24 }
25
26 src_unpack() {
27 unpack ${A}
28
29 cd ${S}
30 epatch ${FILESDIR}/${P}-gentoo.patch
31
32 # Get it to work with kernel 2.6
33 epatch ${FILESDIR}/${P}-linux2.6.patch
34 sed -i '/^KDIR/s:=.*:=${ROOT}/usr/src/linux:' ${S}/kernel/svgalib_helper/Makefile
35
36 # Fix include bug #54198
37 epatch ${FILESDIR}/${PN}-1.9.18-utils-include.patch
38
39 # Have lrmi compile with our $CFLAGS
40 epatch ${FILESDIR}/${PN}-1.9.18-lrmi-gentoo-cflags.patch
41 }
42
43 src_compile() {
44 filter-flags -fPIC
45
46 # First build static
47 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
48 # Have to remove for shared to build ...
49 rm -f src/svgalib_helper.h
50 # Then build shared ...
51 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
52 # Missing in some cases ...
53 ln -s libvga.so.${PV} sharedlib/libvga.so
54 # Build lrmi and tools ...
55 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
56 textutils lrmi utils \
57 || die "Failed to build libraries and utils!"
58 # Build the gl stuff tpp
59 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
60 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
61 || die "Failed to build libvgagl.so.${PV}!"
62 # Missing in some cases ...
63 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
64 rm -f src/svgalib_helper.h
65 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
66 || die "Failed to build libvga.so.${PV}!"
67 cp -a src/libvga.so.${PV} sharedlib/
68 # Build threeDKit ...
69 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
70 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
71 # Build demo's ...
72 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
73 demoprogs || die "Failed to build demoprogs!"
74
75 if ! use build && kernel_supports_modules
76 then
77 cd ${S}/kernel/svgalib_helper
78 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
79 env -u ARCH \
80 make -f Makefile.alt INCLUDEDIR="${ROOT}/usr/src/linux/include" \
81 clean modules || die "Failed to build kernel module!"
82 else
83 env -u ARCH make || die "Failed to build kernel module!"
84 fi
85 cd ${S}
86 fi
87
88 cp Makefile Makefile.orig
89 sed -e 's/\(install: $(INSTALLAOUTLIB) \)installheaders \(.*\)/\1\2/g' \
90 Makefile.orig > Makefile
91 }
92
93 src_install() {
94 local x=
95
96 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
97
98 make \
99 TOPDIR=${D} OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
100 install || die "Failed to install svgalib!"
101 if ! use build && kernel_supports_modules
102 then
103 cd ${S}/kernel/svgalib_helper
104 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
105 env -u ARCH \
106 make -f Makefile.alt TOPDIR=${D} \
107 INCLUDEDIR="${ROOT}/usr/src/linux/include" \
108 modules_install || die "Failed to install svgalib module!"
109 else
110 insinto /lib/modules/${KV}/kernel/misc
111 doins svgalib_helper.ko
112 fi
113 cd ${S}
114 fi
115
116 insinto /usr/include
117 doins gl/vgagl.h
118 dolib.a staticlib/libvga.a
119 dolib.a gl/libvgagl.a
120 dolib.a threeDKit/lib3dkit.a
121 dolib.so gl/libvgagl.so.${PV}
122 dosym libvgagl.so.${PV} /usr/lib/libvgagl.so
123 preplib
124
125 insinto /usr/include
126 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
127 doins src/keyboard/vgakeyboard.h
128
129 dodir /etc/modules.d
130 echo "probeall /dev/svga svgalib_helper" > ${D}/etc/modules.d/svgalib
131
132 exeinto /usr/lib/svgalib/demos
133 for x in ${S}/demos/*
134 do
135 [ -x "${x}" ] && doexe ${x}
136 done
137
138 cd ${S}/threeDKit
139 exeinto /usr/lib/svgalib/threeDKit
140 local THREED_PROGS="plane wrapdemo"
141 doexe ${THREED_PROGS}
142
143 cd ${S}
144 dodoc 0-README
145 cd ${S}/doc
146 dodoc CHANGES DESIGN TODO
147 docinto txt
148 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
149
150 mv ${D}/usr/man/* ${D}/usr/share/man
151 rmdir ${D}/usr/man
152 }
153
154 pkg_postinst() {
155 [ "${ROOT}" = "/" ] && /sbin/modules-update &> /dev/null
156 einfo "When upgrading your kernel you'll need to rebuild the kernel module."
157 }

  ViewVC Help
Powered by ViewVC 1.1.20