Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:uclibc commit in: media-libs/mesa/
Date: Mon, 30 Sep 2013 00:54:16
Message-Id: 1380502495.e50e1c5d333669f298afe5527840e8af590b5ae8.blueness@gentoo
1 commit: e50e1c5d333669f298afe5527840e8af590b5ae8
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 30 00:54:55 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 30 00:54:55 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=e50e1c5d
7
8 media-libs/mesa: version bump
9
10 ---
11 media-libs/mesa/mesa-9.1.6-r99.ebuild | 421 ++++++++++++++++++++++++++++++++++
12 1 file changed, 421 insertions(+)
13
14 diff --git a/media-libs/mesa/mesa-9.1.6-r99.ebuild b/media-libs/mesa/mesa-9.1.6-r99.ebuild
15 new file mode 100644
16 index 0000000..55042bd
17 --- /dev/null
18 +++ b/media-libs/mesa/mesa-9.1.6-r99.ebuild
19 @@ -0,0 +1,421 @@
20 +# Copyright 1999-2013 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-9.1.6.ebuild,v 1.2 2013/09/29 11:07:40 ago Exp $
23 +
24 +EAPI=5
25 +
26 +EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
27 +
28 +if [[ ${PV} = 9999* ]]; then
29 + GIT_ECLASS="git-2"
30 + EXPERIMENTAL="true"
31 +fi
32 +
33 +PYTHON_COMPAT=( python{2_6,2_7} )
34 +
35 +inherit base autotools multilib flag-o-matic python-single-r1 toolchain-funcs ${GIT_ECLASS}
36 +
37 +OPENGL_DIR="xorg-x11"
38 +
39 +MY_PN="${PN/m/M}"
40 +MY_P="${MY_PN}-${PV/_rc/-rc}"
41 +MY_SRC_P="${MY_PN}Lib-${PV/_rc/-rc}"
42 +
43 +FOLDER="${PV/_rc*/}"
44 +
45 +DESCRIPTION="OpenGL-like graphic library for Linux"
46 +HOMEPAGE="http://mesa3d.sourceforge.net/"
47 +
48 +#SRC_PATCHES="mirror://gentoo/${PN}-9.1-gentoo-patches-05.tar.bz2"
49 +if [[ $PV = 9999* ]]; then
50 + SRC_URI="${SRC_PATCHES}"
51 +else
52 + SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
53 + ${SRC_PATCHES}"
54 +fi
55 +
56 +# The code is MIT/X11.
57 +# GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
58 +LICENSE="MIT SGI-B-2.0"
59 +SLOT="0"
60 +KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
61 +
62 +INTEL_CARDS="i915 i965 intel"
63 +RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
64 +VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} nouveau vmware"
65 +for card in ${VIDEO_CARDS}; do
66 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
67 +done
68 +
69 +IUSE="${IUSE_VIDEO_CARDS}
70 + bindist +classic debug +egl +gallium gbm gles1 gles2 +llvm +nptl
71 + openvg osmesa pax_kernel pic r600-llvm-compiler selinux +shared-glapi vdpau
72 + wayland xvmc xa xorg kernel_FreeBSD"
73 +
74 +REQUIRED_USE="
75 + llvm? ( gallium )
76 + openvg? ( egl gallium )
77 + gbm? ( shared-glapi )
78 + gles1? ( egl )
79 + gles2? ( egl )
80 + r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeon ) )
81 + wayland? ( egl )
82 + xa? ( gallium )
83 + xorg? ( gallium )
84 + video_cards_intel? ( || ( classic gallium ) )
85 + video_cards_i915? ( || ( classic gallium ) )
86 + video_cards_i965? ( classic )
87 + video_cards_nouveau? ( || ( classic gallium ) )
88 + video_cards_radeon? ( || ( classic gallium ) )
89 + video_cards_r100? ( classic )
90 + video_cards_r200? ( classic )
91 + video_cards_r300? ( gallium )
92 + video_cards_r600? ( gallium )
93 + video_cards_radeonsi? ( gallium llvm )
94 + video_cards_vmware? ( gallium )
95 +"
96 +
97 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.42"
98 +# keep correct libdrm and dri2proto dep
99 +# keep blocks in rdepend for binpkg
100 +RDEPEND="
101 + !<x11-base/xorg-server-1.7
102 + !<=x11-proto/xf86driproto-2.0.3
103 + classic? ( app-admin/eselect-mesa )
104 + gallium? ( app-admin/eselect-mesa )
105 + >=app-admin/eselect-opengl-1.2.7
106 + dev-libs/expat
107 + gbm? ( virtual/udev )
108 + >=x11-libs/libX11-1.3.99.901
109 + x11-libs/libXdamage
110 + x11-libs/libXext
111 + x11-libs/libXxf86vm
112 + >=x11-libs/libxcb-1.8.1
113 + vdpau? ( >=x11-libs/libvdpau-0.4.1 )
114 + wayland? ( >=dev-libs/wayland-1.0.3 )
115 + xorg? (
116 + x11-base/xorg-server:=[-minimal]
117 + x11-libs/libdrm[libkms]
118 + )
119 + xvmc? ( >=x11-libs/libXvMC-1.0.6 )
120 + ${LIBDRM_DEPSTRING}[video_cards_nouveau?,video_cards_vmware?]
121 +"
122 +for card in ${INTEL_CARDS}; do
123 + RDEPEND="${RDEPEND}
124 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
125 + "
126 +done
127 +
128 +for card in ${RADEON_CARDS}; do
129 + RDEPEND="${RDEPEND}
130 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
131 + "
132 +done
133 +
134 +DEPEND="${RDEPEND}
135 + llvm? (
136 + >=sys-devel/llvm-2.9
137 + r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
138 + video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
139 + )
140 + ${PYTHON_DEPS}
141 + dev-libs/libxml2[python,${PYTHON_USEDEP}]
142 + sys-devel/bison
143 + sys-devel/flex
144 + virtual/pkgconfig
145 + >=x11-proto/dri2proto-2.6
146 + >=x11-proto/glproto-1.4.15-r1
147 + >=x11-proto/xextproto-7.0.99.1
148 + x11-proto/xf86driproto
149 + x11-proto/xf86vidmodeproto
150 +"
151 +
152 +S="${WORKDIR}/${MY_P}"
153 +
154 +# It is slow without texrels, if someone wants slow
155 +# mesa without texrels +pic use is worth the shot
156 +QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
157 +QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
158 +
159 +# Think about: ggi, fbcon, no-X configs
160 +
161 +pkg_setup() {
162 + # workaround toc-issue wrt #386545
163 + use ppc64 && append-flags -mminimal-toc
164 +
165 + python-single-r1_pkg_setup
166 +}
167 +
168 +src_unpack() {
169 + default
170 + [[ $PV = 9999* ]] && git-2_src_unpack
171 +}
172 +
173 +src_prepare() {
174 + # apply patches
175 + if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
176 + EPATCH_FORCE="yes" \
177 + EPATCH_SOURCE="${WORKDIR}/patches" \
178 + EPATCH_SUFFIX="patch" \
179 + epatch
180 + fi
181 +
182 + # relax the requirement that r300 must have llvm, bug 380303
183 + epatch "${FILESDIR}"/${PN}-8.1-dont-require-llvm-for-r300.patch
184 +
185 + # fix for hardened pax_kernel, bug 240956
186 + [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
187 +
188 + epatch "${FILESDIR}"/${PN}-9.0.1-remove-debug_symbol_name_glibc.patch
189 +
190 + # Solaris needs some recent POSIX stuff in our case
191 + if [[ ${CHOST} == *-solaris* ]] ; then
192 + sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
193 + fi
194 +
195 + # Tests fail against python-3, bug #407887
196 + sed -i 's|/usr/bin/env python|/usr/bin/env python2|' src/glsl/tests/compare_ir || die
197 +
198 + base_src_prepare
199 +
200 + eautoreconf
201 +}
202 +
203 +src_configure() {
204 + local myconf
205 +
206 + if use classic; then
207 + # Configurable DRI drivers
208 + driver_enable swrast
209 +
210 + # Intel code
211 + driver_enable video_cards_i915 i915
212 + driver_enable video_cards_i965 i965
213 + if ! use video_cards_i915 && \
214 + ! use video_cards_i965; then
215 + driver_enable video_cards_intel i915 i965
216 + fi
217 +
218 + # Nouveau code
219 + driver_enable video_cards_nouveau nouveau
220 +
221 + # ATI code
222 + driver_enable video_cards_r100 radeon
223 + driver_enable video_cards_r200 r200
224 + if ! use video_cards_r100 && \
225 + ! use video_cards_r200; then
226 + driver_enable video_cards_radeon radeon r200
227 + fi
228 + fi
229 +
230 + if use egl; then
231 + myconf+="
232 + --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")
233 + $(use_enable gallium gallium-egl)
234 + "
235 + fi
236 +
237 + if use gallium; then
238 + myconf+="
239 + $(use_enable llvm gallium-llvm)
240 + $(use_enable openvg)
241 + $(use_enable r600-llvm-compiler)
242 + $(use_enable vdpau)
243 + $(use_enable xvmc)
244 + "
245 + gallium_enable swrast
246 + gallium_enable video_cards_vmware svga
247 + gallium_enable video_cards_nouveau nouveau
248 + gallium_enable video_cards_i915 i915
249 + if ! use video_cards_i915; then
250 + gallium_enable video_cards_intel i915
251 + fi
252 +
253 + gallium_enable video_cards_r300 r300
254 + gallium_enable video_cards_r600 r600
255 + gallium_enable video_cards_radeonsi radeonsi
256 + if ! use video_cards_r300 && \
257 + ! use video_cards_r600; then
258 + gallium_enable video_cards_radeon r300 r600
259 + fi
260 + fi
261 +
262 + # x86 hardened pax_kernel needs glx-rts, bug 240956
263 + if use pax_kernel; then
264 + myconf+="
265 + $(use_enable x86 glx-rts)
266 + "
267 + fi
268 +
269 + # build fails with BSD indent, bug #428112
270 + use userland_GNU || export INDENT=cat
271 +
272 + econf \
273 + --enable-dri \
274 + --enable-glx \
275 + $(use_enable !bindist texture-float) \
276 + $(use_enable debug) \
277 + $(use_enable egl) \
278 + $(use_enable gbm) \
279 + $(use_enable gles1) \
280 + $(use_enable gles2) \
281 + $(use_enable nptl glx-tls) \
282 + $(use_enable osmesa) \
283 + $(use_enable !pic asm) \
284 + $(use_enable shared-glapi) \
285 + $(use_enable xa) \
286 + $(use_enable xorg) \
287 + --with-dri-drivers=${DRI_DRIVERS} \
288 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
289 + PYTHON2="${PYTHON}" \
290 + ${myconf}
291 +}
292 +
293 +src_install() {
294 + base_src_install
295 +
296 + find "${ED}" -name '*.la' -exec rm -f {} + || die
297 +
298 + if use !bindist; then
299 + dodoc docs/patents.txt
300 + fi
301 +
302 + # Install config file for eselect mesa
303 + insinto /usr/share/mesa
304 + newins "${FILESDIR}/eselect-mesa.conf.8.1" eselect-mesa.conf
305 +
306 + # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
307 + # because user can eselect desired GL provider.
308 + ebegin "Moving libGL and friends for dynamic switching"
309 + local x
310 + local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
311 + dodir ${gl_dir}/{lib,extensions,include/GL}
312 + for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
313 + if [ -f ${x} -o -L ${x} ]; then
314 + mv -f "${x}" "${ED}${gl_dir}"/lib \
315 + || die "Failed to move ${x}"
316 + fi
317 + done
318 + for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
319 + if [ -f ${x} -o -L ${x} ]; then
320 + mv -f "${x}" "${ED}${gl_dir}"/include/GL \
321 + || die "Failed to move ${x}"
322 + fi
323 + done
324 + for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
325 + if [ -d ${x} ]; then
326 + mv -f "${x}" "${ED}${gl_dir}"/include \
327 + || die "Failed to move ${x}"
328 + fi
329 + done
330 + eend $?
331 +
332 + if use classic || use gallium; then
333 + ebegin "Moving DRI/Gallium drivers for dynamic switching"
334 + local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
335 + keepdir /usr/$(get_libdir)/dri
336 + dodir /usr/$(get_libdir)/mesa
337 + for x in ${gallium_drivers[@]}; do
338 + if [ -f "${S}/$(get_libdir)/gallium/${x}" ]; then
339 + mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
340 + || die "Failed to move ${x}"
341 + insinto "/usr/$(get_libdir)/dri/"
342 + if [ -f "${S}/$(get_libdir)/${x}" ]; then
343 + insopts -m0755
344 + doins "${S}/$(get_libdir)/${x}"
345 + fi
346 + fi
347 + done
348 + for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
349 + if [ -f ${x} -o -L ${x} ]; then
350 + mv -f "${x}" "${x/dri/mesa}" \
351 + || die "Failed to move ${x}"
352 + fi
353 + done
354 + pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
355 + ln -s ../mesa/*.so . || die "Creating symlink failed"
356 + # remove symlinks to drivers known to eselect
357 + for x in ${gallium_drivers[@]}; do
358 + if [ -f ${x} -o -L ${x} ]; then
359 + rm "${x}" || die "Failed to remove ${x}"
360 + fi
361 + done
362 + popd
363 + eend $?
364 + fi
365 +}
366 +
367 +pkg_postinst() {
368 + # Switch to the xorg implementation.
369 + echo
370 + eselect opengl set --use-old ${OPENGL_DIR}
371 +
372 + # switch to xorg-x11 and back if necessary, bug #374647 comment 11
373 + OLD_IMPLEM="$(eselect opengl show)"
374 + if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
375 + eselect opengl set ${OPENGL_DIR}
376 + eselect opengl set ${OLD_IMPLEM}
377 + fi
378 +
379 + # Select classic/gallium drivers
380 + if use classic || use gallium; then
381 + eselect mesa set --auto
382 + fi
383 +
384 + # warn about patent encumbered texture-float
385 + if use !bindist; then
386 + elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
387 + elog "enabled. Please see patents.txt for an explanation."
388 + fi
389 +
390 + local using_radeon r_flag
391 + for r_flag in ${RADEON_CARDS}; do
392 + if use video_cards_${r_flag}; then
393 + using_radeon=1
394 + break
395 + fi
396 + done
397 +
398 + if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
399 + elog "Note that in order to have full S3TC support, it is necessary to install"
400 + elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
401 + elog "textures in some apps, and some others even require this to run."
402 + fi
403 +}
404 +
405 +# $1 - VIDEO_CARDS flag
406 +# other args - names of DRI drivers to enable
407 +# TODO: avoid code duplication for a more elegant implementation
408 +driver_enable() {
409 + case $# in
410 + # for enabling unconditionally
411 + 1)
412 + DRI_DRIVERS+=",$1"
413 + ;;
414 + *)
415 + if use $1; then
416 + shift
417 + for i in $@; do
418 + DRI_DRIVERS+=",${i}"
419 + done
420 + fi
421 + ;;
422 + esac
423 +}
424 +
425 +gallium_enable() {
426 + case $# in
427 + # for enabling unconditionally
428 + 1)
429 + GALLIUM_DRIVERS+=",$1"
430 + ;;
431 + *)
432 + if use $1; then
433 + shift
434 + for i in $@; do
435 + GALLIUM_DRIVERS+=",${i}"
436 + done
437 + fi
438 + ;;
439 + esac
440 +}