Gentoo Archives: gentoo-commits

From: "Bryan Stine (battousai)" <battousai@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-base/x11-drm: ChangeLog x11-drm-20071019.ebuild
Date: Sat, 20 Oct 2007 04:52:17
Message-Id: E1Ij69V-00047J-3T@stork.gentoo.org
1 battousai 07/10/20 04:41:33
2
3 Modified: ChangeLog
4 Added: x11-drm-20071019.ebuild
5 Log:
6 Snapshot bump. Module i830 removed upstream.
7 (Portage version: 2.1.3.15)
8
9 Revision Changes Path
10 1.55 x11-base/x11-drm/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?rev=1.55&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?rev=1.55&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?r1=1.54&r2=1.55
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v
19 retrieving revision 1.54
20 retrieving revision 1.55
21 diff -u -r1.54 -r1.55
22 --- ChangeLog 9 Oct 2007 07:36:00 -0000 1.54
23 +++ ChangeLog 20 Oct 2007 04:41:32 -0000 1.55
24 @@ -1,6 +1,11 @@
25 # ChangeLog for x11-base/x11-drm
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v 1.54 2007/10/09 07:36:00 dberkholz Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v 1.55 2007/10/20 04:41:32 battousai Exp $
29 +
30 +*x11-drm-20071019 (20 Oct 2007)
31 +
32 + 20 Oct 2007; Bryan Stine <battousai@g.o> +x11-drm-20071019.ebuild:
33 + Bump to new snapshot. No more i830 module upstream.
34
35 09 Oct 2007; Donnie Berkholz <dberkholz@g.o>;
36 x11-drm-20051223.ebuild, x11-drm-20060608.ebuild,
37
38
39
40 1.1 x11-base/x11-drm/x11-drm-20071019.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/x11-drm-20071019.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/x11-drm-20071019.ebuild?rev=1.1&content-type=text/plain
44
45 Index: x11-drm-20071019.ebuild
46 ===================================================================
47 # Copyright 1999-2007 Gentoo Foundation
48 # Distributed under the terms of the GNU General Public License v2
49 # $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/x11-drm-20071019.ebuild,v 1.1 2007/10/20 04:41:32 battousai Exp $
50
51 WANT_AUTOCONF="latest"
52 WANT_AUTOMAKE="1.7"
53
54 inherit eutils x11 linux-mod autotools
55
56 IUSE_VIDEO_CARDS="
57 video_cards_i810
58 video_cards_mach64
59 video_cards_mga
60 video_cards_nv
61 video_cards_r128
62 video_cards_radeon
63 video_cards_savage
64 video_cards_sis
65 video_cards_sunffb
66 video_cards_tdfx
67 video_cards_via"
68 IUSE="${IUSE_VIDEO_CARDS} kernel_FreeBSD kernel_linux"
69
70 # Make sure Portage does _NOT_ strip symbols. We will do it later and make sure
71 # that only we only strip stuff that are safe to strip ...
72 RESTRICT="strip"
73
74 S="${WORKDIR}/drm"
75 PATCHVER="0.1"
76 PATCHDIR="${WORKDIR}/patch"
77 EXCLUDED="${WORKDIR}/excluded"
78
79 DESCRIPTION="DRM Kernel Modules for X11"
80 HOMEPAGE="http://dri.sf.net"
81 SRC_URI="mirror://gentoo/${P}-gentoo-${PATCHVER}.tar.bz2
82 mirror://gentoo/linux-drm-${PV}-kernelsource.tar.bz2"
83
84 SLOT="0"
85 LICENSE="X11"
86 KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86 ~x86-fbsd"
87
88 DEPEND="kernel_linux? ( virtual/linux-sources )
89 kernel_FreeBSD? ( sys-freebsd/freebsd-sources
90 sys-freebsd/freebsd-mk-defs )"
91 RDEPEND=""
92
93 pkg_setup() {
94 # Setup the kernel's stuff.
95 kernel_setup
96
97 # Set video cards to build for.
98 set_vidcards
99
100 # Determine which -core dir we build in.
101 get_drm_build_dir
102
103 return 0
104 }
105
106 src_unpack() {
107 unpack linux-drm-${PV}-kernelsource.tar.bz2
108 unpack ${P}-gentoo-${PATCHVER}.tar.bz2
109
110 cd "${S}"
111
112 patch_prepare
113
114 # Apply patches
115 EPATCH_SUFFIX="patch" epatch "${PATCHDIR}"
116
117 # Substitute new directory under /lib/modules/${KV_FULL}
118 cd "${SRC_BUILD}"
119 sed -ie "s:/kernel/drivers/char/drm:/${PN}:g" Makefile
120
121 cp "${S}"/tests/*.c "${SRC_BUILD}"
122
123 src_unpack_os
124
125 cd "${S}"
126 eautoreconf -v --install
127 }
128
129 src_compile() {
130 cd "${S}"
131 # Building the programs. These are useful for developers and getting info from DRI and DRM.
132 #
133 # libdrm objects are needed for drmstat.
134 econf || die "libdrm configure failed."
135 emake || die "libdrm build failed."
136
137 einfo "Building DRM in ${SRC_BUILD}..."
138 src_compile_os
139 einfo "DRM build finished".
140 }
141
142 src_install() {
143 einfo "Installing DRM..."
144 cd "${SRC_BUILD}"
145
146 src_install_os
147
148 dodoc "${S}/linux-core/README.drm"
149
150 dobin dristat
151 dobin drmstat
152 }
153
154 pkg_postinst() {
155 if use video_cards_sis
156 then
157 einfo "SiS direct rendering only works on 300 series chipsets."
158 einfo "SiS framebuffer also needs to be enabled in the kernel."
159 fi
160
161 if use video_cards_mach64
162 then
163 einfo "The Mach64 DRI driver is insecure."
164 einfo "Malicious clients can write to system memory."
165 einfo "For more information, see:"
166 einfo "http://dri.freedesktop.org/wiki/ATIMach64."
167 fi
168
169 pkg_postinst_os
170 }
171
172 # Functions used above are defined below:
173
174 kernel_setup() {
175 if use kernel_FreeBSD
176 then
177 K_RV=${CHOST/*-freebsd/}
178 elif use kernel_linux
179 then
180 linux-mod_pkg_setup
181
182 if kernel_is 2 4
183 then
184 eerror "Upstream support for 2.4 kernels has been removed, so this package will no"
185 eerror "longer support them."
186 die "Please use in-kernel DRM or switch to a 2.6 kernel."
187 fi
188
189 linux_chkconfig_builtin "DRM" && \
190 die "Please disable or modularize DRM in the kernel config. (CONFIG_DRM = n or m)"
191
192 CONFIG_CHECK="AGP"
193 ERROR_AGP="AGP support is not enabled in your kernel config (CONFIG_AGP)"
194 fi
195 }
196
197 set_vidcards() {
198 if use kernel_linux; then
199 set_kvobj
200 I810_VIDCARDS="i810.${KV_OBJ} i915.${KV_OBJ}"
201 elif use kernel_FreeBSD; then
202 KV_OBJ="ko"
203 # bsd does not have i810, only i915:
204 I810_VIDCARDS="i915.${KV_OBJ}"
205 fi
206
207 VIDCARDS=""
208
209 if [[ -n "${VIDEO_CARDS}" ]]; then
210 use video_cards_i810 && \
211 VIDCARDS="${VIDCARDS} ${I810_VIDCARDS}"
212 use video_cards_mach64 && \
213 VIDCARDS="${VIDCARDS} mach64.${KV_OBJ}"
214 use video_cards_mga && \
215 VIDCARDS="${VIDCARDS} mga.${KV_OBJ}"
216 use video_cards_nv && \
217 VIDCARDS="${VIDCARDS} nv.${KV_OBJ} nouveau.${KV_OBJ}"
218 use video_cards_r128 && \
219 VIDCARDS="${VIDCARDS} r128.${KV_OBJ}"
220 use video_cards_radeon && \
221 VIDCARDS="${VIDCARDS} radeon.${KV_OBJ}"
222 use video_cards_savage && \
223 VIDCARDS="${VIDCARDS} savage.${KV_OBJ}"
224 use video_cards_sis && \
225 VIDCARDS="${VIDCARDS} sis.${KV_OBJ}"
226 use video_cards_via && \
227 VIDCARDS="${VIDCARDS} via.${KV_OBJ}"
228 use video_cards_sunffb && \
229 VIDCARDS="${VIDCARDS} ffb.${KV_OBJ}"
230 use video_cards_tdfx && \
231 VIDCARDS="${VIDCARDS} tdfx.${KV_OBJ}"
232 fi
233 }
234
235 get_drm_build_dir() {
236 if use kernel_FreeBSD
237 then
238 SRC_BUILD="${S}/bsd-core"
239 elif kernel_is 2 6
240 then
241 SRC_BUILD="${S}/linux-core"
242 fi
243 }
244
245 patch_prepare() {
246 # Handle exclusions based on the following...
247 # All trees (0**), Standard only (1**), Others (none right now)
248 # 2.4 vs. 2.6 kernels
249 if use kernel_linux
250 then
251 kernel_is 2 6 && mv -f "${PATCHDIR}"/*kernel-2.4* "${EXCLUDED}"
252 fi
253
254 # There is only one tree being maintained now. No numeric exclusions need
255 # to be done based on DRM tree.
256 }
257
258 src_unpack_freebsd() {
259 # Do FreeBSD stuff.
260 if use kernel_FreeBSD
261 then
262 # Link in freebsd kernel.
263 ln -s "/usr/src/sys-${K_RV}" "${WORKDIR}/sys"
264 # SUBDIR variable gets to all Makefiles, we need it only in the main one.
265 SUBDIRS=${VIDCARDS//.ko}
266 sed -ie "s:SUBDIR\ =.*:SUBDIR\ =\ drm ${SUBDIRS}:" "${SRC_BUILD}"/Makefile
267 fi
268 }
269
270 src_unpack_os() {
271 if use kernel_FreeBSD
272 then
273 src_unpack_freebsd
274 fi
275 }
276
277 src_compile_os() {
278 if use kernel_linux
279 then
280 src_compile_linux
281 elif use kernel_FreeBSD
282 then
283 src_compile_freebsd
284 fi
285 }
286
287 src_install_os() {
288 if use kernel_linux
289 then
290 src_install_linux
291 elif use kernel_FreeBSD
292 then
293 src_install_freebsd
294 fi
295 }
296
297 src_compile_linux() {
298 # This now uses an M= build system. Makefile does most of the work.
299 cd "${SRC_BUILD}"
300 unset ARCH
301 emake M="${SRC_BUILD}" \
302 LINUXDIR="${KERNEL_DIR}" \
303 DRM_MODULES="${VIDCARDS}" \
304 modules || die_error
305
306 if linux_chkconfig_present DRM
307 then
308 echo "Please disable in-kernel DRM support to use this package."
309 fi
310
311 # LINUXDIR is needed to allow Makefiles to find kernel release.
312 cd "${SRC_BUILD}"
313 emake LINUXDIR="${KERNEL_DIR}" dristat || die "Building dristat failed."
314 emake LINUXDIR="${KERNEL_DIR}" drmstat || die "Building drmstat failed."
315 }
316
317 src_compile_freebsd() {
318 cd "${SRC_BUILD}"
319 # Environment CFLAGS overwrite kernel CFLAGS which is bad.
320 local svcflags=${CFLAGS}; local svldflags=${LDFLAGS}
321 unset CFLAGS; unset LDFLAGS
322 MAKE=make \
323 emake \
324 NO_WERROR= \
325 SYSDIR="${WORKDIR}/sys" \
326 KMODDIR="/boot/modules" \
327 || die "pmake failed."
328 export CFLAGS=${svcflags}; export LDFLAGS=${svldflags}
329
330 cd "${S}/tests"
331 # -D_POSIX_SOURCE skips the definition of several stuff we need
332 # for these two to compile
333 sed -i -e "s/-D_POSIX_SOURCE//" Makefile
334 emake dristat || die "Building dristat failed."
335 emake drmstat || die "Building drmstat failed."
336 # Move these where the linux stuff expects them
337 mv dristat drmstat "${SRC_BUILD}"
338 }
339
340 die_error() {
341 eerror "Portage could not build the DRM modules. If you see an ACCESS DENIED error,"
342 eerror "this could mean that you were using an unsupported kernel build system."
343 eerror "Only 2.6 kernels at least as new as 2.6.6 are supported."
344 die "Unable to build DRM modules."
345 }
346
347 src_install_linux() {
348 cd "${SRC_BUILD}"
349 unset ARCH
350 kernel_is 2 6 && DRM_KMOD="drm.${KV_OBJ}"
351 emake KV="${KV_FULL}" \
352 LINUXDIR="${KERNEL_DIR}" \
353 DESTDIR="${D}" \
354 RUNNING_REL="${KV_FULL}" \
355 MODULE_LIST="${VIDCARDS} ${DRM_KMOD}" \
356 O="${KBUILD_OUTPUT}" \
357 install || die "Install failed."
358
359 # Strip binaries, leaving /lib/modules untouched (bug #24415)
360 strip_bins \/lib\/modules
361
362 # Yoinked from the sys-apps/touchpad ebuild. Thanks to whoever made this.
363 keepdir /etc/modules.d
364 sed 's:%PN%:'${PN}':g' "${FILESDIR}"/modules.d-${PN} > "${D}"/etc/modules.d/${PN}
365 sed -i 's:%KV%:'${KV_FULL}':g' "${D}"/etc/modules.d/${PN}
366 }
367
368 src_install_freebsd() {
369 cd "${SRC_BUILD}"
370 dodir "/boot/modules"
371 MAKE=make \
372 emake \
373 install \
374 NO_WERROR= \
375 DESTDIR="${D}" \
376 KMODDIR="/boot/modules" \
377 || die "Install failed."
378 }
379
380 pkg_postinst_os() {
381 if use kernel_linux
382 then
383 linux-mod_pkg_postinst
384 fi
385 }
386
387
388
389 --
390 gentoo-commits@g.o mailing list