aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2015-11-15 18:34:08 +0800
committercy <cy@FreeBSD.org>2015-11-15 18:34:08 +0800
commit9387899fbd6e829dea8b31f91571c9d6d3111f28 (patch)
tree9a3223e31b3ead4b75b0a20506a25d1290e1d625 /lang
parentc09e4cdc89431ca40a8b7692c820748e85e40cac (diff)
downloadfreebsd-ports-gnome-9387899fbd6e829dea8b31f91571c9d6d3111f28.tar.gz
freebsd-ports-gnome-9387899fbd6e829dea8b31f91571c9d6d3111f28.tar.zst
freebsd-ports-gnome-9387899fbd6e829dea8b31f91571c9d6d3111f28.zip
Self-host dmd bootstrap (dmd 2.067.1).
Diffstat (limited to 'lang')
-rw-r--r--lang/dmd2/Makefile10
-rw-r--r--lang/dmd2/Makefile.bootstrap83
-rw-r--r--lang/dmd2/distinfo2
-rw-r--r--lang/dmd2/files/patch-src__dmd__posix.mak29
4 files changed, 120 insertions, 4 deletions
diff --git a/lang/dmd2/Makefile b/lang/dmd2/Makefile
index 737a22a971a4..41860e332c9b 100644
--- a/lang/dmd2/Makefile
+++ b/lang/dmd2/Makefile
@@ -4,10 +4,13 @@
PORTNAME= dmd
PKGNAMESUFFIX= 2
PORTVERSION= 2.069.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang
MASTER_SITES= http://ftp.digitalmars.com/
DISTNAME= dmd.${PORTVERSION}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ dmd.2.067.1${EXTRACT_SUFX}
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= cy@FreeBSD.org
COMMENT= D 2.0 compiler, not officially validated for FreeBSD
@@ -89,4 +92,9 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/*.txt ${STAGEDIR}${DOCSDIR}
cd ${WRKDIR}/dmd2 && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR}
+.if !exists(${LOCALBASE}/bin/dmd)
+pre-configure:
+ ${MAKE} -f Makefile.bootstrap BOOTDIR=${WRKDIR}
+.endif
+
.include <bsd.port.post.mk>
diff --git a/lang/dmd2/Makefile.bootstrap b/lang/dmd2/Makefile.bootstrap
new file mode 100644
index 000000000000..9beedf0bb106
--- /dev/null
+++ b/lang/dmd2/Makefile.bootstrap
@@ -0,0 +1,83 @@
+# Created by: Ruben <chromium@hybridsource.org>
+# $FreeBSD$
+
+PORTNAME= dmd
+PKGNAMESUFFIX= 2
+PORTVERSION= 2.067.1
+CATEGORIES= lang
+DISTNAME= dmd.${PORTVERSION}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+
+COMMENT= D 2.0 compiler bootstrap
+
+WRKDIR= ${BOOTDIR}/.host_dmd-2.067.1
+PATCHDIR= ${MASTERDIR}/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
+
+.include <bsd.port.pre.mk>
+
+NOT_FOR_ARCHS= powerpc
+NOT_FOR_ARCHS_REASON= not yet ported to this architecture
+
+.if ${ARCH} == "sparc64"
+BROKEN= Does not install on sparc64: divide-by-zero error
+.endif
+
+.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
+
+do-install:
+ ${INSTALL_MAN} ${WRKDIR}/dmd2/man/man1/dmd.1 ${STAGEDIR}${MANPREFIX}/man/man1/dmd.1
+ ${INSTALL_MAN} ${WRKDIR}/dmd2/man/man5/dmd.conf.5 ${STAGEDIR}${MANPREFIX}/man/man5/dmd.conf.5
+ ${INSTALL_DATA} ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd.conf ${STAGEDIR}${PREFIX}/etc/dmd.conf.sample
+ ${INSTALL_PROGRAM} ${WRKSRC}/dmd ${STAGEDIR}${PREFIX}/bin/dmd
+ ${INSTALL_DATA} ${WRKSRC}/../../freebsd/lib${MODEL}/libphobos2.a ${STAGEDIR}${PREFIX}/lib
+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKDIR}/dmd2/freebsd/bin32/dmd.conf ${STAGEDIR}${EXAMPLESDIR}/dmd32.conf
+ ${INSTALL_DATA} ${WRKDIR}/dmd2/freebsd/bin64/dmd.conf ${STAGEDIR}${EXAMPLESDIR}/dmd64.conf
+ cd ${WRKDIR}/dmd2 && ${COPYTREE_SHARE} samples ${STAGEDIR}${EXAMPLESDIR}
+ ${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
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/*.txt ${STAGEDIR}${DOCSDIR}
+ cd ${WRKDIR}/dmd2 && ${COPYTREE_SHARE} html ${STAGEDIR}${DOCSDIR}
+
+post-stage:
+ ${LN} -sf ${STAGEDIR}/${PREFIX}/bin/dmd ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd
+
+.include <bsd.port.post.mk>
diff --git a/lang/dmd2/distinfo b/lang/dmd2/distinfo
index 5ca8b0f947c6..14fb2d512c6b 100644
--- a/lang/dmd2/distinfo
+++ b/lang/dmd2/distinfo
@@ -1,2 +1,4 @@
SHA256 (dmd.2.069.1.zip) = 8c73f29fccce71bea02bdfa2521a945178e11c804e72e768fe96a1fb8d733abc
SIZE (dmd.2.069.1.zip) = 76383062
+SHA256 (dmd.2.067.1.zip) = 24fd32d3b1401309187a3fcd235014e38c651beb3af29b0e656f6f4add4ec95b
+SIZE (dmd.2.067.1.zip) = 56083735
diff --git a/lang/dmd2/files/patch-src__dmd__posix.mak b/lang/dmd2/files/patch-src__dmd__posix.mak
index d7a18f927fcf..2f48bf2cf637 100644
--- a/lang/dmd2/files/patch-src__dmd__posix.mak
+++ b/lang/dmd2/files/patch-src__dmd__posix.mak
@@ -1,6 +1,6 @@
--- ../../src/dmd/posix.mak.orig 2015-11-11 02:36:12.000000000 -0800
-+++ ../../src/dmd/posix.mak 2015-11-14 11:37:37.628381337 -0800
-@@ -57,7 +57,7 @@
++++ ../../src/dmd/posix.mak 2015-11-15 01:40:55.280252455 -0800
+@@ -57,13 +57,13 @@
else
# Auto-bootstrapping, will download dmd automatically
HOST_DMD_VER=2.067.1
@@ -9,7 +9,30 @@
# dmd.2.067.1.osx.zip or dmd.2.067.1.freebsd-64.zip
HOST_DMD_ZIP=dmd.$(HOST_DMD_VER).$(OS)$(if $(filter $(OS),freebsd),-$(MODEL),).zip
# http://downloads.dlang.org/releases/2.x/2.067.1/dmd.2.067.1.osx.zip
-@@ -423,7 +423,7 @@
+ HOST_DMD_URL=http://downloads.dlang.org/releases/2.x/$(HOST_DMD_VER)/$(HOST_DMD_ZIP)
+ HOST_DMD=$(HOST_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/dmd
+- HOST_DMD_PATH=$(HOST_DMD)
++ HOST_DMD_PATH=$(HOST_DMD_ROOT)/stage/usr/local/bin/dmd
+ HOST_DMD_RUN=$(HOST_DMD) -conf=$(dir $(HOST_DMD))dmd.conf
+ endif
+
+@@ -308,15 +308,6 @@
+ verstr.h SYSCONFDIR.imp core *.cov *.deps *.gcda *.gcno *.a
+ @[ ! -d ${PGO_DIR} ] || echo You should issue manually: rm -rf ${PGO_DIR}
+
+-######## Download and install the last dmd buildable without dmd
+-
+-ifneq (,$(AUTO_BOOTSTRAP))
+-$(HOST_DMD_PATH):
+- mkdir -p ${HOST_DMD_ROOT}
+- TMPFILE=$$(mktemp deleteme.XXXXXXXX) && curl -fsSL ${HOST_DMD_URL} > $${TMPFILE}.zip && \
+- unzip -qd ${HOST_DMD_ROOT} $${TMPFILE}.zip && rm $${TMPFILE}.zip
+-endif
+-
+ ######## generate a default dmd.conf
+
+ define DEFAULT_DMD_CONF
+@@ -423,7 +392,7 @@
$(eval bin_dir=$(if $(filter $(OS),osx), bin, bin$(MODEL)))
mkdir -p $(INSTALL_DIR)/$(OS)/$(bin_dir)
cp dmd $(INSTALL_DIR)/$(OS)/$(bin_dir)/dmd