@@ -51,6 +51,7 @@ SRC_URI="
51
51
PATCHES=(
52
52
" ${FILESDIR} /${P} -link-with-lld.patch"
53
53
" ${FILESDIR} /${P} -llbuild-link-ncurses-tinfo-gentoo.patch"
54
+ " ${FILESDIR} /${P} -lldb-cmake-minimum-version.patch"
54
55
)
55
56
56
57
S=" ${WORKDIR} "
@@ -119,7 +120,8 @@ src_unpack() {
119
120
src_configure () {
120
121
default
121
122
122
- # Necessary to respect PYTHON_SINGLE_TARGET, if defined.
123
+ # Sets `${EPYTHON}` according to `PYTHON_SINGLE_TARGET`, sets up
124
+ # `${T}/${EPYTHON}` with that version, and adds it to the `PATH`.
123
125
python_setup
124
126
}
125
127
@@ -159,7 +161,18 @@ src_compile() {
159
161
# The Clang `compiler-rt` library builds the LLVM ORC JIT component by
160
162
# default, which we don't need; the component builds with an executable
161
163
# stack, which we'd like to avoid.
162
- ' -DCOMPILER_RT_BUILD_ORC:BOOL=NO'
164
+ ' -DCOMPILER_RT_BUILD_ORC:BOOL=NO' ,
165
+
166
+ # LLDB ships with Python bindings, and uses CMake to search for Python.
167
+ # By default, CMake tries to find the latest version of Python available
168
+ # on disk (currently `python3.13`, then `python3.12`, then...). This
169
+ # might not be the version of Python the rest of the system uses, or
170
+ # which is specified by `PYTHON_SINGLE_TARGET`.
171
+ #
172
+ # Since `python_setup` already places `${EPYTHON}` in the `PATH`, we can
173
+ # tell CMake to use the unversioned `python` rather than a versioned
174
+ # one to end up respecting `PYTHON_SINGLE_TARGET`.
175
+ ' -DPython3_FIND_UNVERSIONED_NAMES=FIRST'
163
176
)
164
177
local extra_cmake_options=" $( IFS=,; echo " ${_extra_cmake_options[*]} " ) "
165
178
0 commit comments