Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/aflplusplus/
Date: Thu, 22 Sep 2022 01:09:43
Message-Id: 1663808940.34355eb96cdbae9cda24aeb616eba7966668408c.sam@gentoo
1 commit: 34355eb96cdbae9cda24aeb616eba7966668408c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 21 05:13:59 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 22 01:09:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34355eb9
7
8 app-forensics/aflplusplus: add 4.03c
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-forensics/aflplusplus/Manifest | 2 +
13 app-forensics/aflplusplus/aflplusplus-4.03c.ebuild | 86 ++++++++++++++++++++++
14 2 files changed, 88 insertions(+)
15
16 diff --git a/app-forensics/aflplusplus/Manifest b/app-forensics/aflplusplus/Manifest
17 index 3a76da8c144b..3e32b229cde6 100644
18 --- a/app-forensics/aflplusplus/Manifest
19 +++ b/app-forensics/aflplusplus/Manifest
20 @@ -1,2 +1,4 @@
21 DIST aflplusplus-4.01c.tar.gz 2818445 BLAKE2B f3699c4b2fabec0ab238277c3b2c7b19b35af7a0b82b14a57c34b8579121cfa0644ef432132cf4a3382547db3faf799d2ab601512ddfb469e4a2246cdb61aa7f SHA512 d2b03ab4ff9538fe0b52aa3ed4778a6e5657d64d6f0e5f75a99305bad69c5179d6b1c882650f19a884a740577acb73dab7cee3d5c9c7b06ff2326ffeba37d1fe
22 DIST aflplusplus-4.02c.tar.gz 2828429 BLAKE2B 0c4d7937626a699bb6768e2f67f369508f7ec131d1170cd48f8650d8081135b466733de34e52f2ac2213c4bd13ab8936b17d3b0f8debf28e8a32ad87d9dcb55d SHA512 f5159a84e0ecd2c260d2d8ce7df33fe4704c664bdf06f193a7fef377d48646e4d921ee90d0b66c7dac02d16e6b1607c6569351aaeea9b2ee3968d22b3f583763
23 +DIST aflplusplus-4.03c-patches.tar.xz 4444 BLAKE2B 4eed2ee97e4f7aef987e5c931469b7bb1d85310cb101878e5e71431ac36329a07b0e05812ed1e743c6ed3ce76e10c4392f2bf7ccc98ec1537b75196c5629acfe SHA512 bcaa196640f47923be6daa65e3c5f8461eadaec3b939f2cfe0223eacc64be385c80166ec7dc0df25d0c38053a38c3efcfbc25d8387bed5c54c95a8781ed64b00
24 +DIST aflplusplus-4.03c.tar.gz 2830718 BLAKE2B 1b55daf3c3a0a0b11c1ef0a7dd1005cfa1ec61fb54691b96519f57788233b1385b52948468f2d5beada3c58129bc0524f07aebfb25ee8cef1e5d5afd06b1233d SHA512 4bab00d964eb9d0664d97062f5da8090dfef599480f25b04d08b84e7f47676a9790fb23573f7e885b5da6ab813694f9ab26a0b5c9d341834892530558e3b83ef
25
26 diff --git a/app-forensics/aflplusplus/aflplusplus-4.03c.ebuild b/app-forensics/aflplusplus/aflplusplus-4.03c.ebuild
27 new file mode 100644
28 index 000000000000..3c1388fc37fd
29 --- /dev/null
30 +++ b/app-forensics/aflplusplus/aflplusplus-4.03c.ebuild
31 @@ -0,0 +1,86 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +LLVM_MAX_SLOT=15
39 +inherit toolchain-funcs llvm optfeature python-single-r1
40 +
41 +AFL_PATCHSET="${PN}-4.03c-patches"
42 +DESCRIPTION="A fork of AFL, the popular compile-time instrumentation fuzzer"
43 +HOMEPAGE="https://github.com/AFLplusplus/AFLplusplus"
44 +SRC_URI="https://github.com/AFLplusplus/AFLplusplus/archive/${PV}.tar.gz -> ${P}.tar.gz"
45 +SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${AFL_PATCHSET}.tar.xz"
46 +S="${WORKDIR}"/AFLplusplus-${PV}
47 +
48 +LICENSE="Apache-2.0"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm64"
51 +IUSE="test"
52 +
53 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
54 +
55 +# Tests involve heavy use of LD_PRELOAD in some cases
56 +# This isn't compatible with sandbox
57 +RESTRICT="test"
58 +
59 +# It turns out we need Clang too
60 +RDEPEND="${PYTHON_DEPS}
61 + >=sys-devel/llvm-13:=
62 + || (
63 + sys-devel/clang:13
64 + sys-devel/clang:${LLVM_MAX_SLOT}
65 + )
66 + !app-forensics/afl"
67 +DEPEND="${RDEPEND}
68 + test? ( dev-util/cmocka )"
69 +
70 +QA_FLAGS_IGNORED="afl-gcc-cmplog-pass.so afl-gcc-cmptrs-pass.so"
71 +QA_PREBUILT="usr/share/afl/testcases/others/elf/small_exec.elf"
72 +
73 +PATCHES=(
74 + "${WORKDIR}"/${AFL_PATCHSET}
75 +)
76 +
77 +llvm_check_deps() {
78 + has_version -b "sys-devel/clang:${LLVM_SLOT}" && \
79 + has_version -b "sys-devel/llvm:${LLVM_SLOT}"
80 +}
81 +
82 +pkg_setup() {
83 + llvm_pkg_setup
84 + python-single-r1_pkg_setup
85 +}
86 +
87 +mymake() {
88 + emake \
89 + CC="$(tc-getCC)" \
90 + CXX="$(tc-getCXX)" \
91 + CFLAGS_FLTO="" \
92 + LLVM_CONFIG="$(get_llvm_prefix ${LLVM_MAX_SLOT})"/bin/llvm-config \
93 + PREFIX="${EPREFIX}/usr" \
94 + HELPER_PATH="${EPREFIX}/usr/$(get_libdir)/afl" \
95 + DOC_PATH="${EPREFIX}/usr/share/doc/${PF}" \
96 + MAN_PATH="${EPREFIX}/usr/share/man/man8" \
97 + "$@"
98 +}
99 +
100 +src_compile() {
101 + mymake
102 +}
103 +
104 +src_test() {
105 + mymake test
106 +}
107 +
108 +src_install() {
109 + mymake DESTDIR="${D}" install
110 + dostrip -x /usr/share/afl/testcases/
111 +}
112 +
113 +pkg_postinst() {
114 + # TODO: Any others?
115 + optfeature "fuzzing with AFL_USE_ASAN" sys-libs/compiler-rt-sanitizers[asan]
116 + optfeature "fuzzing with AFL_USE_MSAN" sys-libs/compiler-rt-sanitizers[msan]
117 +}