cd rnp-build
make "-j$(nproc)"

FUZZERS=$(find src/fuzzing -maxdepth 1 -type f -name "fuzz_*" -exec basename {} \;)
printf "Detected fuzzers: \n%s\n" "$FUZZERS"
for f in $FUZZERS; do
    cp "src/fuzzing/$f" "${OUT}/"
    patchelf --set-rpath "\$ORIGIN/lib" "${OUT}/$f" || echo "patchelf failed with $?, ignoring."
    zip -j -r "${OUT}/${f}_seed_corpus.zip" "$SRC/fuzzing_corpus/"
done
