Lines 1-14
Link Here
|
1 |
# Copyright 1999-2007 Gentoo Foundation |
1 |
# Copyright 1999-2009 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/x11-drm-20070314.ebuild,v 1.2 2007/03/14 18:18:53 battousai Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/x11-drm-20070314.ebuild,v 1.2 2007/03/14 18:18:53 battousai Exp $ |
4 |
|
4 |
|
5 |
WANT_AUTOCONF="latest" |
|
|
6 |
WANT_AUTOMAKE="1.7" |
7 |
|
8 |
#EGIT_BRANCH="vblank-rework" |
5 |
#EGIT_BRANCH="vblank-rework" |
9 |
EGIT_REPO_URI="git://anongit.freedesktop.org/git/mesa/drm" |
6 |
EGIT_REPO_URI="git://anongit.freedesktop.org/git/mesa/drm" |
10 |
|
7 |
|
11 |
inherit eutils x11 linux-mod autotools git |
8 |
inherit eutils x11 linux-mod git |
12 |
|
9 |
|
13 |
IUSE_VIDEO_CARDS=" |
10 |
IUSE_VIDEO_CARDS=" |
14 |
video_cards_mach64 |
11 |
video_cards_mach64 |
Lines 28-40
IUSE="${IUSE_VIDEO_CARDS} kernel_FreeBSD kernel_linux"
Link Here
|
28 |
RESTRICT="strip" |
25 |
RESTRICT="strip" |
29 |
|
26 |
|
30 |
S="${WORKDIR}/drm" |
27 |
S="${WORKDIR}/drm" |
31 |
PATCHVER="0.2" |
28 |
#PATCHVER="0.1" |
32 |
PATCHDIR="${WORKDIR}/patch" |
29 |
PATCHDIR="${WORKDIR}/patch" |
33 |
EXCLUDED="${WORKDIR}/excluded" |
30 |
EXCLUDED="${WORKDIR}/excluded" |
34 |
|
31 |
|
35 |
DESCRIPTION="DRM Kernel Modules for X11" |
32 |
DESCRIPTION="DRM Kernel Modules for X11" |
36 |
HOMEPAGE="http://dri.sf.net" |
33 |
HOMEPAGE="http://dri.sf.net" |
37 |
SRC_URI="http://dev.gentoo.org/~dberkholz/distfiles/${P}-gentoo-${PATCHVER}.tar.bz2" |
34 |
if [ -n "${PATCHVER}" ] ; then |
|
|
35 |
SRC_URI="http://dev.gentoo.org/~dberkholz/distfiles/${P}-gentoo-${PATCHVER}.tar.bz2" |
36 |
else |
37 |
SRC_URI="" |
38 |
fi |
38 |
|
39 |
|
39 |
SLOT="0" |
40 |
SLOT="0" |
40 |
LICENSE="X11" |
41 |
LICENSE="X11" |
Lines 62-101
src_unpack() {
Link Here
|
62 |
git_src_unpack |
63 |
git_src_unpack |
63 |
cd "${WORKDIR}" |
64 |
cd "${WORKDIR}" |
64 |
|
65 |
|
65 |
unpack ${P}-gentoo-${PATCHVER}.tar.bz2 |
66 |
# Apply patches if there's a patchball version number provided. |
66 |
|
67 |
if [ -n "${PATCHVER}" ] |
67 |
cd "${S}" |
68 |
then |
68 |
|
69 |
unpack ${P}-gentoo-${PATCHVER}.tar.bz2 |
69 |
patch_prepare |
70 |
cd "${S}" |
70 |
|
|
|
71 |
# Apply patches |
72 |
EPATCH_SUFFIX="patch" epatch ${PATCHDIR} |
73 |
|
71 |
|
74 |
# Substitute new directory under /lib/modules/${KV_FULL} |
72 |
patch_prepare |
75 |
cd "${SRC_BUILD}" |
|
|
76 |
sed -i -e "s:/kernel/drivers/char/drm:/${PN}:g" Makefile |
77 |
|
73 |
|
78 |
cp "${S}"/tests/*.c ${SRC_BUILD} |
74 |
# Apply patches |
|
|
75 |
EPATCH_SUFFIX="patch" epatch ${PATCHDIR} |
76 |
fi |
79 |
|
77 |
|
80 |
src_unpack_os |
78 |
src_unpack_os |
81 |
|
|
|
82 |
cd "${S}" |
83 |
eautoreconf -v --install |
84 |
} |
79 |
} |
85 |
|
80 |
|
86 |
src_compile() { |
81 |
src_compile() { |
87 |
unset LDFLAGS |
|
|
88 |
|
89 |
cd "${S}" |
90 |
# Building the programs. These are useful for developers and getting info from DRI and DRM. |
91 |
# |
92 |
# libdrm objects are needed for drmstat. |
93 |
econf \ |
94 |
--enable-static \ |
95 |
--disable-shared \ |
96 |
|| die "libdrm configure failed." |
97 |
emake || die "libdrm build failed." |
98 |
|
99 |
einfo "Building DRM in ${SRC_BUILD}..." |
82 |
einfo "Building DRM in ${SRC_BUILD}..." |
100 |
src_compile_os |
83 |
src_compile_os |
101 |
einfo "DRM build finished". |
84 |
einfo "DRM build finished". |
Lines 108-116
src_install() {
Link Here
|
108 |
src_install_os |
91 |
src_install_os |
109 |
|
92 |
|
110 |
dodoc "${S}/linux-core/README.drm" |
93 |
dodoc "${S}/linux-core/README.drm" |
111 |
|
|
|
112 |
dobin dristat |
113 |
dobin drmstat |
114 |
} |
94 |
} |
115 |
|
95 |
|
116 |
pkg_postinst() { |
96 |
pkg_postinst() { |
Lines 256-262
src_compile_linux() {
Link Here
|
256 |
MODULE_NAMES="" |
236 |
MODULE_NAMES="" |
257 |
for i in drm.${KV_OBJ} ${VIDCARDS}; do |
237 |
for i in drm.${KV_OBJ} ${VIDCARDS}; do |
258 |
MODULE_NAMES="${MODULE_NAMES} ${i/.${KV_OBJ}}(${PN}:${SRC_BUILD})" |
238 |
MODULE_NAMES="${MODULE_NAMES} ${i/.${KV_OBJ}}(${PN}:${SRC_BUILD})" |
259 |
i=$(echo ${i} | tr '[:lower:]' '[:upper:]') |
239 |
i=$(echo ${i/.${KV_OBJ}} | tr '[:lower:]' '[:upper:]') |
260 |
eval MODULESD_${i}_ENABLED="yes" |
240 |
eval MODULESD_${i}_ENABLED="yes" |
261 |
done |
241 |
done |
262 |
|
242 |
|
Lines 271-281
src_compile_linux() {
Link Here
|
271 |
then |
251 |
then |
272 |
ewarn "Please disable in-kernel DRM support to use this package." |
252 |
ewarn "Please disable in-kernel DRM support to use this package." |
273 |
fi |
253 |
fi |
274 |
|
|
|
275 |
# LINUXDIR is needed to allow Makefiles to find kernel release. |
276 |
cd "${SRC_BUILD}" |
277 |
emake LINUXDIR="${KERNEL_DIR}" dristat || die "Building dristat failed." |
278 |
emake LINUXDIR="${KERNEL_DIR}" drmstat || die "Building drmstat failed." |
279 |
} |
254 |
} |
280 |
|
255 |
|
281 |
src_compile_freebsd() { |
256 |
src_compile_freebsd() { |
Lines 290-304
src_compile_freebsd() {
Link Here
|
290 |
KMODDIR="/boot/modules" \ |
265 |
KMODDIR="/boot/modules" \ |
291 |
|| die "pmake failed." |
266 |
|| die "pmake failed." |
292 |
export CFLAGS=${svcflags}; export LDFLAGS=${svldflags} |
267 |
export CFLAGS=${svcflags}; export LDFLAGS=${svldflags} |
293 |
|
|
|
294 |
cd "${S}/tests" |
295 |
# -D_POSIX_SOURCE skips the definition of several stuff we need |
296 |
# for these two to compile |
297 |
sed -i -e "s/-D_POSIX_SOURCE//" Makefile |
298 |
emake dristat || die "Building dristat failed." |
299 |
emake drmstat || die "Building drmstat failed." |
300 |
# Move these where the linux stuff expects them |
301 |
mv dristat drmstat ${SRC_BUILD} |
302 |
} |
268 |
} |
303 |
|
269 |
|
304 |
die_error() { |
270 |
die_error() { |
305 |
- |
|
|