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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Sun Sep 11 19:42:17 2005 UTC (14 years, 1 month ago) by dsd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
udev rules fix
(Portage version: 1.589-cvs)

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.21.ebuild,v 1.11 2005/08/23 18:09:41 flameeyes 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 dosym libvgagl.so.${PV} /usr/lib/libvgagl.so
104 preplib
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 dodir /etc/udev/rules.d
112 newins "${FILESDIR}"/svgalib.udev.rules.d 30-svgalib
113 elif best_version sys-fs/udev ; then
114 insinto /etc/udev/permissions.d
115 newins "${FILESDIR}"/svgalib.udev.perms.d 30-svgalib
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 mv "${D}"/usr/man/* "${D}"/usr/share/man
139 rmdir "${D}"/usr/man
140 }
141
142 pkg_postinst() {
143 ! use build && ! use no-helper && linux-mod_pkg_postinst
144 [[ ${ROOT} != "/" ]] && return 0
145
146 if [[ -e /dev/.devfsd ]] ; then
147 ebegin "Restarting devfsd to reread devfs rules"
148 killall -HUP devfsd
149 eend $?
150 elif [[ -e /dev/.udev ]] ; then
151 ebegin "Restarting udev to reread udev rules"
152 udevstart
153 eend $?
154 fi
155 }

  ViewVC Help
Powered by ViewVC 1.1.20