Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/
Date: Thu, 28 Sep 2017 13:19:20
Message-Id: 1506604583.135bd0f4429ba1508b7bbf47ffabfc6f3de238ee.mgorny@gentoo
1 commit: 135bd0f4429ba1508b7bbf47ffabfc6f3de238ee
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 28 13:16:23 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 28 13:16:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=135bd0f4
7
8 media-libs/mesa: Backport LLVM dep fixes to 17.2.1
9
10 media-libs/mesa/mesa-17.2.1.ebuild | 103 ++++++++++++++++++++++++++++++++-----
11 1 file changed, 89 insertions(+), 14 deletions(-)
12
13 diff --git a/media-libs/mesa/mesa-17.2.1.ebuild b/media-libs/mesa/mesa-17.2.1.ebuild
14 index f54779f9572..2b6f32728db 100644
15 --- a/media-libs/mesa/mesa-17.2.1.ebuild
16 +++ b/media-libs/mesa/mesa-17.2.1.ebuild
17 @@ -97,7 +97,6 @@ RDEPEND="
18 llvm? (
19 video_cards_radeonsi? (
20 virtual/libelf:0=[${MULTILIB_USEDEP}]
21 - vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
22 )
23 video_cards_r600? (
24 virtual/libelf:0=[${MULTILIB_USEDEP}]
25 @@ -105,7 +104,6 @@ RDEPEND="
26 video_cards_radeon? (
27 virtual/libelf:0=[${MULTILIB_USEDEP}]
28 )
29 - >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
30 )
31 opencl? (
32 app-eselect/eselect-opencl
33 @@ -139,20 +137,84 @@ RDEPEND="${RDEPEND}
34 video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
35 "
36
37 -# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
38 -# LLVM < 3.9 is out of the game
39 -DEPEND="${RDEPEND}
40 - ${PYTHON_DEPS}
41 +# Please keep the LLVM dependency block separate. Since LLVM is slotted,
42 +# we need to *really* make sure we're not pulling one than more slot
43 +# simultaneously.
44 +#
45 +# How to use it:
46 +# 1. List all the working slots (with min versions) in ||, newest first.
47 +# 2. Update the := to specify *max* version, e.g. < 7.
48 +# 3. Specify LLVM_MAX_SLOT, e.g. 6.
49 +LLVM_DEPSTR="
50 + || (
51 + sys-devel/llvm:6[${MULTILIB_USEDEP}]
52 + sys-devel/llvm:5[${MULTILIB_USEDEP}]
53 + sys-devel/llvm:4[${MULTILIB_USEDEP}]
54 + >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
55 + )
56 + sys-devel/llvm:=[${MULTILIB_USEDEP}]
57 +"
58 +LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
59 +CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
60 +CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
61 +RDEPEND="${RDEPEND}
62 llvm? (
63 - video_cards_radeonsi? ( || (
64 - sys-devel/llvm[llvm_targets_AMDGPU]
65 - sys-devel/llvm[video_cards_radeon]
66 - ) )
67 + opencl? (
68 + video_cards_r600? (
69 + ${CLANG_DEPSTR_AMDGPU}
70 + )
71 + !video_cards_r600? (
72 + video_cards_radeonsi? (
73 + ${CLANG_DEPSTR_AMDGPU}
74 + )
75 + )
76 + !video_cards_r600? (
77 + !video_cards_radeonsi? (
78 + video_cards_radeon? (
79 + ${CLANG_DEPSTR_AMDGPU}
80 + )
81 + )
82 + )
83 + !video_cards_r600? (
84 + !video_cards_radeon? (
85 + !video_cards_radeonsi? (
86 + ${CLANG_DEPSTR}
87 + )
88 + )
89 + )
90 + )
91 + !opencl? (
92 + video_cards_r600? (
93 + ${LLVM_DEPSTR_AMDGPU}
94 + )
95 + !video_cards_r600? (
96 + video_cards_radeonsi? (
97 + ${LLVM_DEPSTR_AMDGPU}
98 + )
99 + )
100 + !video_cards_r600? (
101 + !video_cards_radeonsi? (
102 + video_cards_radeon? (
103 + ${LLVM_DEPSTR_AMDGPU}
104 + )
105 + )
106 + )
107 + !video_cards_r600? (
108 + !video_cards_radeon? (
109 + !video_cards_radeonsi? (
110 + ${LLVM_DEPSTR}
111 + )
112 + )
113 + )
114 + )
115 )
116 +"
117 +unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
118 +
119 +DEPEND="${RDEPEND}
120 + ${PYTHON_DEPS}
121 opencl? (
122 - >=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
123 - >=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
124 - >=sys-devel/gcc-4.6
125 + >=sys-devel/gcc-4.6
126 )
127 sys-devel/gettext
128 virtual/pkgconfig
129 @@ -187,6 +249,19 @@ x86? (
130 )
131 )"
132
133 +llvm_check_deps() {
134 + local flags=${MULTILIB_USEDEP}
135 + if use video_cards_r600 || use video_cards_radeon || use video_cards_radeonsi
136 + then
137 + flags+=",llvm_targets_AMDGPU(-)"
138 + fi
139 +
140 + if use opencl; then
141 + has_version "sys-devel/clang[${flags}]" || return 1
142 + fi
143 + has_version "sys-devel/llvm[${flags}]"
144 +}
145 +
146 pkg_setup() {
147 # warning message for bug 459306
148 if use llvm && has_version sys-devel/llvm[!debug=]; then
149 @@ -194,7 +269,7 @@ pkg_setup() {
150 ewarn "detected! This can cause problems. For details, see bug 459306."
151 fi
152
153 - if use llvm || use opencl; then
154 + if use llvm; then
155 llvm_pkg_setup
156 fi
157 python-any-r1_pkg_setup