Lines 333-364
multilib_src_configure() {
Link Here
|
333 |
multilib_src_install() { |
333 |
multilib_src_install() { |
334 |
emake install DESTDIR="${D}" |
334 |
emake install DESTDIR="${D}" |
335 |
|
335 |
|
336 |
# Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib |
|
|
337 |
# because user can eselect desired GL provider. |
338 |
ebegin "Moving libGL and friends for dynamic switching" |
339 |
local x |
340 |
local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/" |
341 |
dodir ${gl_dir}/{lib,extensions,include/GL} |
342 |
for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do |
343 |
if [ -f ${x} -o -L ${x} ]; then |
344 |
mv -f "${x}" "${ED}${gl_dir}"/lib \ |
345 |
|| die "Failed to move ${x}" |
346 |
fi |
347 |
done |
348 |
for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do |
349 |
if [ -f ${x} -o -L ${x} ]; then |
350 |
mv -f "${x}" "${ED}${gl_dir}"/include/GL \ |
351 |
|| die "Failed to move ${x}" |
352 |
fi |
353 |
done |
354 |
for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do |
355 |
if [ -d ${x} ]; then |
356 |
mv -f "${x}" "${ED}${gl_dir}"/include \ |
357 |
|| die "Failed to move ${x}" |
358 |
fi |
359 |
done |
360 |
eend $? |
361 |
|
362 |
if use classic || use gallium; then |
336 |
if use classic || use gallium; then |
363 |
ebegin "Moving DRI/Gallium drivers for dynamic switching" |
337 |
ebegin "Moving DRI/Gallium drivers for dynamic switching" |
364 |
local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so ) |
338 |
local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so ) |
Lines 390-409
multilib_src_install() {
Link Here
|
390 |
popd |
364 |
popd |
391 |
eend $? |
365 |
eend $? |
392 |
fi |
366 |
fi |
393 |
if use opencl; then |
|
|
394 |
ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching" |
395 |
local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa" |
396 |
dodir ${cl_dir}/{lib,include} |
397 |
if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then |
398 |
mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \ |
399 |
"${ED}"${cl_dir} |
400 |
fi |
401 |
if [ -f "${ED}/usr/include/CL/opencl.h" ]; then |
402 |
mv -f "${ED}"/usr/include/CL \ |
403 |
"${ED}"${cl_dir}/include |
404 |
fi |
405 |
eend $? |
406 |
fi |
407 |
|
367 |
|
408 |
if use openmax; then |
368 |
if use openmax; then |
409 |
echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx" |
369 |
echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx" |
Lines 437-463
multilib_src_test() {
Link Here
|
437 |
} |
397 |
} |
438 |
|
398 |
|
439 |
pkg_postinst() { |
399 |
pkg_postinst() { |
440 |
# Switch to the xorg implementation. |
|
|
441 |
echo |
442 |
eselect opengl set --use-old ${OPENGL_DIR} |
443 |
|
444 |
# switch to xorg-x11 and back if necessary, bug #374647 comment 11 |
445 |
OLD_IMPLEM="$(eselect opengl show)" |
446 |
if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then |
447 |
eselect opengl set ${OPENGL_DIR} |
448 |
eselect opengl set ${OLD_IMPLEM} |
449 |
fi |
450 |
|
451 |
# Select classic/gallium drivers |
400 |
# Select classic/gallium drivers |
452 |
if use classic || use gallium; then |
401 |
if use classic || use gallium; then |
453 |
eselect mesa set --auto |
402 |
eselect mesa set --auto |
454 |
fi |
403 |
fi |
455 |
|
404 |
|
456 |
# Switch to mesa opencl |
|
|
457 |
if use opencl; then |
458 |
eselect opencl set --use-old ${PN} |
459 |
fi |
460 |
|
461 |
# run omxregister-bellagio to make the OpenMAX drivers known system-wide |
405 |
# run omxregister-bellagio to make the OpenMAX drivers known system-wide |
462 |
if use openmax; then |
406 |
if use openmax; then |
463 |
ebegin "Registering OpenMAX drivers" |
407 |
ebegin "Registering OpenMAX drivers" |