sys-devel/llvm: Install libFuzzer only for Darwin||Linux
authorMichał Górny <mgorny@gentoo.org>
Sun, 25 Feb 2018 19:09:04 +0000 (20:09 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 25 Feb 2018 19:09:23 +0000 (20:09 +0100)
Install libFuzzer only on platforms where it is actually built, that
is Darwin and Linux. This fixes install failure on FreeBSD.

sys-devel/llvm/llvm-5.0.1.ebuild

index c4ebf78be0aa67c8986b0f7d04188b4bf4f4868e..809795ffd0a33f2bc1e70e5548051204de832259 100644 (file)
@@ -35,7 +35,7 @@ LICENSE="UoI-NCSA rc BSD public-domain
 SLOT="$(ver_cut 1)"
 KEYWORDS="amd64 ~arm ~arm64 x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos"
 IUSE="debug doc gold libedit +libffi ncurses test
-       kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
+       kernel_Darwin kernel_linux ${ALL_LLVM_TARGETS[*]}"
 
 RDEPEND="
        sys-libs/zlib:0=
@@ -211,10 +211,12 @@ multilib_src_install() {
        rm -rf "${ED%/}"/usr/include || die
        mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
 
-       # install fuzzer libraries for clang (cmake rules were added in 6)
-       # https://bugs.gentoo.org/636840
-       into "/usr/lib/llvm/${SLOT}"
-       dolib.a "$(get_libdir)"/libLLVMFuzzer*.a
+       if use kernel_linux || use kernel_Darwin; then
+               # install fuzzer libraries for clang (cmake rules were added in 6)
+               # https://bugs.gentoo.org/636840
+               into "/usr/lib/llvm/${SLOT}"
+               dolib.a "$(get_libdir)"/libLLVMFuzzer*.a
+       fi
 
        LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
 }