--- /mnt/usr/portage/media-libs/mesa/mesa-11.0.9.ebuild 2016-03-11 05:10:23.000000000 +1300 +++ src/gentoo-wayland-only/media-libs/mesa/mesa-11.0.9.ebuild 2016-04-05 15:15:06.573477208 +1200 @@ -45,9 +45,10 @@ IUSE="${IUSE_VIDEO_CARDS} bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm +nptl opencl osmesa pax_kernel openmax pic selinux +udev vaapi vdpau - wayland xvmc xa kernel_FreeBSD" + wayland +X xvmc xa kernel_FreeBSD" REQUIRED_USE=" + dri3? ( X ) d3d9? ( dri3 gallium ) llvm? ( gallium ) opencl? ( gallium llvm ) @@ -57,7 +58,8 @@ vaapi? ( gallium ) vdpau? ( gallium ) wayland? ( egl gbm ) - xa? ( gallium ) + xvmc? ( X ) + xa? ( X gallium ) video_cards_freedreno? ( gallium ) video_cards_intel? ( classic ) video_cards_i915? ( || ( classic gallium ) ) @@ -79,21 +81,23 @@ # keep correct libdrm and dri2proto dep # keep blocks in rdepend for binpkg RDEPEND=" - !=app-eselect/eselect-opengl-1.3.0 udev? ( kernel_linux? ( >=virtual/libudev-215:=[${MULTILIB_USEDEP}] ) ) >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}] - >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] - >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] - >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] - >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] - >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] - >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}] - x11-libs/libXfixes:=[${MULTILIB_USEDEP}] + X? ( + !=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}] + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}] + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}] + >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}] + x11-libs/libXfixes:=[${MULTILIB_USEDEP}] + ) llvm? ( !kernel_FreeBSD? ( video_cards_radeonsi? ( || ( >=dev-libs/elfutils-0.155-r1:=[${MULTILIB_USEDEP}] @@ -155,9 +159,11 @@ >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}] ) >=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}] - >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}] - >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}] - >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}] + X? ( + >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}] + >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}] + >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}] + ) " [[ ${PV} == 9999 ]] && DEPEND+=" sys-devel/bison @@ -222,7 +228,7 @@ fi if use egl; then - myconf+=" --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")" + myconf+=" --with-egl-platforms=$(use X && echo "x11")$(use wayland && echo ",wayland")$(use gbm && echo ",drm")" fi if use gallium; then @@ -281,8 +287,12 @@ ECONF_SOURCE="${S}" \ econf \ --enable-dri \ - --enable-glx \ - --enable-shared-glapi \ + $(if use X; then + echo "--enable-glx --enable-shared-glapi" + else + echo "--disable-glx" + fi + ) \ $(use_enable !bindist texture-float) \ $(use_enable d3d9 nine) \ $(use_enable debug) \ @@ -304,6 +314,10 @@ multilib_src_install() { emake install DESTDIR="${D}" + if ! use X; then + sed -i '/#if defined(MESA_EGL_NO_X11_HEADERS)/i#define MESA_EGL_NO_X11_HEADERS' "${ED}/usr/include/EGL/eglplatform.h" + fi + if use classic || use gallium; then ebegin "Moving DRI/Gallium drivers for dynamic switching" local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )