99 lines
2.3 KiB
Plaintext

# Contributor: Marian <marian.buschsieweke@posteo.net>
# Maintainer: Marian <marian.buschsieweke@posteo.net>
pkgname=afl++
pkgver=4.30c
pkgrel=0
pkgdesc="Fuzzer relying on genetic algorithms instead of brute force"
url="https://aflplus.plus/"
# x86: test failures
# s390x: blocked by lld
arch="all !x86 !s390x"
license="Apache-2.0"
# afl-cmin requires stat
_llvmver=18
# llvm LTO test fails on riscv64
# https://github.com/AFLplusplus/AFLplusplus/issues/2064
case "$CARCH" in
riscv64) options="$options !check";;
esac
depends="
clang$_llvmver
compiler-rt
lld$_llvmver
llvm$_llvmver
python3
"
# install -T
makedepends="
bash
clang$_llvmver-dev
coreutils
gmp-dev
grep
llvm$_llvmver-dev
python3-dev
"
checkdepends="
cmocka-dev
"
subpackages="
$pkgname-doc
afl++-tools
"
provides="
afl=$pkgver-r$pkgrel
afl-clang=$pkgver-r$pkgrel
afl-gcc=$pkgver-r$pkgrel
"
source="
$pkgname-$pkgver.tar.gz::https://github.com/AFLplusplus/AFLplusplus/archive/refs/tags/v$pkgver.tar.gz
f2f417325f25de83bb149c178d36e00631e3d4bb.patch
"
builddir="$srcdir/AFLplusplus-$pkgver"
build() {
export PATH="$PATH:/usr/lib/llvm$_llvmver/bin"
export NO_NYX=1
export AFL_NO_X86=1
export LLVM_LTO=1
make PREFIX=/usr all
}
check() {
# Unset our CFLAGS/CXXFLAGS for the tests since these may
# interact in unexpected ways with afl-cc instrumentation.
CFLAGS= CXXFLAGS= make AFL_NO_X86=1 test
}
package() {
make AFL_NO_X86=1 PREFIX=/usr DESTDIR="$pkgdir" install
# Test cases contain x86 binaries that cause trouble with strip on non-x86
# architectures, so just drop the test cases here.
rm -rf "$pkgdir"/usr/share/afl/testcases/
# afl-cmin.bash is the same as afl-cmin, but implemented differently making
# use of bash features. No need for the same functionality twice.
rm "$pkgdir"/usr/bin/afl-cmin.bash
}
tools() {
pkgdesc="AFL++ tools and utilities"
depends="
afl++
coreutils
grep
"
amove usr/bin/afl-cmin
amove usr/bin/afl-plot
amove usr/bin/afl-showmap
amove usr/bin/afl-tmin
}
sha512sums="
072c9524978843eec6be5428793be43d10f3530a3f569fd4015d950cdd87696e887c3b567440afee8cb5e359b234d0c5e668cf9ab90622783fc82f68e3ec5f98 afl++-4.30c.tar.gz
d0c2cc3ca8fb51ede36f58078bbfe6e2d95c3084857680cce404586b9a796322b7bb07b207cef630da494bbf8bac9c228d8f3998921aa6cbe0e24f87e438afcd f2f417325f25de83bb149c178d36e00631e3d4bb.patch
"