diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-09-28 15:16:23 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-09-28 15:16:23 +0200 |
commit | 135bd0f4429ba1508b7bbf47ffabfc6f3de238ee (patch) | |
tree | 7c4c3d06893d2698214e1390366eb5dfcc838a1f /media-libs/mesa | |
parent | media-libs/mesa: Use correct slotted LLVM deps (diff) | |
download | gentoo-135bd0f4429ba1508b7bbf47ffabfc6f3de238ee.tar.gz gentoo-135bd0f4429ba1508b7bbf47ffabfc6f3de238ee.tar.bz2 gentoo-135bd0f4429ba1508b7bbf47ffabfc6f3de238ee.zip |
media-libs/mesa: Backport LLVM dep fixes to 17.2.1
Diffstat (limited to 'media-libs/mesa')
-rw-r--r-- | media-libs/mesa/mesa-17.2.1.ebuild | 103 |
1 files changed, 89 insertions, 14 deletions
diff --git a/media-libs/mesa/mesa-17.2.1.ebuild b/media-libs/mesa/mesa-17.2.1.ebuild index f54779f95727..2b6f32728db3 100644 --- a/media-libs/mesa/mesa-17.2.1.ebuild +++ b/media-libs/mesa/mesa-17.2.1.ebuild @@ -97,7 +97,6 @@ RDEPEND=" llvm? ( video_cards_radeonsi? ( virtual/libelf:0=[${MULTILIB_USEDEP}] - vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] ) ) video_cards_r600? ( virtual/libelf:0=[${MULTILIB_USEDEP}] @@ -105,7 +104,6 @@ RDEPEND=" video_cards_radeon? ( virtual/libelf:0=[${MULTILIB_USEDEP}] ) - >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}] ) opencl? ( app-eselect/eselect-opencl @@ -139,20 +137,84 @@ RDEPEND="${RDEPEND} video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] ) " -# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once -# LLVM < 3.9 is out of the game -DEPEND="${RDEPEND} - ${PYTHON_DEPS} +# Please keep the LLVM dependency block separate. Since LLVM is slotted, +# we need to *really* make sure we're not pulling one than more slot +# simultaneously. +# +# How to use it: +# 1. List all the working slots (with min versions) in ||, newest first. +# 2. Update the := to specify *max* version, e.g. < 7. +# 3. Specify LLVM_MAX_SLOT, e.g. 6. +LLVM_DEPSTR=" + || ( + sys-devel/llvm:6[${MULTILIB_USEDEP}] + sys-devel/llvm:5[${MULTILIB_USEDEP}] + sys-devel/llvm:4[${MULTILIB_USEDEP}] + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] + ) + sys-devel/llvm:=[${MULTILIB_USEDEP}] +" +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]} +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang} +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]} +RDEPEND="${RDEPEND} llvm? ( - video_cards_radeonsi? ( || ( - sys-devel/llvm[llvm_targets_AMDGPU] - sys-devel/llvm[video_cards_radeon] - ) ) + opencl? ( + video_cards_r600? ( + ${CLANG_DEPSTR_AMDGPU} + ) + !video_cards_r600? ( + video_cards_radeonsi? ( + ${CLANG_DEPSTR_AMDGPU} + ) + ) + !video_cards_r600? ( + !video_cards_radeonsi? ( + video_cards_radeon? ( + ${CLANG_DEPSTR_AMDGPU} + ) + ) + ) + !video_cards_r600? ( + !video_cards_radeon? ( + !video_cards_radeonsi? ( + ${CLANG_DEPSTR} + ) + ) + ) + ) + !opencl? ( + video_cards_r600? ( + ${LLVM_DEPSTR_AMDGPU} + ) + !video_cards_r600? ( + video_cards_radeonsi? ( + ${LLVM_DEPSTR_AMDGPU} + ) + ) + !video_cards_r600? ( + !video_cards_radeonsi? ( + video_cards_radeon? ( + ${LLVM_DEPSTR_AMDGPU} + ) + ) + ) + !video_cards_r600? ( + !video_cards_radeon? ( + !video_cards_radeonsi? ( + ${LLVM_DEPSTR} + ) + ) + ) + ) ) +" +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU} + +DEPEND="${RDEPEND} + ${PYTHON_DEPS} opencl? ( - >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}] - >=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}] - >=sys-devel/gcc-4.6 + >=sys-devel/gcc-4.6 ) sys-devel/gettext virtual/pkgconfig @@ -187,6 +249,19 @@ x86? ( ) )" +llvm_check_deps() { + local flags=${MULTILIB_USEDEP} + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi + then + flags+=",llvm_targets_AMDGPU(-)" + fi + + if use opencl; then + has_version "sys-devel/clang[${flags}]" || return 1 + fi + has_version "sys-devel/llvm[${flags}]" +} + pkg_setup() { # warning message for bug 459306 if use llvm && has_version sys-devel/llvm[!debug=]; then @@ -194,7 +269,7 @@ pkg_setup() { ewarn "detected! This can cause problems. For details, see bug 459306." fi - if use llvm || use opencl; then + if use llvm; then llvm_pkg_setup fi python-any-r1_pkg_setup |