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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Sep 18 08:47:39 2006 UTC (13 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
punt old
(Portage version: 2.1.1)

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.21-r1.ebuild,v 1.3 2006/01/05 03:06:10 vapier Exp $
4
5 inherit eutils flag-o-matic toolchain-funcs linux-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 no-helper"
15
16 DEPEND=""
17
18 MODULE_NAMES="svgalib_helper(misc:${S}/kernel/svgalib_helper)"
19 BUILD_TARGETS="default"
20 MODULESD_SVGALIB_HELPER_ADDITIONS="probeall /dev/svga svgalib_helper"
21
22 pkg_setup() {
23 linux-mod_pkg_setup
24 BUILD_PARAMS="KDIR=${KV_DIR}"
25 }
26
27 src_unpack() {
28 unpack ${A}
29 cd "${S}"
30
31 # Misc makefile clean ups
32 epatch "${FILESDIR}"/${P}-gentoo.patch
33
34 # Get it to work with kernel 2.6
35 epatch "${FILESDIR}"/${PN}-1.9.21-linux2.6.patch
36
37 # -fPIC does work for lrmi, see bug #51698
38 epatch "${FILESDIR}"/${PN}-1.9.19-pic.patch
39
40 # Don't let the ebuild screw around with ld.so.conf #64829
41 epatch "${FILESDIR}"/${PN}-1.9.19-dont-touch-ld.conf.patch
42
43 # make sure the define wrapper is used #91118
44 sed -i -e 's:devfs_mk_symlink:DEVFS_MK_SYMLINK:' kernel/svgalib_helper/main.c
45
46 use no-helper && sed -i '/^# NO_HELPER/s:# ::' Makefile.cfg
47
48 # Don't strip stuff, let portage do it
49 sed -i '/^INSTALL_PROGRAM/s: -s : :' Makefile.cfg
50 }
51
52 src_compile() {
53 export CC="$(tc-getCC)"
54
55 # First build static
56 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
57 # Have to remove for shared to build ...
58 rm -f src/svgalib_helper.h
59 # Then build shared ...
60 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
61 # Missing in some cases ...
62 ln -s libvga.so.${PV} sharedlib/libvga.so
63 # Build lrmi and tools ...
64 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
65 textutils lrmi utils \
66 || die "Failed to build libraries and utils!"
67 # Build the gl stuff tpp
68 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
69 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
70 || die "Failed to build libvgagl.so.${PV}!"
71 # Missing in some cases ...
72 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
73 rm -f src/svgalib_helper.h
74 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
75 || die "Failed to build libvga.so.${PV}!"
76 cp -pPR src/libvga.so.${PV} sharedlib/
77 # Build threeDKit ...
78 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
79 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
80 # Build demo's ...
81 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
82 demoprogs || die "Failed to build demoprogs!"
83
84 ! use build && ! use no-helper && linux-mod_src_compile
85 }
86
87 src_install() {
88 local x=
89
90 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
91
92 make \
93 TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
94 install || die "Failed to install svgalib!"
95 ! use build && ! use no-helper && linux-mod_src_install
96
97 insinto /usr/include
98 doins gl/vgagl.h
99 dolib.a staticlib/libvga.a
100 dolib.a gl/libvgagl.a
101 dolib.a threeDKit/lib3dkit.a
102 dolib.so gl/libvgagl.so.${PV}
103 local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg)
104 for x in lib3dkit libvga libvgagl ; do
105 dosym ${x}.so.${PV} /usr/lib/${x}.so
106 dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver}
107 done
108
109 insinto /usr/include
110 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
111 doins src/keyboard/vgakeyboard.h
112
113 if best_version '>=sys-fs/udev-045' ; then
114 insinto /etc/udev/rules.d
115 newins "${FILESDIR}"/svgalib.udev.rules.d 30-svgalib.rules
116 elif best_version sys-fs/udev ; then
117 insinto /etc/udev/permissions.d
118 newins "${FILESDIR}"/svgalib.udev.perms.d 30-svgalib.permissions
119 elif best_version sys-fs/devfsd ; then
120 insinto /etc/devfs.d
121 newins "${FILESDIR}"/svgalib.devfs svgalib
122 fi
123
124 exeinto /usr/lib/svgalib/demos
125 for x in "${S}"/demos/* ; do
126 [[ -x ${x} ]] && doexe ${x}
127 done
128
129 cd "${S}"/threeDKit
130 exeinto /usr/lib/svgalib/threeDKit
131 local THREED_PROGS="plane wrapdemo"
132 doexe ${THREED_PROGS}
133
134 cd "${S}"
135 dodoc 0-README
136 cd "${S}"/doc
137 dodoc CHANGES DESIGN TODO
138 docinto txt
139 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
140
141 mv "${D}"/usr/man/* "${D}"/usr/share/man
142 rmdir "${D}"/usr/man
143 }
144
145 pkg_postinst() {
146 ! use build && ! use no-helper && linux-mod_pkg_postinst
147 [[ ${ROOT} != "/" ]] && return 0
148
149 if [[ -e /dev/.devfsd ]] ; then
150 ebegin "Restarting devfsd to reread devfs rules"
151 killall -HUP devfsd
152 eend $?
153 elif [[ -e /dev/.udev ]] ; then
154 ebegin "Restarting udev to reread udev rules"
155 udevstart
156 eend $?
157 fi
158 }

  ViewVC Help
Powered by ViewVC 1.1.20