commit:     26b6ff712cb15a22b9c3bafe4ad273912d02d045
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 29 14:35:52 2023 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Jan 29 14:35:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26b6ff71

sys-devel/lld: Simplify cross-compile with BDEPEND

I was so used to fixing LLVM and Clang with has_version, due to the dependency
being circular, that I forgot that I could just use BDEPEND in this case.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 sys-devel/lld/lld-15.0.7.ebuild             | 11 ++++-------
 sys-devel/lld/lld-16.0.0.9999.ebuild        | 11 ++++-------
 sys-devel/lld/lld-16.0.0_pre20230107.ebuild | 11 ++++-------
 sys-devel/lld/lld-16.0.0_pre20230127.ebuild | 11 ++++-------
 sys-devel/lld/lld-17.0.0.9999.ebuild        | 11 ++++-------
 5 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/sys-devel/lld/lld-15.0.7.ebuild b/sys-devel/lld/lld-15.0.7.ebuild
index 6156f9bae682..9f1faebcbbbf 100644
--- a/sys-devel/lld/lld-15.0.7.ebuild
+++ b/sys-devel/lld/lld-15.0.7.ebuild
@@ -24,6 +24,7 @@ RDEPEND="
        !sys-devel/lld:0
 "
 BDEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
        test? (
                >=dev-util/cmake-3.16
                $(python_gen_any_dep 
">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -77,13 +78,9 @@ src_configure() {
                -DPython3_EXECUTABLE="${PYTHON}"
        )
 
-       if tc-is-cross-compiler; then
-               has_version -b sys-devel/llvm:${LLVM_MAJOR} ||
-                       die "sys-devel/llvm:${LLVM_MAJOR} is required on the 
build host."
-               mycmakeargs+=(
-                       
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
-               )
-       fi
+       tc-is-cross-compiler && mycmakeargs+=(
+               
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+       )
 
        cmake_src_configure
 }

diff --git a/sys-devel/lld/lld-16.0.0.9999.ebuild 
b/sys-devel/lld/lld-16.0.0.9999.ebuild
index c23949899ce7..d22c1fb13951 100644
--- a/sys-devel/lld/lld-16.0.0.9999.ebuild
+++ b/sys-devel/lld/lld-16.0.0.9999.ebuild
@@ -25,6 +25,7 @@ RDEPEND="
        !sys-devel/lld:0
 "
 BDEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
        test? (
                >=dev-util/cmake-3.16
                $(python_gen_any_dep 
">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -76,13 +77,9 @@ src_configure() {
                -DPython3_EXECUTABLE="${PYTHON}"
        )
 
-       if tc-is-cross-compiler; then
-               has_version -b sys-devel/llvm:${LLVM_MAJOR} ||
-                       die "sys-devel/llvm:${LLVM_MAJOR} is required on the 
build host."
-               mycmakeargs+=(
-                       
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
-               )
-       fi
+       tc-is-cross-compiler && mycmakeargs+=(
+               
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+       )
 
        cmake_src_configure
 }

diff --git a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild 
b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild
index c23949899ce7..d22c1fb13951 100644
--- a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild
+++ b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild
@@ -25,6 +25,7 @@ RDEPEND="
        !sys-devel/lld:0
 "
 BDEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
        test? (
                >=dev-util/cmake-3.16
                $(python_gen_any_dep 
">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -76,13 +77,9 @@ src_configure() {
                -DPython3_EXECUTABLE="${PYTHON}"
        )
 
-       if tc-is-cross-compiler; then
-               has_version -b sys-devel/llvm:${LLVM_MAJOR} ||
-                       die "sys-devel/llvm:${LLVM_MAJOR} is required on the 
build host."
-               mycmakeargs+=(
-                       
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
-               )
-       fi
+       tc-is-cross-compiler && mycmakeargs+=(
+               
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+       )
 
        cmake_src_configure
 }

diff --git a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild 
b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild
index c23949899ce7..d22c1fb13951 100644
--- a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild
+++ b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild
@@ -25,6 +25,7 @@ RDEPEND="
        !sys-devel/lld:0
 "
 BDEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
        test? (
                >=dev-util/cmake-3.16
                $(python_gen_any_dep 
">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -76,13 +77,9 @@ src_configure() {
                -DPython3_EXECUTABLE="${PYTHON}"
        )
 
-       if tc-is-cross-compiler; then
-               has_version -b sys-devel/llvm:${LLVM_MAJOR} ||
-                       die "sys-devel/llvm:${LLVM_MAJOR} is required on the 
build host."
-               mycmakeargs+=(
-                       
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
-               )
-       fi
+       tc-is-cross-compiler && mycmakeargs+=(
+               
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+       )
 
        cmake_src_configure
 }

diff --git a/sys-devel/lld/lld-17.0.0.9999.ebuild 
b/sys-devel/lld/lld-17.0.0.9999.ebuild
index c23949899ce7..d22c1fb13951 100644
--- a/sys-devel/lld/lld-17.0.0.9999.ebuild
+++ b/sys-devel/lld/lld-17.0.0.9999.ebuild
@@ -25,6 +25,7 @@ RDEPEND="
        !sys-devel/lld:0
 "
 BDEPEND="
+       sys-devel/llvm:${LLVM_MAJOR}
        test? (
                >=dev-util/cmake-3.16
                $(python_gen_any_dep 
">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
@@ -76,13 +77,9 @@ src_configure() {
                -DPython3_EXECUTABLE="${PYTHON}"
        )
 
-       if tc-is-cross-compiler; then
-               has_version -b sys-devel/llvm:${LLVM_MAJOR} ||
-                       die "sys-devel/llvm:${LLVM_MAJOR} is required on the 
build host."
-               mycmakeargs+=(
-                       
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
-               )
-       fi
+       tc-is-cross-compiler && mycmakeargs+=(
+               
-DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+       )
 
        cmake_src_configure
 }

Reply via email to