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-20090805.ebuild
Date: Thu, 06 Aug 2009 05:32:35
Message-Id: E1MYvab-00068p-Vt@stork.gentoo.org
1 battousai 09/08/06 05:32:33
2
3 Modified: ChangeLog
4 Added: x11-drm-20090805.ebuild
5 Log:
6 Version bump to 20090805.
7 (Portage version: 2.2_rc36/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.82 x11-base/x11-drm/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?rev=1.82&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?rev=1.82&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/ChangeLog?r1=1.81&r2=1.82
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v
19 retrieving revision 1.81
20 retrieving revision 1.82
21 diff -u -r1.81 -r1.82
22 --- ChangeLog 28 Jul 2009 14:20:20 -0000 1.81
23 +++ ChangeLog 6 Aug 2009 05:32:33 -0000 1.82
24 @@ -1,6 +1,11 @@
25 # ChangeLog for x11-base/x11-drm
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v 1.81 2009/07/28 14:20:20 scarabeus Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/x11-base/x11-drm/ChangeLog,v 1.82 2009/08/06 05:32:33 battousai Exp $
29 +
30 +*x11-drm-20090805 (05 Aug 2009)
31 +
32 + 05 Aug 2009; Bryan Stine <battousai@g.o> +x11-drm-20090805.ebuild:
33 + Version bump to 20090805.
34
35 28 Jul 2009; Tomáš Chvátal <scarabeus@g.o> metadata.xml:
36 This package moves under x11 jurisdiction. x11-drivers are going to be
37
38
39
40 1.1 x11-base/x11-drm/x11-drm-20090805.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/x11-drm-20090805.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-base/x11-drm/x11-drm-20090805.ebuild?rev=1.1&content-type=text/plain
44
45 Index: x11-drm-20090805.ebuild
46 ===================================================================
47 # Copyright 1999-2009 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-20090805.ebuild,v 1.1 2009/08/06 05:32:33 battousai Exp $
50
51 inherit eutils x11 linux-mod autotools
52
53 IUSE_VIDEO_CARDS="
54 video_cards_mach64
55 video_cards_mga
56 video_cards_r128
57 video_cards_radeon
58 video_cards_radeonhd
59 video_cards_savage
60 video_cards_sis
61 video_cards_sunffb
62 video_cards_tdfx
63 video_cards_via
64 video_cards_xgi"
65 IUSE="${IUSE_VIDEO_CARDS} kernel_FreeBSD kernel_linux"
66
67 # Make sure Portage does _NOT_ strip symbols. We will do it later and make sure
68 # that only we only strip stuff that are safe to strip ...
69 # Tests require user intervention (see bug #236845)
70 RESTRICT="strip test"
71
72 S="${WORKDIR}/drm"
73 PATCHVER="0.1"
74 PATCHDIR="${WORKDIR}/patch"
75 EXCLUDED="${WORKDIR}/excluded"
76
77 DESCRIPTION="DRM Kernel Modules for X11"
78 HOMEPAGE="http://dri.sf.net"
79 SRC_URI="mirror://gentoo/linux-drm-${PV}-kernelsource.tar.bz2"
80 if [ -n "${PATCHVER}" ] ; then
81 SRC_URI="${SRC_URI} mirror://gentoo/${P}-gentoo-${PATCHVER}.tar.bz2"
82 fi
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 >=x11-libs/libdrm-2.4.3"
92 RDEPEND=""
93
94 pkg_setup() {
95 ewarn "The intel DRM module has been removed from x11-drm. Please use the in-kernel"
96 ewarn "DRM module. This package is no longer useful for intel video cards."
97
98 # Setup the kernel's stuff.
99 kernel_setup
100
101 # Set video cards to build for.
102 set_vidcards
103
104 # Determine which -core dir we build in.
105 get_drm_build_dir
106
107 return 0
108 }
109
110 src_unpack() {
111 unpack linux-drm-${PV}-kernelsource.tar.bz2
112 cd "${WORKDIR}"
113
114 # Apply patches if there's a patchball version number provided.
115 if [ -n "${PATCHVER}" ]
116 then
117 unpack ${P}-gentoo-${PATCHVER}.tar.bz2
118 cd "${S}"
119
120 # Apply patches
121 EPATCH_SUFFIX="patch" epatch ${PATCHDIR}
122 fi
123 eautoreconf -v --install
124
125 src_unpack_os
126 }
127
128 src_compile() {
129 einfo "Building DRM in ${SRC_BUILD}..."
130 src_compile_os
131 einfo "DRM build finished".
132
133 cd "${S}"
134
135 # I need to work on my autoconf skills to make reliable user-selection
136 # of cairo support here.
137 econf --without-cairo || die "econf failed"
138
139 cd "${S}"/tests
140 emake || die "Failed to build programs."
141 }
142
143 src_install() {
144 einfo "Installing DRM..."
145 cd "${SRC_BUILD}"
146
147 src_install_os
148
149 cd "${S}"/tests
150 dobin dristat drmstat modeprint/modeprint modetest/modetest || die
151
152 dodoc "${S}/linux-core/README.drm"
153 }
154
155 pkg_postinst() {
156 if use video_cards_sis
157 then
158 einfo "SiS direct rendering only works on 300 series chipsets."
159 einfo "SiS framebuffer also needs to be enabled in the kernel."
160 fi
161
162 if use video_cards_mach64
163 then
164 einfo "The Mach64 DRI driver is insecure."
165 einfo "Malicious clients can write to system memory."
166 einfo "For more information, see:"
167 einfo "http://dri.freedesktop.org/wiki/ATIMach64."
168 fi
169
170 pkg_postinst_os
171 }
172
173 # Functions used above are defined below:
174
175 kernel_setup() {
176 if use kernel_FreeBSD
177 then
178 K_RV=${CHOST/*-freebsd/}
179 elif use kernel_linux
180 then
181 if kernel_is 2 4
182 then
183 eerror "Upstream support for 2.4 kernels has been removed, so this package will no"
184 eerror "longer support them."
185 die "Please use in-kernel DRM or switch to a 2.6 kernel."
186 fi
187
188 CONFIG_CHECK="!DRM"
189 ERROR_DRM="Please disable DRM in the kernel config. (CONFIG_DRM = n)"
190
191 linux-mod_pkg_setup
192 fi
193 }
194
195 set_vidcards() {
196 VIDCARDS=""
197
198 if [[ -n "${VIDEO_CARDS}" ]]; then
199 use video_cards_mach64 && \
200 VIDCARDS="${VIDCARDS} mach64.${KV_OBJ}"
201 use video_cards_mga && \
202 VIDCARDS="${VIDCARDS} mga.${KV_OBJ}"
203 use video_cards_r128 && \
204 VIDCARDS="${VIDCARDS} r128.${KV_OBJ}"
205 use video_cards_radeon || use video_cards_radeonhd && \
206 VIDCARDS="${VIDCARDS} radeon.${KV_OBJ}"
207 use video_cards_savage && \
208 VIDCARDS="${VIDCARDS} savage.${KV_OBJ}"
209 use video_cards_sis && \
210 VIDCARDS="${VIDCARDS} sis.${KV_OBJ}"
211 use video_cards_via && \
212 VIDCARDS="${VIDCARDS} via.${KV_OBJ}"
213 use video_cards_sunffb && \
214 VIDCARDS="${VIDCARDS} ffb.${KV_OBJ}"
215 use video_cards_tdfx && \
216 VIDCARDS="${VIDCARDS} tdfx.${KV_OBJ}"
217 use video_cards_xgi && \
218 VIDCARDS="${VIDCARDS} xgi.${KV_OBJ}"
219 fi
220 }
221
222 get_drm_build_dir() {
223 if use kernel_FreeBSD
224 then
225 SRC_BUILD="${S}/bsd-core"
226 elif kernel_is 2 6
227 then
228 SRC_BUILD="${S}/linux-core"
229 fi
230 }
231
232 src_unpack_linux() {
233 convert_to_m "${SRC_BUILD}"/Makefile
234 }
235
236 src_unpack_freebsd() {
237 # Link in freebsd kernel.
238 ln -s "/usr/src/sys-${K_RV}" "${WORKDIR}/sys"
239 # SUBDIR variable gets to all Makefiles, we need it only in the main one.
240 SUBDIRS=${VIDCARDS//.ko}
241 sed -i -e "s:SUBDIR\ =.*:SUBDIR\ =\ drm ${SUBDIRS}:" "${SRC_BUILD}"/Makefile
242 }
243
244 src_unpack_os() {
245 if use kernel_linux; then
246 src_unpack_linux
247 elif use kernel_FreeBSD
248 then
249 src_unpack_freebsd
250 fi
251 }
252
253 src_compile_os() {
254 if use kernel_linux
255 then
256 src_compile_linux
257 elif use kernel_FreeBSD
258 then
259 src_compile_freebsd
260 fi
261 }
262
263 src_install_os() {
264 if use kernel_linux
265 then
266 src_install_linux
267 elif use kernel_FreeBSD
268 then
269 src_install_freebsd
270 fi
271 }
272
273 src_compile_linux() {
274 # remove leading and trailing space
275 VIDCARDS="${VIDCARDS% }"
276 VIDCARDS="${VIDCARDS# }"
277
278 check_modules_supported
279 MODULE_NAMES=""
280 for i in drm.${KV_OBJ} ${VIDCARDS}; do
281 MODULE_NAMES="${MODULE_NAMES} ${i/.${KV_OBJ}}(${PN}:${SRC_BUILD})"
282 i=$(echo ${i/.${KV_OBJ}} | tr '[:lower:]' '[:upper:]')
283 eval MODULESD_${i}_ENABLED="yes"
284 done
285
286 # This now uses an M= build system. Makefile does most of the work.
287 cd "${SRC_BUILD}"
288 unset ARCH
289 BUILD_TARGETS="modules"
290 BUILD_PARAMS="DRM_MODULES='${VIDCARDS}' LINUXDIR='${KERNEL_DIR}' M='${SRC_BUILD}'"
291 ECONF_PARAMS='' S="${SRC_BUILD}" linux-mod_src_compile
292 }
293
294 src_compile_freebsd() {
295 cd "${SRC_BUILD}"
296 # Environment CFLAGS overwrite kernel CFLAGS which is bad.
297 local svcflags=${CFLAGS}; local svldflags=${LDFLAGS}
298 unset CFLAGS; unset LDFLAGS
299 MAKE=make \
300 emake \
301 NO_WERROR= \
302 SYSDIR="${WORKDIR}/sys" \
303 KMODDIR="/boot/modules" \
304 || die "pmake failed."
305 export CFLAGS=${svcflags}; export LDFLAGS=${svldflags}
306 }
307
308 die_error() {
309 eerror "Portage could not build the DRM modules. If you see an ACCESS DENIED error,"
310 eerror "this could mean that you were using an unsupported kernel build system."
311 eerror "Only 2.6 kernels at least as new as 2.6.6 are supported."
312 die "Unable to build DRM modules."
313 }
314
315 src_install_linux() {
316 linux-mod_src_install
317
318 # Strip binaries, leaving /lib/modules untouched (bug #24415)
319 strip_bins \/lib\/modules
320 }
321
322 src_install_freebsd() {
323 cd "${SRC_BUILD}"
324 dodir "/boot/modules"
325 MAKE=make \
326 emake \
327 install \
328 NO_WERROR= \
329 DESTDIR="${D}" \
330 KMODDIR="/boot/modules" \
331 || die "Install failed."
332 }
333
334 pkg_postinst_os() {
335 if use kernel_linux
336 then
337 linux-mod_pkg_postinst
338 fi
339 }