diff options
author | Matt Turner <mattst88@gentoo.org> | 2016-11-14 11:37:06 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2016-11-14 17:25:09 -0800 |
commit | f85261855b30cf967158691a973f3e59852dbee7 (patch) | |
tree | 7e6d165dad819514c9d281ed101690ca82c1b355 /media-libs/mesa | |
parent | media-libs/mesa: Require libdrm-2.4.72. (diff) | |
download | gentoo-f85261855b30cf967158691a973f3e59852dbee7.tar.gz gentoo-f85261855b30cf967158691a973f3e59852dbee7.tar.bz2 gentoo-f85261855b30cf967158691a973f3e59852dbee7.zip |
media-libs/mesa: Add Vulkan support.
Bug: https://bugs.gentoo.org/580148
Diffstat (limited to 'media-libs/mesa')
-rw-r--r-- | media-libs/mesa/mesa-13.0.1.ebuild | 29 | ||||
-rw-r--r-- | media-libs/mesa/mesa-9999.ebuild | 29 | ||||
-rw-r--r-- | media-libs/mesa/metadata.xml | 1 |
3 files changed, 57 insertions, 2 deletions
diff --git a/media-libs/mesa/mesa-13.0.1.ebuild b/media-libs/mesa/mesa-13.0.1.ebuild index c604a36ef957..664a022e69ba 100644 --- a/media-libs/mesa/mesa-13.0.1.ebuild +++ b/media-libs/mesa/mesa-13.0.1.ebuild @@ -45,7 +45,7 @@ done IUSE="${IUSE_VIDEO_CARDS} bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gcrypt gles1 gles2 libressl +llvm nettle +nptl opencl osmesa pax_kernel openmax +openssl pic - selinux vaapi valgrind vdpau wayland xvmc xa kernel_FreeBSD" + selinux vaapi valgrind vdpau vulkan wayland xvmc xa kernel_FreeBSD" REQUIRED_USE=" || ( gcrypt libressl nettle openssl ) @@ -57,6 +57,7 @@ REQUIRED_USE=" gles2? ( egl ) vaapi? ( gallium ) vdpau? ( gallium ) + vulkan? ( || ( video_cards_i965 video_cards_radeonsi ) ) wayland? ( egl gbm ) xa? ( gallium ) video_cards_freedreno? ( gallium ) @@ -273,6 +274,11 @@ multilib_src_configure() { fi fi + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_radeonsi radeon + fi + # x86 hardened pax_kernel needs glx-rts, bug 240956 if [[ ${ABI} == x86 ]]; then myconf+=" $(use_enable pax_kernel glx-read-only-text)" @@ -311,6 +317,7 @@ multilib_src_configure() { --enable-llvm-shared-libs \ --with-dri-drivers=${DRI_DRIVERS} \ --with-gallium-drivers=${GALLIUM_DRIVERS} \ + --with-vulkan-drivers=${VULKAN_DRIVERS} \ --with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \ PYTHON2="${PYTHON}" \ ${myconf} @@ -383,6 +390,9 @@ multilib_src_install_all() { # Install config file for eselect mesa insinto /usr/share/mesa newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf + + # Mesa should not install these + rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} } multilib_src_test() { @@ -475,3 +485,20 @@ gallium_enable() { ;; esac } + +vulkan_enable() { + case $# in + # for enabling unconditionally + 1) + VULKAN_DRIVERS+=",$1" + ;; + *) + if use $1; then + shift + for i in $@; do + VULKAN_DRIVERS+=",${i}" + done + fi + ;; + esac +} diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index c604a36ef957..664a022e69ba 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -45,7 +45,7 @@ done IUSE="${IUSE_VIDEO_CARDS} bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gcrypt gles1 gles2 libressl +llvm nettle +nptl opencl osmesa pax_kernel openmax +openssl pic - selinux vaapi valgrind vdpau wayland xvmc xa kernel_FreeBSD" + selinux vaapi valgrind vdpau vulkan wayland xvmc xa kernel_FreeBSD" REQUIRED_USE=" || ( gcrypt libressl nettle openssl ) @@ -57,6 +57,7 @@ REQUIRED_USE=" gles2? ( egl ) vaapi? ( gallium ) vdpau? ( gallium ) + vulkan? ( || ( video_cards_i965 video_cards_radeonsi ) ) wayland? ( egl gbm ) xa? ( gallium ) video_cards_freedreno? ( gallium ) @@ -273,6 +274,11 @@ multilib_src_configure() { fi fi + if use vulkan; then + vulkan_enable video_cards_i965 intel + vulkan_enable video_cards_radeonsi radeon + fi + # x86 hardened pax_kernel needs glx-rts, bug 240956 if [[ ${ABI} == x86 ]]; then myconf+=" $(use_enable pax_kernel glx-read-only-text)" @@ -311,6 +317,7 @@ multilib_src_configure() { --enable-llvm-shared-libs \ --with-dri-drivers=${DRI_DRIVERS} \ --with-gallium-drivers=${GALLIUM_DRIVERS} \ + --with-vulkan-drivers=${VULKAN_DRIVERS} \ --with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \ PYTHON2="${PYTHON}" \ ${myconf} @@ -383,6 +390,9 @@ multilib_src_install_all() { # Install config file for eselect mesa insinto /usr/share/mesa newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf + + # Mesa should not install these + rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} } multilib_src_test() { @@ -475,3 +485,20 @@ gallium_enable() { ;; esac } + +vulkan_enable() { + case $# in + # for enabling unconditionally + 1) + VULKAN_DRIVERS+=",$1" + ;; + *) + if use $1; then + shift + for i in $@; do + VULKAN_DRIVERS+=",${i}" + done + fi + ;; + esac +} diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml index ab07f8bae6e3..043aec22078c 100644 --- a/media-libs/mesa/metadata.xml +++ b/media-libs/mesa/metadata.xml @@ -28,6 +28,7 @@ <flag name="pic">disable optimized assembly code that is not PIC friendly</flag> <flag name="valgrind">Compile in valgrind memory hints</flag> <flag name="vdpau">Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag> + <flag name="vulkan">Enable Vulkan drivers</flag> <flag name="wayland">Enable support for dev-libs/wayland</flag> <flag name="xa">Enable the XA (X Acceleration) API for Gallium3D.</flag> <flag name="xvmc">Enable the XvMC acceleration interface for the Gallium3D Video Layer.</flag> |