1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00
freebsd-ports/lang/dmd2/Makefile.bootstrap
Cy Schubert b1dbe6d06c Modernize dmd2:
- Removal of three patches; call bootstrap directly.
- Distinfo for bootstrap is now in its own distfile.
- Make examples optional.
- Use GH instead of distrubuted .zip file.
- Fully implement options helpers.

PR:		217076
Submitted by:	John Colvin <john.loughran.colvin@gmail.com>
2017-02-14 06:27:28 +00:00

83 lines
2.8 KiB
Makefile

# Created by: Ruben <chromium@hybridsource.org>
# $FreeBSD$
PORTNAME= dmd
PORTVERSION= 2.067.1
MASTER_SITES= http://ftp.digitalmars.com/
CATEGORIES= lang
PKGNAMESUFFIX= 2
DISTNAME= dmd.${PORTVERSION}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
DISTINFO_FILE= ${MASTERDIR}/distinfo.bootstrap
MAINTAINER= cy@FreeBSD.org
COMMENT= D 2.0 compiler bootstrap
WRKDIR= ${BOOTDIR}/.host_dmd-2.067.1
PATCHDIR= ${MASTERDIR}/files.bootstrap
USES= gmake zip
MAKEFILE= posix.mak
EXAMPLESDIR= ${PREFIX}/share/examples/dmd2
DOCSDIR= ${PREFIX}/share/doc/dmd2
PORTDOCS= *.txt html/
WRKSRC= ${WRKDIR}/dmd2/src/${PORTNAME}
.undef DEVELOPER
BROKEN_sparc64= Does not install: divide-by-zero error
.include <bsd.port.pre.mk>
.if ${ARCH} == "amd64"
MAKE_ARGS+= MODEL=64
MODEL= 64
.else
MAKE_ARGS+= MODEL=32
MODEL= 32
.endif
MODULEDIR= ${PREFIX}/include/d/phobos2
post-patch:
@${REINPLACE_CMD} -e "s|g++|${CXX}|" ${WRKSRC}/posix.mak
@${REINPLACE_CMD} -e "s|cc|${CC}|" ${WRKSRC}/../phobos/posix.mak
@${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|" \
-e "s|\(dmd\)|\12|gI" \
-e "s|\\\BR|.BR|" \
${WRKDIR}/dmd2/man/man1/dmd.1 \
${WRKDIR}/dmd2/man/man5/dmd.conf.5
@${REINPLACE_CMD} -e '/^SYSCONFDIR=/s|/etc/|${STAGEDIR}${PREFIX}/etc/|' ${WRKSRC}/posix.mak
@${REINPLACE_CMD} -e "s|%@P%/../../src/phobos|${STAGEDIR}${MODULEDIR}|" \
-e "s|%@P%/../lib32|${STAGEDIR}${PREFIX}/lib|" \
-e "s|%@P%/../lib64|${STAGEDIR}${PREFIX}/lib|" \
-e "s|%@P%/../../src/druntime|${STAGEDIR}${PREFIX}/include/d/druntime|" \
${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd.conf
@${ECHO_CMD} >> ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd.conf
make-phobos:
cd ${WRKSRC}/../phobos && ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} -f ${MAKEFILE} ${BUILD}
make-druntime:
cd ${WRKSRC}/../druntime && ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} -f ${MAKEFILE} ${BUILD}
make-dmd:
cd ${WRKSRC} && ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} -f ${MAKEFILE} ${BUILD}
do-build: make-dmd make-phobos make-druntime
do-install:
${INSTALL_DATA} ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd.conf ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/dmd ${STAGEDIR}${PREFIX}/bin/dmd
${INSTALL_DATA} ${WRKSRC}/../../freebsd/lib${MODEL}/libphobos2.a ${STAGEDIR}${PREFIX}/lib
${MKDIR} ${STAGEDIR}${MODULEDIR}/etc/c
${INSTALL_DATA} ${WRKSRC}/../phobos/*.d ${STAGEDIR}${MODULEDIR}
${INSTALL_DATA} ${WRKSRC}/../phobos/etc/c/zlib.d ${STAGEDIR}${MODULEDIR}/etc/c
${INSTALL_DATA} ${WRKSRC}/../phobos/etc/c/curl.d ${STAGEDIR}${MODULEDIR}/etc/c
${INSTALL_DATA} ${WRKSRC}/../phobos/etc/c/sqlite3.d ${STAGEDIR}${MODULEDIR}/etc/c
cd ${WRKSRC}/../phobos && ${COPYTREE_SHARE} std ${STAGEDIR}${MODULEDIR}
${MKDIR} ${STAGEDIR}${MODULEDIR}/../druntime
cd ${WRKSRC}/../druntime && ${COPYTREE_SHARE} import ${STAGEDIR}${MODULEDIR}/../druntime
${LN} -sf ${STAGEDIR}/${PREFIX}/bin/dmd ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd
.include <bsd.port.post.mk>