2018-02-21 18:58:56 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= ponyc
|
2019-08-12 14:17:48 +02:00
|
|
|
DISTVERSION= 0.30.0
|
2018-02-21 18:58:56 +01:00
|
|
|
CATEGORIES= lang
|
|
|
|
|
|
|
|
MAINTAINER= greg@unrelenting.technology
|
|
|
|
COMMENT= Pony language compiler
|
|
|
|
|
|
|
|
LICENSE= BSD2CLAUSE
|
|
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
|
|
|
|
2018-06-29 09:31:24 +02:00
|
|
|
ONLY_FOR_ARCHS= aarch64 amd64
|
2018-02-21 18:58:56 +01:00
|
|
|
ONLY_FOR_ARCHS_REASON= Undefined reference to __atomic_compare_exchange_8
|
|
|
|
|
|
|
|
BUILD_DEPENDS= llvm-link${LLVM_VERSION}:devel/llvm${LLVM_VERSION}
|
|
|
|
RUN_DEPENDS= llvm-link${LLVM_VERSION}:devel/llvm${LLVM_VERSION}
|
|
|
|
|
|
|
|
USES= gmake ncurses compiler:c++11-lang
|
|
|
|
|
2019-03-20 13:23:25 +01:00
|
|
|
LLVM_VERSION?= 70
|
2018-02-21 18:58:56 +01:00
|
|
|
|
2018-08-12 15:16:00 +02:00
|
|
|
PLIST_SUB= VERSION="${DISTVERSION}" PONYARCH="${PONYARCH}"
|
2018-10-19 00:24:44 +02:00
|
|
|
OPTIONS_SUB= yes
|
2018-02-21 18:58:56 +01:00
|
|
|
|
|
|
|
USE_GITHUB= yes
|
|
|
|
GH_ACCOUNT= ponylang
|
|
|
|
|
|
|
|
PORTDOCS= *.md
|
|
|
|
|
2018-10-19 00:24:44 +02:00
|
|
|
MAKE_ENV= config=release verbose=true default_pic=true \
|
|
|
|
prefix=${PREFIX} arch=${PONYARCH} \
|
|
|
|
LLVM_CONFIG=llvm-config${LLVM_VERSION}
|
|
|
|
|
|
|
|
OPTIONS_DEFINE= DOCS EXAMPLES DTRACE
|
|
|
|
OPTIONS_EXCLUDE_aarch64= DTRACE
|
|
|
|
# Not enabling DTrace by default yet because it breaks --runtimebc ("super LTO"):
|
|
|
|
# https://github.com/ponylang/ponyc/issues/2915
|
2018-08-28 07:05:17 +02:00
|
|
|
|
2018-10-19 00:24:44 +02:00
|
|
|
DTRACE_MAKE_ENV= use=dtrace
|
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
2018-08-12 15:16:00 +02:00
|
|
|
|
|
|
|
# Pony defaults to 'native', which
|
|
|
|
# a) doesn't work on aarch64
|
|
|
|
# b) is not appropriate for official OS packages
|
|
|
|
.if "${ARCH}" == aarch64
|
|
|
|
PONYARCH?= armv8-a
|
|
|
|
.elif "${ARCH}" == amd64
|
|
|
|
# Can't use 'x86-64' because atomics are required
|
|
|
|
PONYARCH?= core2
|
|
|
|
.endif
|
2018-02-21 18:58:56 +01:00
|
|
|
|
2019-01-24 06:09:48 +01:00
|
|
|
# keep in sync with all platforms where libunwind is available
|
2019-01-27 15:35:19 +01:00
|
|
|
.if (${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == aarch64)
|
2019-01-24 06:09:48 +01:00
|
|
|
LIB_DEPENDS+= libunwind.so:devel/libunwind
|
|
|
|
.endif
|
|
|
|
|
2018-10-19 00:24:44 +02:00
|
|
|
.if ${CHOSEN_COMPILER_TYPE} == clang
|
2019-08-12 14:17:48 +02:00
|
|
|
# Building the bitcode with clangX and linking with llvmY often fails,
|
2019-01-26 13:29:22 +01:00
|
|
|
# so let's use the clang from the LLVM version that will be used by ponyc
|
|
|
|
CC= ${LOCALBASE}/bin/clang${LLVM_VERSION}
|
|
|
|
CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION}
|
2018-10-19 00:24:44 +02:00
|
|
|
MAKE_ENV+= runtime-bitcode=yes
|
|
|
|
PLIST_SUB+= BITCODE=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= BITCODE="@comment "
|
|
|
|
.endif
|
|
|
|
|
2018-02-21 18:58:56 +01:00
|
|
|
post-install:
|
2018-06-04 19:44:44 +02:00
|
|
|
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/pony/${DISTVERSION}/bin/ponyc
|
2018-02-21 18:58:56 +01:00
|
|
|
|
|
|
|
post-install-DOCS-on:
|
|
|
|
${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/*.md ${STAGEDIR}${DOCSDIR}
|
|
|
|
|
|
|
|
post-install-EXAMPLES-on:
|
|
|
|
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
|
|
|
@(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
|
|
|
|
|
2018-10-19 00:24:44 +02:00
|
|
|
.include <bsd.port.post.mk>
|