|
Lines 1-64
Link Here
|
| 1 |
# $FreeBSD$ |
1 |
# $FreeBSD$ |
| 2 |
|
2 |
|
| 3 |
PORTNAME= ldc |
3 |
PORTNAME= ldc |
| 4 |
PORTVERSION= 1.14.0 |
4 |
PORTVERSION= 1.15.0 |
| 5 |
DISTVERSIONPREFIX= v |
5 |
DISTVERSIONPREFIX= v |
| 6 |
CATEGORIES= lang |
6 |
CATEGORIES= lang |
| 7 |
|
7 |
|
| 8 |
MAINTAINER= acm@FreeBSD.org |
8 |
MAINTAINER= acm@FreeBSD.org |
| 9 |
COMMENT= The LLVM-based D compiler |
9 |
COMMENT= The LLVM-based D compiler |
|
|
10 |
LICENSE= BSD3CLAUSE |
| 11 |
USES= ninja cmake:insource compiler |
| 12 |
CONFLICTS_INSTALL= ldc |
| 10 |
|
13 |
|
| 11 |
LICENSE= BSD3CLAUSE |
14 |
FLAVORS= llvm70 llvm80 |
|
|
15 |
FLAVOR?= ${FLAVORS[0]} |
| 12 |
|
16 |
|
| 13 |
BUILD_DEPENDS= llvm70>0:devel/llvm70 |
17 |
OPTIONS_GROUP= BOOTSTRAP |
| 14 |
RUN_DEPENDS= llvm70>0:devel/llvm70 |
18 |
BOOTSTRAP_DESC= Force using ltsmaster to bootstrap |
| 15 |
LIB_DEPENDS= libconfig.so:devel/libconfig |
19 |
OPTIONS_GROUP_BOOTSTRAP=LTSMASTER |
| 16 |
|
20 |
|
| 17 |
BROKEN_aarch64= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? |
21 |
llvm70_PKGNAMEPREFIX= llvm70- |
|
|
22 |
llvm70_BUILD_DEPENDS= llvm70>0:devel/llvm70 |
| 23 |
llvm70_RUN_DEPENDS= llvm70>0:devel/llvm70 |
| 24 |
|
| 25 |
llvm80_PKGNAMEPREFIX= llvm80- |
| 26 |
llvm80_BUILD_DEPENDS= llvm80>0:devel/llvm80 |
| 27 |
llvm80_RUN_DEPENDS= llvm80>0:devel/llvm80 |
| 28 |
|
| 29 |
PREFIX?= ${LOCALBASE}/${PKGNAMEPREFIX}${PORTNAME} |
| 30 |
PLIST_SUB= LOCALBASE=${LOCALBASE} |
| 31 |
|
| 18 |
BROKEN_armv6= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? |
32 |
BROKEN_armv6= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? |
| 19 |
BROKEN_armv7= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? |
33 |
BROKEN_armv7= fails to compile: Error: undefined identifier _jmp_buf, did you mean alias jmp_buf? |
| 20 |
BROKEN_i386= function core.bitop.bsf (uint v) is not callable using argument types (ulong) |
34 |
BROKEN_i386= function core.bitop.bsf (uint v) is not callable using argument types (ulong) |
| 21 |
BROKEN_powerpc64= fails to compile: cc1plus: error: unrecognized command line option "-std=c++11" |
35 |
BROKEN_powerpc64= fails to compile: cc1plus: error: unrecognized command line option "-std=c++11" |
| 22 |
|
36 |
|
| 23 |
USES= cmake:insource |
37 |
USE_GITHUB= yes |
| 24 |
USE_GITHUB= yes |
38 |
GH_ACCOUNT= ldc-developers |
| 25 |
GH_ACCOUNT= ldc-developers |
39 |
GH_PROJECT= ldc |
| 26 |
GH_PROJECT= ldc |
40 |
GH_TUPLE= ldc-developers:druntime:8a85f37:druntime/runtime/druntime \ |
| 27 |
GH_TUPLE= ldc-developers:ldc:911589c:tree/ltsmaster \ |
41 |
ldc-developers:phobos:981412b:phobos/runtime/phobos |
| 28 |
ldc-developers:druntime:694089c:druntimelts/ltsmaster/runtime/druntime \ |
|
|
| 29 |
ldc-developers:phobos:1d758b2:phoboslts/ltsmaster/runtime/phobos \ |
| 30 |
ldc-developers:druntime:54cb25c:druntime/runtime/druntime \ |
| 31 |
ldc-developers:phobos:71cf74f:phobos/runtime/phobos |
| 32 |
|
42 |
|
| 33 |
CMAKE_ARGS+= -DD_COMPILER:STRING="${WRKSRC}/ltsmaster/bin/ldmd2" \ |
43 |
CC= ${LOCALBASE}/bin/clang${LLVMVER} |
| 34 |
-DBUILD_SHARED_LIBS:STRING="BOTH" |
44 |
CXX= ${LOCALBASE}/bin/clang++${LLVMVER} |
|
|
45 |
LLVM_CONFIG= ${LOCALBASE}/bin/llvm-config${LLVMVER} |
| 46 |
LDCVER= ${PORTVERSION} |
| 35 |
|
47 |
|
| 36 |
CC= clang70 |
48 |
.include <bsd.port.pre.mk> |
| 37 |
CXX= clang++70 |
|
|
| 38 |
|
49 |
|
| 39 |
BOOTVER= 0.17.6 |
50 |
.if ${FLAVOR} == "llvm70" |
| 40 |
LLVM_CONFIG= llvm-config70 |
51 |
LLVMVER= 70 |
| 41 |
LDCVER= ${PORTVERSION} |
52 |
.else |
|
|
53 |
LLVMVER= 80 |
| 54 |
.endif |
| 42 |
|
55 |
|
| 43 |
.include <bsd.port.pre.mk> |
56 |
.if ${ARCH} == "amd64" || ${ARCH} == "aarch64" |
|
|
57 |
CFLAGS+= -fPIC |
| 58 |
.endif |
| 44 |
|
59 |
|
| 45 |
.if ${ARCH} == "amd64" |
60 |
# Search for a usable bootstrap compiler or fall back to building ltsmaster |
| 46 |
CFLAGS+= -fPIC |
61 |
DRUNTIME_MINVER= 20680 |
|
|
62 |
DRUNTIME_MAXVER= 20841 |
| 63 |
|
| 64 |
DCOMPILERS= ldmd2 gdmd dmd |
| 65 |
|
| 66 |
.if empty(PORT_OPTIONS:MLTSMASTER) |
| 67 |
.for DC_TRY in ${DCOMPILERS} |
| 68 |
.if !defined(DC_HOST) |
| 69 |
VERSION!= `which ${DC_TRY}` --version | ${SED} -n 's!^.*DMD.*v\([0-9]\).\([0-9][0-9][0-9]\).\([0-9]\).*!\1\2\3!p' |
| 70 |
.if ${VERSION} > ${DRUNTIME_MINVER} && ${VERSION} <= ${DRUNTIME_MAXVER} |
| 71 |
DC_HOST!= which ${DC_TRY} |
| 72 |
BUILD_BOOTSTRAP= no |
| 47 |
.endif |
73 |
.endif |
|
|
74 |
.endif |
| 75 |
.endfor |
| 76 |
.endif |
| 48 |
|
77 |
|
| 49 |
.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1200029 |
78 |
# falling back to creating bootstrap d-compiler |
| 50 |
EXTRA_PATCHES= ${PATCHDIR}/fbsd12-* |
79 |
.if !defined (DC_HOST) |
|
|
80 |
BUILD_BOOTSTRAP= yes |
| 81 |
BOOTSTRAP_DIR= ${WRKDIRPREFIX}${.CURDIR}/work-bootstrap |
| 82 |
DC_HOST= ${BOOTSTRAP_DIR}/ltsmaster/bin/ldmd2 |
| 83 |
BUILD_BOOTSTRAP= yes |
| 51 |
.endif |
84 |
.endif |
| 52 |
|
85 |
|
| 53 |
post-patch: |
86 |
CMAKE_ARGS+= -DLDC_INSTALL_PREFIX="${PREFIX}" \ |
| 54 |
${REINPLACE_CMD} -e 's|$${llvm_config_names}|${LLVM_CONFIG}|g' \ |
87 |
-DD_COMPILER:STRING="${DC_HOST}" \ |
| 55 |
${WRKSRC}/ltsmaster/cmake/Modules/FindLLVM.cmake \ |
88 |
-DCMAKE_C_COMPILER:STRING="${CC}" \ |
| 56 |
${WRKSRC}/cmake/Modules/FindLLVM.cmake |
89 |
-DCMAKE_CXX_COMPILER:STRING="${CXX}" \ |
|
|
90 |
-DLLVM_CONFIG:PATH=${LLVM_CONFIG} \ |
| 91 |
-DBUILD_SHARED_LIBS:STRING="BOTH" |
| 57 |
|
92 |
|
|
|
93 |
pre-build: |
| 94 |
@echo "DEBUG: bootstrap:${BUILD_BOOTSTRAP} dmd:${DC_HOST} ver:${VERSION} options:${PORT_OPTIONS} flavor:${FLAVOR}" |
| 95 |
|
| 96 |
.if ${BUILD_BOOTSTRAP} == "yes" |
| 58 |
pre-configure: |
97 |
pre-configure: |
| 59 |
@cd ${WRKSRC}/ltsmaster && \ |
98 |
@echo "Building Bootstrap d-compiler..." |
| 60 |
${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} . |
99 |
${MAKE} -f Makefile.bootstrap FLAVOR=bootstrap |
| 61 |
@cd ${WRKSRC}/ltsmaster && \ |
100 |
.else |
| 62 |
${SETENV} ${MAKE_ENV} ${MAKE} |
101 |
@echo "Reusing pre-existing d-compiler..." |
|
|
102 |
.endif |
| 63 |
|
103 |
|
| 64 |
.include <bsd.port.post.mk> |
104 |
.include <bsd.port.post.mk> |