1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Stage, unbreak without gcc, and introduce a TEST option.

This commit is contained in:
Adam Weinberger 2014-07-30 14:06:45 +00:00
parent cdb014311c
commit b010e764c3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363481
2 changed files with 37 additions and 24 deletions

View File

@ -8,10 +8,7 @@ MASTER_SITES= http://webster.cs.ucr.edu/AsmTools/HLA/HLAv${PORTVERSION}/:src \
http://www.gahr.ch/FreeBSD/HLA/:extra
DISTFILES= ${PORTNAME}src${EXTRACT_SUFX}:src \
bsd.hla.tar.gz:src \
HLARef_html${EXTRACT_SUFX}:src \
HLAstdlib_html${EXTRACT_SUFX}:src \
lex.yy.c:extra \
hello.hla:extra
lex.yy.c:extra
DIST_SUBDIR= ${PORTNAME}
EXTRACT_ONLY= ${PORTNAME}src${EXTRACT_SUFX}
@ -24,15 +21,30 @@ WRKSRC= ${WRKDIR}/hlasrc/trunk/trunk
MAKEFILE= makefile.bsd
ALL_TARGET= hlaparse hla
SUB_FILES= pkg-message
ONLY_FOR_ARCHS= i386
NO_STAGE= yes
OPTIONS_DEFINE= DOCS TEST
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS} || make(makesum)
DISTFILES+= HLARef_html${EXTRACT_SUFX}:src \
HLAstdlib_html${EXTRACT_SUFX}:src
.endif
.if ${PORT_OPTIONS:MTEST} || make(makesum)
DISTFILES+= hello.hla:extra
.endif
post-extract:
${MKDIR} ${WRKDIR}/stdlib && \
${TAR} -zxf ${_DISTDIR}/bsd.${PORTNAME}.tar.gz -C ${WRKDIR}/stdlib
${CP} ${_DISTDIR}/lex.yy.c ${WRKSRC}
.if ${PORT_OPTIONS:MTEST}
${CP} ${_DISTDIR}/hello.hla ${WRKSRC}
.if !defined(NOPORTDOCS)
.endif
.if ${PORT_OPTIONS:MDOCS}
(${MKDIR} ${WRKDIR}/HLAstdlib && \
${UNZIP_CMD} -q ${_DISTDIR}/HLAstdlib_html${EXTRACT_SUFX} -d ${WRKDIR}/HLAstdlib \
)
@ -42,36 +54,33 @@ post-extract:
.endif
post-patch:
${REINPLACE_CMD} -e '/flex/d' ${WRKSRC}/makefile.bsd
@${REINPLACE_CMD} -e '/flex/d; s|gcc|${CC}|; s|-O2|${CFLAGS}|; \
s|-static-libgcc||' ${WRKSRC}/makefile.bsd
do-configure:
(cd ${WRKSRC} && bison -o hlaparse.c hlaparse.bsn)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/hla ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/hlaparse ${PREFIX}/bin
${INSTALL_DATA} ${WRKDIR}/stdlib/hla/hlalib/hlalib.a ${PREFIX}/lib
${INSTALL} -d ${PREFIX}/include/hla
(cd ${WRKDIR}/stdlib/hla/include/include && ${COPYTREE_SHARE} \* ${PREFIX}/include/hla)
${INSTALL_PROGRAM} ${WRKSRC}/hla ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/hlaparse ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKDIR}/stdlib/hla/hlalib/hlalib.a ${STAGEDIR}${PREFIX}/lib
@${MKDIR} ${STAGEDIR}${PREFIX}/include/hla
(cd ${WRKDIR}/stdlib/hla/include/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/hla)
post-install:
.if !defined(NOPORTDOCS)
${INSTALL} -d ${DOCSDIR}/Reference
${INSTALL} -d ${DOCSDIR}/stdlib
(cd ${WRKDIR}/HLAReference && ${COPYTREE_SHARE} \* ${DOCSDIR}/Reference)
(cd ${WRKDIR}/HLAstdlib && ${COPYTREE_SHARE} \* ${DOCSDIR}/stdlib)
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}/Reference ${STAGEDIR}${DOCSDIR}/stdlib
(cd ${WRKDIR}/HLAReference && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/Reference)
(cd ${WRKDIR}/HLAstdlib && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/stdlib)
.endif
.if ${PORT_OPTIONS:MTEST}
@${ECHO_MSG} ""
@${ECHO_MSG} "Testing HLA installation..."
@( \
hlainc=${PREFIX}/include/hla hlalib=${PREFIX}/lib/hlalib.a \
${WRKSRC}/hla ${WRKSRC}/hello.hla && \
hlainc=${STAGEDIR}${PREFIX}/include/hla hlalib=${STAGEDIR}${PREFIX}/lib/hlalib.a \
PATH=${PATH}:${STAGEDIR}${PREFIX}/bin ${WRKSRC}/hla ${WRKSRC}/hello.hla && \
${WRKSRC}/hello \
)
@${ECHO_MSG} ""
@${ECHO_MSG} "Remember to set the following environment variables:"
@${ECHO_MSG} "hlainc -> ${PREFIX}/include/hla"
@${ECHO_MSG} "hlalib -> ${PREFIX}/lib/hlalib.a"
@${ECHO_MSG} ""
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
Remember to set the following environment variables:
hlainc=%%PREFIX%%/include/hla
hlalib=%%PREFIX%%/lib/hlalib.c