commit:     43ab977c0eb0504b46bf04823afb8018da15e5da
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 27 18:16:02 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 27 18:20:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43ab977c

app-forensics/aflplusplus: allow LLVM 12, add optfeature for sanitizers, clang 
dep

* Allow LLVM 12
* Add optfeature for sanitizers
* Clang is required for afl-* testing during build (and generating some
targets)

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...3.12c-r1.ebuild => aflplusplus-3.12c-r2.ebuild} | 25 ++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/app-forensics/aflplusplus/aflplusplus-3.12c-r1.ebuild 
b/app-forensics/aflplusplus/aflplusplus-3.12c-r2.ebuild
similarity index 74%
rename from app-forensics/aflplusplus/aflplusplus-3.12c-r1.ebuild
rename to app-forensics/aflplusplus/aflplusplus-3.12c-r2.ebuild
index d6d3ef5f510..4a430c66773 100644
--- a/app-forensics/aflplusplus/aflplusplus-3.12c-r1.ebuild
+++ b/app-forensics/aflplusplus/aflplusplus-3.12c-r2.ebuild
@@ -4,8 +4,8 @@
 EAPI=7
 
 PYTHON_COMPAT=( python3_{7,8,9} )
-LLVM_MAX_SLOT=11
-inherit toolchain-funcs llvm python-single-r1
+LLVM_MAX_SLOT=12
+inherit toolchain-funcs llvm optfeature python-single-r1
 
 DESCRIPTION="A fork of AFL, the popular compile-time instrumentation fuzzer"
 HOMEPAGE="https://github.com/AFLplusplus/AFLplusplus";
@@ -14,7 +14,7 @@ S="${WORKDIR}/AFLplusplus-${PV}"
 
 LICENSE="Apache-2.0"
 SLOT="0"
-KEYWORDS="~amd64"
+KEYWORDS="~amd64 ~arm64"
 IUSE="test"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -23,12 +23,14 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 # This isn't compatible with sandbox
 RESTRICT="test"
 
+# It turns out we need Clang too
 RDEPEND="
        ${PYTHON_DEPS}
+       >=sys-devel/llvm-10:=
        || (
-               sys-devel/llvm:10
-               sys-devel/llvm:11
-               sys-devel/llvm:12
+               sys-devel/clang:10
+               sys-devel/clang:11
+               sys-devel/clang:12
        )
 "
 DEPEND="
@@ -43,6 +45,11 @@ PATCHES=(
        "${FILESDIR}/${PN}-3.0c-CFLAGS.patch"
 )
 
+llvm_check_deps() {
+       has_version -b "sys-devel/clang:${LLVM_SLOT}" && \
+               has_version -b "sys-devel/llvm:${LLVM_SLOT}"
+}
+
 pkg_setup() {
        llvm_pkg_setup
        python-single-r1_pkg_setup
@@ -82,3 +89,9 @@ src_install() {
                MAN_PATH="${EPREFIX}/usr/share/man/man8" \
                install
 }
+
+pkg_postinst() {
+       # TODO: Any otherrs?
+       optfeature "fuzzing with AFL_USE_ASAN" 
sys-libs/compiler-rt-sanitizers[asan]
+       optfeature "fuzzing with AFL_USE_MSAN" 
sys-libs/compiler-rt-sanitizers[msan]
+}

Reply via email to