aboutsummaryrefslogtreecommitdiffstats
path: root/lang/dmd2
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2015-02-25 08:30:55 +0800
committercy <cy@FreeBSD.org>2015-02-25 08:30:55 +0800
commit04a7a4828d542da331c293bdf0f11e175bcc41b5 (patch)
treec8e68f3b9b0216dda5e8389913d4685ce543b1a8 /lang/dmd2
parenta2a014547f1ec54da77f69fcf4749eee73605eab (diff)
downloadfreebsd-ports-gnome-04a7a4828d542da331c293bdf0f11e175bcc41b5.tar.gz
freebsd-ports-gnome-04a7a4828d542da331c293bdf0f11e175bcc41b5.tar.zst
freebsd-ports-gnome-04a7a4828d542da331c293bdf0f11e175bcc41b5.zip
By default dmd uses gcc to invoke the linker. Fix linking on
FreeBSD systems that use clang as the system compiler (FreeBSD 10+).
Diffstat (limited to 'lang/dmd2')
-rw-r--r--lang/dmd2/Makefile19
-rw-r--r--lang/dmd2/files/patch-freebsd__bin32__dmd.conf9
-rw-r--r--lang/dmd2/files/patch-freebsd__bin64__dmd.conf8
-rw-r--r--lang/dmd2/files/patch-linux-bin32-dmd.conf8
-rw-r--r--lang/dmd2/files/patch-src__dmd__link.c11
-rw-r--r--lang/dmd2/pkg-plist3
6 files changed, 39 insertions, 19 deletions
diff --git a/lang/dmd2/Makefile b/lang/dmd2/Makefile
index ce16d489a7a5..706fa596ffcb 100644
--- a/lang/dmd2/Makefile
+++ b/lang/dmd2/Makefile
@@ -4,6 +4,7 @@
PORTNAME= dmd
PKGNAMESUFFIX= 2
PORTVERSION= 2.066.1
+PORTREVISION= 1
CATEGORIES= lang
MASTER_SITES= http://ftp.digitalmars.com/
DISTNAME= dmd.${PORTVERSION}
@@ -40,8 +41,10 @@ BROKEN= Does not install on sparc64: divide-by-zero error
.if ${ARCH} == "amd64"
MAKE_ARGS+= MODEL=64
+MODEL= 64
.else
MAKE_ARGS+= MODEL=32
+MODEL= 32
.endif
.if defined(WITH_DEBUG)
@@ -63,22 +66,18 @@ post-patch:
@${REINPLACE_CMD} -e "s|%@P%/../../src/phobos|${MODULEDIR}|" \
-e "s|%@P%/../lib|${PREFIX}/lib|" \
-e "s|%@P%/../../src/druntime|${PREFIX}/include/d/druntime|" \
- ${WRKDIR}/dmd2/linux/bin32/dmd.conf
- @${ECHO_CMD} >> ${WRKDIR}/dmd2/linux/bin32/dmd.conf
- @${SED} -e "s|Environment32|Environment64|" ${WRKDIR}/dmd2/linux/bin32/dmd.conf >>${WRKDIR}/dmd2/linux/bin32/dmd.conf
+ ${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/linux/bin32/dmd.conf ${STAGEDIR}${PREFIX}/etc/dmd.conf.sample
+ ${INSTALL_DATA} ${WRKDIR}/dmd2/freebsd/bin${MODEL}/dmd.conf ${STAGEDIR}${PREFIX}/etc/dmd.conf.sample
${INSTALL_PROGRAM} ${WRKSRC}/dmd ${STAGEDIR}${PREFIX}/bin/dmd
-.if ${ARCH} == "amd64"
- ${INSTALL_DATA} ${WRKSRC}/../../freebsd/lib64/libphobos2.a ${STAGEDIR}${PREFIX}/lib
-.else
- ${INSTALL_DATA} ${WRKSRC}/../../freebsd/lib32/libphobos2.a ${STAGEDIR}${PREFIX}/lib
-.endif
+ ${INSTALL_DATA} ${WRKSRC}/../../freebsd/lib${MODEL}/libphobos2.a ${STAGEDIR}${PREFIX}/lib
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
- ${INSTALL_DATA} ${WRKDIR}/dmd2/linux/bin32/dmd.conf ${STAGEDIR}${EXAMPLESDIR}/dmd.conf
+ ${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}
diff --git a/lang/dmd2/files/patch-freebsd__bin32__dmd.conf b/lang/dmd2/files/patch-freebsd__bin32__dmd.conf
new file mode 100644
index 000000000000..376d1279ec3d
--- /dev/null
+++ b/lang/dmd2/files/patch-freebsd__bin32__dmd.conf
@@ -0,0 +1,9 @@
+--- ../../freebsd/bin32/dmd.conf.orig 2014-10-15 19:23:36.000000000 -0700
++++ ../../freebsd/bin32/dmd.conf 2015-02-24 16:02:48.323239133 -0800
+@@ -1,5 +1,2 @@
+ [Environment32]
+-DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic
+-
+-[Environment64]
+-DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic
++DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib -L--export-dynamic
diff --git a/lang/dmd2/files/patch-freebsd__bin64__dmd.conf b/lang/dmd2/files/patch-freebsd__bin64__dmd.conf
new file mode 100644
index 000000000000..db9d2c889b9a
--- /dev/null
+++ b/lang/dmd2/files/patch-freebsd__bin64__dmd.conf
@@ -0,0 +1,8 @@
+--- ../../freebsd/bin64/dmd.conf.orig 2014-10-15 19:23:36.000000000 -0700
++++ ../../freebsd/bin64/dmd.conf 2015-02-24 16:08:20.814712651 -0800
+@@ -2,4 +2,4 @@
+ DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib32 -L--export-dynamic
+
+ [Environment64]
+-DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L--export-dynamic
++DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib -L--export-dynamic
diff --git a/lang/dmd2/files/patch-linux-bin32-dmd.conf b/lang/dmd2/files/patch-linux-bin32-dmd.conf
deleted file mode 100644
index 610823a42986..000000000000
--- a/lang/dmd2/files/patch-linux-bin32-dmd.conf
+++ /dev/null
@@ -1,8 +0,0 @@
---- ../../linux/bin32/dmd.conf.orig 2012-04-15 22:12:01.771713192 -0700
-+++ ../../linux/bin32/dmd.conf 2012-04-15 22:17:51.647954697 -0700
-@@ -1,4 +1,4 @@
-
- [Environment]
-
--DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L%@P%/../lib64 -L--no-warn-search-mismatch -L--export-dynamic
-+DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib -L--no-warn-search-mismatch -L--export-dynamic
diff --git a/lang/dmd2/files/patch-src__dmd__link.c b/lang/dmd2/files/patch-src__dmd__link.c
new file mode 100644
index 000000000000..449e9d89dc7c
--- /dev/null
+++ b/lang/dmd2/files/patch-src__dmd__link.c
@@ -0,0 +1,11 @@
+--- ../../src/dmd/link.c.orig 2014-10-15 19:23:32.000000000 -0700
++++ ../../src/dmd/link.c 2015-02-24 16:12:51.633410115 -0800
+@@ -446,7 +446,7 @@
+
+ const char *cc = getenv("CC");
+ if (!cc)
+- cc = "gcc";
++ cc = "cc";
+ argv.push(cc);
+ argv.insert(1, global.params.objfiles);
+
diff --git a/lang/dmd2/pkg-plist b/lang/dmd2/pkg-plist
index 0bc78551da11..091a1ba8e003 100644
--- a/lang/dmd2/pkg-plist
+++ b/lang/dmd2/pkg-plist
@@ -1,7 +1,8 @@
bin/dmd
lib/libphobos2.a
@sample etc/dmd.conf.sample
-%%EXAMPLESDIR%%/dmd.conf
+%%EXAMPLESDIR%%/dmd32.conf
+%%EXAMPLESDIR%%/dmd64.conf
%%EXAMPLESDIR%%/samples/d/all.sh
%%EXAMPLESDIR%%/samples/d/build.bat
%%EXAMPLESDIR%%/samples/d/chello.d