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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +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.23.ebuild,v 1.2 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}"/${PN}-1.9.23-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 use no-helper && sed -i '/^# NO_HELPER/s:# ::' Makefile.cfg
44
45 # Don't strip stuff, let portage do it
46 sed -i '/^INSTALL_PROGRAM/s: -s : :' Makefile.cfg
47 }
48
49 src_compile() {
50 export CC=$(tc-getCC)
51
52 # First build static
53 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
54 # Have to remove for shared to build ...
55 rm -f src/svgalib_helper.h
56 # Then build shared ...
57 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
58 # Missing in some cases ...
59 ln -s libvga.so.${PV} sharedlib/libvga.so
60 # Build lrmi and tools ...
61 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
62 textutils lrmi utils \
63 || die "Failed to build libraries and utils!"
64 # Build the gl stuff tpp
65 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
66 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
67 || die "Failed to build libvgagl.so.${PV}!"
68 # Missing in some cases ...
69 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
70 rm -f src/svgalib_helper.h
71 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
72 || die "Failed to build libvga.so.${PV}!"
73 cp -pPR src/libvga.so.${PV} sharedlib/
74 # Build threeDKit ...
75 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
76 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
77 # Build demo's ...
78 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
79 demoprogs || die "Failed to build demoprogs!"
80
81 ! use build && ! use no-helper && linux-mod_src_compile
82 }
83
84 src_install() {
85 local x=
86
87 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
88
89 make \
90 TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
91 install || die "Failed to install svgalib!"
92 ! use build && ! use no-helper && linux-mod_src_install
93
94 insinto /usr/include
95 doins gl/vgagl.h
96 dolib.a staticlib/libvga.a || die "dolib.a libvga"
97 dolib.a gl/libvgagl.a || die "dolib.a libvgagl"
98 dolib.a threeDKit/lib3dkit.a
99 dolib.so gl/libvgagl.so.${PV} || die "dolib.so libvgagl.so"
100 local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg)
101 for x in lib3dkit libvga libvgagl ; do
102 dosym ${x}.so.${PV} /usr/lib/${x}.so
103 dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver}
104 done
105
106 insinto /usr/include
107 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
108 doins src/keyboard/vgakeyboard.h
109
110 if best_version '>=sys-fs/udev-045' ; then
111 insinto /etc/udev/rules.d
112 newins "${FILESDIR}"/svgalib.udev.rules.d 30-svgalib.rules
113 elif best_version sys-fs/udev ; then
114 insinto /etc/udev/permissions.d
115 newins "${FILESDIR}"/svgalib.udev.perms.d 30-svgalib.permissions
116 elif best_version sys-fs/devfsd ; then
117 insinto /etc/devfs.d
118 newins "${FILESDIR}"/svgalib.devfs svgalib
119 fi
120
121 exeinto /usr/lib/svgalib/demos
122 for x in "${S}"/demos/* ; do
123 [[ -x ${x} ]] && doexe ${x}
124 done
125
126 cd "${S}"/threeDKit
127 exeinto /usr/lib/svgalib/threeDKit
128 local THREED_PROGS="plane wrapdemo"
129 doexe ${THREED_PROGS}
130
131 cd "${S}"
132 dodoc 0-README
133 cd "${S}"/doc
134 dodoc CHANGES DESIGN TODO
135 docinto txt
136 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
137 }
138
139 pkg_postinst() {
140 ! use build && ! use no-helper && linux-mod_pkg_postinst
141 [[ ${ROOT} != "/" ]] && return 0
142
143 if [[ -e /dev/.devfsd ]] ; then
144 ebegin "Restarting devfsd to reread devfs rules"
145 killall -HUP devfsd
146 eend $?
147 elif [[ -e /dev/.udev ]] ; then
148 ebegin "Restarting udev to reread udev rules"
149 udevstart
150 eend $?
151 fi
152 }

  ViewVC Help
Powered by ViewVC 1.1.20