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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Fri Sep 24 01:06:20 2004 UTC (15 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +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.18-r1.ebuild,v 1.15 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$' /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 # Fix a small gcc33 issue
33 epatch ${FILESDIR}/${P}-gcc33.patch
34
35 # Fix a small gcc34 issue #48930
36 epatch ${FILESDIR}/${P}-gcc34.patch
37
38 # Get it to work with kernel 2.6
39 epatch ${FILESDIR}/${P}-linux2.6-v2.patch
40
41 # Fix include bug #54198
42 epatch ${FILESDIR}/${P}-utils-include.patch
43
44 # Have lrmi compile with our $CFLAGS
45 epatch ${FILESDIR}/${P}-lrmi-gentoo-cflags.patch
46
47 # Disable kernel module support while building stages #38403
48 #use build &&
49 sed -i 's:installmodule ::' Makefile
50 # for now we dont build the module at all #42522
51 }
52
53 src_compile() {
54 filter-flags "-fPIC"
55
56 # First build static
57 make OPTIMIZE="${CFLAGS}" static \
58 || die "Failed to build static libraries!"
59 # Have to remove for shared to build ...
60 rm -f src/svgalib_helper.h
61 # Then build shared ...
62 make OPTIMIZE="${CFLAGS}" shared \
63 || 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_supports_modules
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="/usr/src/linux/include" \
93 clean modules || die "Failed to alt 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 TOPDIR=${D} OPTIMIZE="${CFLAGS}" \
111 install || die "Failed to install svgalib!"
112 if ! use build && kernel_supports_modules
113 then
114 cd ${S}/kernel/svgalib_helper
115 if [[ `KV_to_int ${KV}` -lt `KV_to_int 2.6.6` ]] ; then
116 env -u ARCH \
117 make -f Makefile.alt TOPDIR=${D} \
118 INCLUDEDIR="/usr/src/linux/include" \
119 modules_install || die "Failed to install svgalib module!"
120 else
121 insinto /lib/modules/${KV}/kernel/misc
122 doins svgalib_helper.ko
123 fi
124 cd ${S}
125 fi
126
127 insinto /usr/include
128 doins gl/vgagl.h
129 dolib.a staticlib/libvga.a
130 dolib.a gl/libvgagl.a
131 dolib.a threeDKit/lib3dkit.a
132 dolib.so gl/libvgagl.so.${PV}
133 dosym libvgagl.so.${PV} /usr/lib/libvgagl.so
134 preplib
135
136 insinto /usr/include
137 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
138 doins src/keyboard/vgakeyboard.h
139
140 dodir /etc/modules.d
141 echo "probeall /dev/svga svgalib_helper" > ${D}/etc/modules.d/svgalib
142
143 exeinto /usr/lib/svgalib/demos
144 for x in ${S}/demos/*
145 do
146 [ -x "${x}" ] && doexe ${x}
147 done
148
149 cd ${S}/threeDKit
150 exeinto /usr/lib/svgalib/threeDKit
151 local THREED_PROGS="plane wrapdemo"
152 doexe ${THREED_PROGS}
153
154 cd ${S}
155 dodoc 0-README LICENSE
156 cd ${S}/doc
157 dodoc CHANGES DESIGN TODO
158 docinto txt
159 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
160
161 mv ${D}/usr/man/* ${D}/usr/share/man
162 rmdir ${D}/usr/man
163 }
164
165 pkg_postinst() {
166 [ "${ROOT}" = "/" ] && /sbin/modules-update &> /dev/null
167 einfo "When upgrading your kernel you'll need to rebuild the kernel module."
168 }

  ViewVC Help
Powered by ViewVC 1.1.20