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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sun Jan 27 10:37:02 2008 UTC (11 years, 8 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.4)

1 # Copyright 1999-2007 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.24.ebuild,v 1.5 2007/02/12 05:09:35 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_OUT_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.24-linux2.6.patch
36 epatch "${FILESDIR}"/${PN}-1.9.24-all_devices.patch #133936
37
38 # -fPIC does work for lrmi, see bug #51698
39 epatch "${FILESDIR}"/${PN}-1.9.19-pic.patch
40
41 # Don't let the ebuild screw around with ld.so.conf #64829
42 epatch "${FILESDIR}"/${PN}-1.9.19-dont-touch-ld.conf.patch
43
44 use no-helper && sed -i '/^# NO_HELPER/s:# ::' Makefile.cfg
45
46 # Don't strip stuff, let portage do it
47 sed -i '/^INSTALL_PROGRAM/s: -s : :' Makefile.cfg
48 }
49
50 src_compile() {
51 export CC=$(tc-getCC)
52
53 # First build static
54 make OPTIMIZE="${CFLAGS}" static || die "Failed to build static libraries!"
55 # Have to remove for shared to build ...
56 rm -f src/svgalib_helper.h
57 # Then build shared ...
58 make OPTIMIZE="${CFLAGS}" shared || die "Failed to build shared libraries!"
59 # Missing in some cases ...
60 ln -s libvga.so.${PV} sharedlib/libvga.so
61 # Build lrmi and tools ...
62 make OPTIMIZE="${CFLAGS}" LDFLAGS="-L../sharedlib" \
63 textutils lrmi utils \
64 || die "Failed to build libraries and utils!"
65 # Build the gl stuff tpp
66 make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
67 make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
68 || die "Failed to build libvgagl.so.${PV}!"
69 # Missing in some cases ...
70 ln -s libvgagl.so.${PV} sharedlib/libvgagl.so
71 rm -f src/svgalib_helper.h
72 make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
73 || die "Failed to build libvga.so.${PV}!"
74 cp -pPR src/libvga.so.${PV} sharedlib/
75 # Build threeDKit ...
76 make OPTIMIZE="${CFLAGS}" LDFLAGS='-L../sharedlib' \
77 -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
78 # Build demo's ...
79 make OPTIMIZE="${CFLAGS} -I../gl" LDFLAGS='-L../sharedlib' \
80 demoprogs || die "Failed to build demoprogs!"
81
82 ! use build && ! use no-helper && linux-mod_src_compile
83 }
84
85 src_install() {
86 local x=
87
88 dodir /etc/svgalib /usr/{include,lib,bin,share/man}
89
90 make \
91 TOPDIR="${D}" OPTIMIZE="${CFLAGS}" INSTALLMODULE="" \
92 install || die "Failed to install svgalib!"
93 ! use build && ! use no-helper && linux-mod_src_install
94
95 insinto /usr/include
96 doins gl/vgagl.h
97 dolib.a staticlib/libvga.a || die "dolib.a libvga"
98 dolib.a gl/libvgagl.a || die "dolib.a libvgagl"
99 dolib.a threeDKit/lib3dkit.a
100 dolib.so gl/libvgagl.so.${PV} || die "dolib.so libvgagl.so"
101 local abiver=$(sed -n '/^MAJOR_VER.*=/{s:.*=[ ]*::;p}' Makefile.cfg)
102 for x in lib3dkit libvga libvgagl ; do
103 dosym ${x}.so.${PV} /usr/lib/${x}.so
104 dosym ${x}.so.${PV} /usr/lib/${x}.so.${abiver}
105 done
106
107 insinto /usr/include
108 doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
109 doins src/keyboard/vgakeyboard.h
110
111 if best_version '>=sys-fs/udev-045' ; then
112 insinto /etc/udev/rules.d
113 newins "${FILESDIR}"/svgalib.udev.rules.d 30-svgalib.rules
114 elif best_version sys-fs/udev ; then
115 insinto /etc/udev/permissions.d
116 newins "${FILESDIR}"/svgalib.udev.perms.d 30-svgalib.permissions
117 elif best_version sys-fs/devfsd ; then
118 insinto /etc/devfs.d
119 newins "${FILESDIR}"/svgalib.devfs svgalib
120 fi
121
122 exeinto /usr/lib/svgalib/demos
123 for x in "${S}"/demos/* ; do
124 [[ -x ${x} ]] && doexe ${x}
125 done
126
127 cd "${S}"/threeDKit
128 exeinto /usr/lib/svgalib/threeDKit
129 local THREED_PROGS="plane wrapdemo"
130 doexe ${THREED_PROGS}
131
132 cd "${S}"
133 dodoc 0-README
134 cd "${S}"/doc
135 dodoc CHANGES DESIGN TODO
136 docinto txt
137 dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
138 }
139
140 pkg_postinst() {
141 ! use build && ! use no-helper && linux-mod_pkg_postinst
142 }

  ViewVC Help
Powered by ViewVC 1.1.20