|
Lines 2-8
Link Here
|
| 2 |
# $FreeBSD$ |
2 |
# $FreeBSD$ |
| 3 |
|
3 |
|
| 4 |
PORTNAME= afl |
4 |
PORTNAME= afl |
| 5 |
PORTVERSION= 1.96b |
5 |
PORTVERSION= 2.02b |
| 6 |
CATEGORIES= security |
6 |
CATEGORIES= security |
| 7 |
MASTER_SITES= http://lcamtuf.coredump.cx/afl/releases/ |
7 |
MASTER_SITES= http://lcamtuf.coredump.cx/afl/releases/ |
| 8 |
|
8 |
|
|
Lines 12-59
Link Here
|
| 12 |
LICENSE= APACHE20 |
12 |
LICENSE= APACHE20 |
| 13 |
LICENSE_FILE= ${WRKSRC}/docs/COPYING |
13 |
LICENSE_FILE= ${WRKSRC}/docs/COPYING |
| 14 |
|
14 |
|
| 15 |
USES= compiler gmake tar:tgz |
15 |
USES= compiler gmake tar:tgz |
| 16 |
|
16 |
|
| 17 |
OPTIONS_DEFINE= DEBUG DOCS MINIMIZE_CORPUS PLOT_SUPPORT TEST_INSTRUMENTATION |
17 |
OPTIONS_DEFINE= DEBUG DOCS MINIMIZE_CORPUS LLVM TEST_INSTRUMENTATION |
| 18 |
MINIMIZE_CORPUS_DESC= Install afl-cmin. Adds bash dependency |
18 |
MINIMIZE_CORPUS_DESC= Install afl-cmin. Adds bash dependency |
| 19 |
PLOT_SUPPORT_DESC= Support progress plotting. Adds Gnuplot dependency |
|
|
| 20 |
TEST_INSTRUMENTATION_DESC= Execute tests (expected to fail in jails) |
19 |
TEST_INSTRUMENTATION_DESC= Execute tests (expected to fail in jails) |
| 21 |
OPTIONS_DEFAULT= DOCS MINIMIZE_CORPUS PLOT_SUPPORT |
20 |
LLVM_DESC= LLVM-based instrumentation (broken on 9.x) |
|
|
21 |
OPTIONS_DEFAULT= DOCS LLVM MINIMIZE_CORPUS |
| 22 |
|
22 |
|
| 23 |
OPTIONS_SUB= yes |
23 |
OPTIONS_SUB= yes |
| 24 |
|
24 |
|
| 25 |
PORTSCOUT= ignore:1 |
25 |
ONLY_FOR_ARCHS= amd64 i386 |
| 26 |
|
|
|
| 27 |
ONLY_FOR_ARCHS= amd64 i386 |
| 28 |
ONLY_FOR_ARCHS_REASON= Uses binary instrumentation |
26 |
ONLY_FOR_ARCHS_REASON= Uses binary instrumentation |
| 29 |
|
27 |
|
| 30 |
.include <bsd.port.pre.mk> |
28 |
LLVM_BUILD_DEPENDS= clang37:${PORTSDIR}/devel/llvm37 |
|
|
29 |
LLVM_RUN_DEPENDS= clang37:${PORTSDIR}/devel/llvm37 |
| 30 |
MINIMIZE_CORPUS_RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash |
| 31 |
|
31 |
|
| 32 |
.if (${COMPILER_TYPE} == "clang" && ${ARCH} == "i386") |
32 |
.include <bsd.port.options.mk> |
|
|
33 |
|
| 34 |
.if ${OSVERSION} < 1000013 |
| 35 |
# Broken on FreeBSD 9 |
| 36 |
PLIST_SUB+= LLVM_SUB="@comment " |
| 37 |
.else |
| 38 |
PLIST_SUB+= LLVM_SUB="" |
| 39 |
.endif |
| 40 |
|
| 41 |
.if ${ARCH} == "i386" |
| 33 |
# Clang i386 emits .cfi_sections which base as(1) doesn't understand |
42 |
# Clang i386 emits .cfi_sections which base as(1) doesn't understand |
| 34 |
BUILD_DEPENDS += ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils |
43 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils |
| 35 |
RUN_DEPENDS += ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils |
44 |
RUN_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils |
| 36 |
.endif |
45 |
.endif |
| 37 |
|
46 |
|
| 38 |
MINIMIZE_CORPUS_RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash |
47 |
MAKE_ARGS= INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ |
| 39 |
PLOT_SUPORT_RUN_DEPENDS= gnuplot:${PORTSDIR}/math/gnuplot |
48 |
INSTALL_SCRIPT="${INSTALL_SCRIPT}" |
| 40 |
|
49 |
|
| 41 |
post-patch: |
50 |
post-patch-TEST_INSTRUMENTATION-off: |
| 42 |
.if ! ${PORT_OPTIONS:MTEST_INSTRUMENTATION} |
|
|
| 43 |
# afl needs shmget() which usually isn't available in jails. Disabling |
51 |
# afl needs shmget() which usually isn't available in jails. Disabling |
| 44 |
# the instrumentation tests makes sure building packages in jails works |
52 |
# the instrumentation tests makes sure building packages in jails works |
| 45 |
# by default anyway. |
53 |
# by default anyway. |
| 46 |
${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/Makefile |
54 |
${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/Makefile |
| 47 |
.endif |
55 |
${REINPLACE_CMD} -e 's@^\(all.*\) test_build@\1@' ${WRKSRC}/llvm_mode/Makefile |
| 48 |
${REINPLACE_CMD} -E -e 's@ -O3@@; s@ -g@@' \ |
56 |
|
| 49 |
-e 's@install -m 755@${INSTALL_PROGRAM}@' \ |
57 |
post-patch: |
| 50 |
-e 's@ afl-(cmin|plot|whatsup) @ @g' \ |
58 |
.if ${ARCH} == "i386" |
| 51 |
${WRKSRC}/Makefile |
|
|
| 52 |
.if (${COMPILER_TYPE} == "clang" && ${ARCH} == "i386") |
| 53 |
${REINPLACE_CMD} -e 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \ |
59 |
${REINPLACE_CMD} -e 's@\( as_params\[0\] = afl_as ? afl_as : \)\(.*\)@\1(u8*)"${LOCALBASE}/bin/as";@' \ |
| 54 |
${WRKSRC}/afl-as.c |
60 |
${WRKSRC}/afl-as.c |
| 55 |
.endif |
61 |
.endif |
| 56 |
|
62 |
|
|
|
63 |
.if ! ${OSVERSION} < 1000013 |
| 64 |
# Broken on FreeBSD 9 |
| 65 |
post-build-LLVM-on: |
| 66 |
@(cd ${WRKSRC}/llvm_mode; ${SETENV} \ |
| 67 |
CC=clang37 \ |
| 68 |
CXX=clang++37 \ |
| 69 |
LLVM_CONFIG=llvm-config37 \ |
| 70 |
CFLAGS="${CFLAGS}" \ |
| 71 |
CXXFLAGS="${CXXFLAGS}" \ |
| 72 |
${GMAKE}) |
| 73 |
.endif |
| 74 |
|
| 57 |
post-install: |
75 |
post-install: |
| 58 |
${INSTALL_DATA} ${WRKSRC}/docs/COPYING ${STAGEDIR}${DOCSDIR}/ |
76 |
${INSTALL_DATA} ${WRKSRC}/docs/COPYING ${STAGEDIR}${DOCSDIR}/ |
| 59 |
|
77 |
|
|
Lines 64-67
Link Here
|
| 64 |
post-install-MINIMIZE_CORPUS-on: |
82 |
post-install-MINIMIZE_CORPUS-on: |
| 65 |
${INSTALL_SCRIPT} ${WRKSRC}/afl-cmin ${STAGEDIR}${PREFIX}/bin/ |
83 |
${INSTALL_SCRIPT} ${WRKSRC}/afl-cmin ${STAGEDIR}${PREFIX}/bin/ |
| 66 |
|
84 |
|
| 67 |
.include <bsd.port.post.mk> |
85 |
.include <bsd.port.mk> |