Index: head/lang/ghc/Makefile =================================================================== --- head/lang/ghc/Makefile (revision 478530) +++ head/lang/ghc/Makefile (revision 478531) @@ -1,280 +1,313 @@ # Created by: Simon Marlow # $FreeBSD$ PORTNAME= ghc PORTVERSION= ${GHC_VERSION} PORTREVISION= 1 CATEGORIES= lang haskell MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ LOCAL/arrowd/:boot DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source MAINTAINER= haskell@FreeBSD.org COMMENT= Compiler for the functional language Haskell LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 GHC_VERSION= 8.4.3 HSCOLOUR_VERSION= 1.24.4 DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* LIB_DEPENDS+= libgmp.so:math/gmp USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz USE_LOCALE= en_US.UTF-8 USE_PERL5= build NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied # The configure process accepts,filters and canonicalises # the CONFIGURE_TARGET variable. You can read the files # ${WRKSRC}/configure and ${WRKSRC}/config.sub. # This is better fixed in files/build.mk.in GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-gmp-includes=${LOCALBASE}/include \ --with-gmp-libraries=${LOCALBASE}/lib \ --with-iconv-includes=${LOCALBASE}/include \ --with-iconv-libraries=${LOCALBASE}/lib SUB_FILES= build.mk \ build.boot.mk SUB_LIST= GHC_VERSION=${GHC_VERSION} \ NCURSESINC="${NCURSESBASE}/include" NCURSESLIB="${NCURSESLIB}" \ CFLAGS="${CFLAGS}" OPTIONS_GROUP= BOOTSTRAP BOOTSTRAP_DESC= Bootsrap using installed ghc OPTIONS_GROUP_BOOTSTRAP=BOOT BOOTH OPTIONS_DEFINE= DYNAMIC PROFILE DOCS OPTIONS_SUB= yes OPTIONS_DEFAULT= PROFILE DYNAMIC +# ghci segfaults on arm when dynamic linking is used +OPTIONS_EXCLUDE_armv6= DYNAMIC +OPTIONS_EXCLUDE_armv7= DYNAMIC +OPTIONS_EXCLUDE_aarch64= DYNAMIC BOOT_DESC= Use installed GHC for bootstrapping BOOTH_DESC= Use installed HsColour for bootstrapping PROFILE_DESC= Add support for performance profiling DYNAMIC_DESC= Add support for dynamic linking DOCS_DESC= Install HTML documentation DYNAMIC_CONFIGURE_ARGS= --with-system-libffi \ --with-ffi-includes=${LOCALBASE}/include \ --with-ffi-libraries=${LOCALBASE}/lib # The version number is needed as lang/gcc installs a different version DYNAMIC_LIB_DEPENDS= libffi.so.6:devel/libffi # Append substitutions for build.mk -- the files uses '#' as comments BOOT_SUB_LIST= HSC2HS=${LOCALBASE}/bin/hsc2hs BOOT_SUB_LIST_OFF= HSC2HS=${BOOT_HSC2HS} DOCS_BUILD_DEPENDS+= sphinx-build:textproc/py-sphinx DYNAMIC_SUB_LIST= WITH_DYNAMIC="" DYNAMIC_SUB_LIST_OFF= WITH_DYNAMIC="\#" PROFILE_SUB_LIST= WITH_PROFILE="" PROFILE_SUB_LIST_OFF= WITH_PROFILE="\#" DOCS_SUB_LIST= WITH_DOCS="YES" DOCS_SUB_LIST_OFF= WITH_DOCS="NO" LOCALBASE?= /usr/local .include .if empty(PORT_OPTIONS:MBOOT) BOOT_GHC_VERSION= 8.4.2 DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot .endif # MBOOT +.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 +# CONFIGURE_TARGET must to be the same as the llvm triple +CONFIGURE_TARGET= ${ARCH}-unknown-freebsd${"${ARCH:Maarch64}" != "":?:-gnueabihf} +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-aclocal.m4 +BUILD_DEPENDS+= ld.gold:devel/binutils \ + llc50:devel/llvm50 +RUN_DEPENDS+= ld.gold:devel/binutils \ + llc50:devel/llvm50 +USE_GCC= yes +CONFIGURE_ENV+= OPT=opt50 LLC=llc50 + +. if ${OSVERSION} < 1200064 +IGNORE= lang/ghc on ARM requires at least __FreeBSD_version 1200064 +. endif + +. ifdef QEMU_EMULATING +IGNORE= qemu-user-static isn't able to build lang/ghc, but it builds fine on a real hardware +. endif +.endif + # Turn off for a while, see PR 228727 CONFIGURE_ARGS+= --enable-dtrace=0 .if ${OSVERSION} < 1200000 USE_GCC= yes .else LD= ld.bfd .endif CONFIGURE_ENV+= CC=${CC} LD=${LD} DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} HACKAGE_SITE?= http://hackage.haskell.org/package/ .if empty(PORT_OPTIONS:MBOOT) BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-boot BOOT_GHC= ${BOOT_DIR}/bin/ghc-${BOOT_GHC_VERSION} BOOT_GHC-PKG= ${BOOT_DIR}/bin/ghc-pkg-${BOOT_GHC_VERSION} BOOT_HSC2HS= ${BOOT_DIR}/bin/hsc2hs SLAVE_CMD= ${SETENV} PATH=${BOOT_DIR}/bin:${PATH} CONFIGURE_ARGS_BOOT+= --prefix=${BOOT_DIR} CONFIGURE_ARGS+= --with-ghc=${BOOT_GHC} .else # MBOOT SLAVE_CMD= # empty CONFIGURE_ARGS+= --with-ghc=${LOCALBASE}/bin/ghc .endif # MBOOT # override TMPDIR because /tmp often doesn't have enough space # to build some of the larger libraries. TMPDIR= ${WRKSRC}/tmp # Defining with documentation: # An in place installation and registration of hscolour will be # activated. In this way it's possible to use it directly into # the build tree, without needing to install it. At the end # you could view the output of: ${BOOT_GHC} describe hscolour .if ${PORT_OPTIONS:MDOCS} . if empty(PORT_OPTIONS:MBOOTH) MASTER_SITES+= ${HACKAGE_SITE}hscolour-${HSCOLOUR_VERSION}/:docs DISTFILES+= hscolour-${HSCOLOUR_VERSION}.tar.gz:docs EXTRACT_ONLY= ${_DISTFILES:C/hscolour.*$//g} . endif # MBOOTH . if empty(PORT_OPTIONS:MBOOTH) SLAVES_PREFIX= ${WRKDIR}/slaves_prefix SLAVES_WRKDIRPREFIX= ${WRKDIR}/slaves_wrkdirprefix MAKE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} CONFIGURE_ENV+= PATH=${SLAVES_PREFIX}/bin:${PATH} . endif # MBOOTH .endif # MDOCS post-extract: -.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 +# don't use the "wrap" trick on arches that use post-ino64 bootstrap binaries (arm*) +.if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200031 && \ + ${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 @${REINPLACE_CMD} -e 's|@SettingsCCompilerLinkFlags@|& -Wl,--wrap=readdir_r,--wrap=stat,--wrap=lstat,--wrap=fstat,--wrap=mknod|' ${BOOT_DIR}/settings.in .endif # %%PORTDOCS%%%%DOCSDIR%%/html/libraries/doc-index-V.html post-install-script: ${FIND} -ds ${GHC_LIBDIR} -type f -print | ${SED} -E \ -e 's,^${STAGEDIR}${PREFIX}/?,,' \ -e '/^${GHC_LIBDIR:C/\//\\\//g}\/package.conf.d\/package\.cache/s|^|@comment |g' \ >> ${TMPPLIST} ${FIND} -ds ${STAGEDIR}${DOCSDIR} -type f -print | ${SED} -E \ -e 's,^${STAGEDIR}${PREFIX}/?,,' \ -e '/^${STAGEDIR:C/\//\\\//g}${DOCSDIR:C/\//\\\//g}\/html\/libraries\/doc-index-[^.]+\.html/s|^|@comment |g' \ -e '/^${STAGEDIR:C/\//\\\//g}${DOCSDIR:C/\//\\\//g}\/html\/libraries\/index[^\/.]*\.html/s|^|@comment|g' \ -e '/^${STAGEDIR:C/\//\\\//g}${DOCSDIR:C/\//\\\//g}\/html\/libraries\/[^\/]+\.png/s|^|@comment |g' \ >> ${TMPPLIST} .if ${PORT_OPTIONS:MDOCS} # Cleanup the indexen created by gen_contents_index ${ECHO} "@postunexec ${RM} %D/${DOCSDIR_REL}/html/libraries/doc-index-*.html" >> ${TMPPLIST} ${ECHO} "@postunexec ${RM} %D/${DOCSDIR_REL}/html/libraries/index*.html" >> ${TMPPLIST} ${ECHO} "@postunexec ${RM} %D/${DOCSDIR_REL}/html/libraries/*.png" >> ${TMPPLIST} .endif ${ECHO} '@postunexec ${RM} %D/${GHC_LIBDIR_REL}/package.conf.d/package.cache' >>${TMPPLIST} ${ECHO} "@postexec %D/bin/ghc-pkg recache" >>${TMPPLIST} .if ${PORT_OPTIONS:MDOCS} ${ECHO} '@postexec ${SH} -c "cd %D/${DOCSDIR_REL}/html/libraries && ./gen_contents_index"' >> ${TMPPLIST} .endif post-patch: @${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; \ s|%%AR%%|${AR}|; \ s|%%LD%%|${LD}|' \ ${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs +# we must use binutils:ld on arm +.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 + @${REINPLACE_CMD} -e 's|LD_NO_GOLD=ld|LD_NO_GOLD=${LOCALBASE}/bin/ld|' \ + ${WRKSRC}/aclocal.m4 +.endif + .if empty(PORT_OPTIONS:MBOOT) @${REINPLACE_CMD} -e '/^mandir/d' ${BOOT_DIR}/mk/build.mk @${REINPLACE_CMD} -e '/^infodir/d' ${BOOT_DIR}/mk/build.mk @${REINPLACE_CMD} -e '/^docdir/d' ${BOOT_DIR}/mk/build.mk @${REINPLACE_CMD} -e '/^htmldir/d' ${BOOT_DIR}/mk/build.mk .endif pre-configure: apply-slist # Copy the subbed build.mk to the proper position ${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk @${MKDIR} ${TMPDIR} .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ - ${OSVERSION} >= 1200031 + ${OSVERSION} >= 1200031 && \ + ${ARCH} != aarch64 && ${ARCH} != armv6 && ${ARCH} != armv7 ${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ ${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ done rm ${BOOT_DIR}/wrap.o .endif # Do not merge, prev condition need to grow OSVER check. .if empty(PORT_OPTIONS:MBOOT) @(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ${CONFIGURE_CMD} ${CONFIGURE_ARGS_BOOT}) @(cd ${BOOT_DIR} && PACKAGES='' ${MAKE_CMD} install) .endif .if ${PORT_OPTIONS:MDOCS} && empty(PORT_OPTIONS:MBOOTH) @${ECHO_MSG} -e "\a" @${ECHO_MSG} "======================================================================" @${ECHO_MSG} " WARNING: Now HsColour will be built, the respective port will not " @${ECHO_MSG} " be installed, but an in-place installation and " @${ECHO_MSG} " registration of both takes place. " @${ECHO_MSG} "======================================================================" @${ECHO_MSG} "" . if !(defined(PACKAGE_BUILDING) || defined(BATCH)) @sleep 3 . endif @${MKDIR} ${SLAVES_PREFIX} @${MKDIR} ${SLAVES_WRKDIRPREFIX} @(cd ${SLAVES_WRKDIRPREFIX} && \ ${TAR} xvf ${DISTDIR}/hscolour-${HSCOLOUR_VERSION}.tar.gz && \ cd hscolour-${HSCOLOUR_VERSION} && \ ${SLAVE_CMD} ghc --make -o Setup Setup.hs -package Cabal && \ ${SLAVE_CMD} ./Setup configure --ghc --prefix=${SLAVES_PREFIX} --with-gcc=${CC} --with-ld=${LD} && \ ${SLAVE_CMD} ./Setup build && \ ${SLAVE_CMD} ./Setup install) .endif _EXECUTABLES= ${GHC_LIBDIR}/bin/unlit \ ${GHC_LIBDIR}/bin/hpc \ ${GHC_LIBDIR}/bin/ghc-iserv \ ${GHC_LIBDIR}/bin/ghc-pkg \ ${GHC_LIBDIR}/bin/hsc2hs \ ${GHC_LIBDIR}/bin/runghc \ ${GHC_LIBDIR}/bin/ghc \ ${GHC_LIBDIR}/bin/hp2ps .if ${PORT_OPTIONS:MPROFILE} _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-prof .endif .if ${PORT_OPTIONS:MDYNAMIC} _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-dyn .endif .if ${PORT_OPTIONS:MDOCS} _EXECUTABLES+= ${GHC_LIBDIR}/bin/haddock .endif post-install: ${RM} ${STAGEDIR}${PREFIX}/bin/haddock .if ${PORT_OPTIONS:MDOCS} ${LN} -sf haddock-ghc-${GHC_VERSION} ${STAGEDIR}${PREFIX}/bin/haddock .endif (for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \ ${STRIP_CMD} $$f; done) .include # Create a bootstrap compiler tar ball: run this in an interactive poudriere jail .PHONY: create-bootstrap create-bootstrap: cd ${WRKSRC} \ && gmake binary-dist TAR_COMP=xz \ && mv ${WRKSRC}/ghc-${GHC_VERSION}-${ARCH}-portbld-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz && sha256 ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz && stat -f %z ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz Index: head/lang/ghc/bsd.cabal.mk =================================================================== --- head/lang/ghc/bsd.cabal.mk (revision 478530) +++ head/lang/ghc/bsd.cabal.mk (revision 478531) @@ -1,347 +1,344 @@ # $FreeBSD$ # # bsd.cabal.mk -- Support for ports based on Haskell Cabal. # # Created by: Gabor Pali , # Based on works of Giuseppe Pilichi and Ashish Shukla. # # Maintained by: haskell@FreeBSD.org # PACKAGE= ${PORTNAME}-${PORTVERSION} .if !defined(METAPORT) && !defined(USE_GITHUB) MASTER_SITES?= http://hackage.haskell.org/package/${PACKAGE}/:hackage DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}:hackage EXTRACT_ONLY?= ${DISTNAME}${EXTRACT_SUFX} .endif .if defined(METAPORT) USES+= metaport .else DIST_SUBDIR?= cabal .endif # !METAPORT USE_LOCALE?= en_US.UTF-8 MAKE_ENV+= DESTDIR=${STAGEDIR} TMPDIR=${TMPDIR} SETUP_CMD?= ./setup ALEX_CMD?= ${LOCALBASE}/bin/alex HAPPY_CMD?= ${LOCALBASE}/bin/happy C2HS_CMD?= ${LOCALBASE}/bin/c2hs CPPHS_CMD?= ${LOCALBASE}/bin/cpphs # ./usr/local/lib/cabal/ghc-8.0.2/x86_64-freebsd-ghc-8.0.2/libHStransformers-compat-0.5.1.4-IuF CABAL_DIRS+= ${DATADIR} ${EXAMPLESDIR} \ ${CABAL_LIBDIR}/${CABAL_LIBSUBDIR} \ ${CABAL_LIBDIR}/${CABAL_ARCHSUBDIR} \ ${DOCSDIR} GHC_HADDOCK_CMD=${LOCALBASE}/bin/haddock-ghc-${GHC_VERSION} CABAL_DOCSDIR= ${PREFIX}/share/doc/cabal/ghc-${GHC_VERSION} CABAL_DOCSDIR_REL= ${CABAL_DOCSDIR:S,^${PREFIX}/,,} DATADIR= ${PREFIX}/share/cabal/ghc-${GHC_VERSION}/${PACKAGE} DOCSDIR= ${CABAL_DOCSDIR}/${PACKAGE} EXAMPLESDIR= ${PREFIX}/share/examples/cabal/ghc-${GHC_VERSION}/${PACKAGE} GHC_LIB_DOCSDIR_REL= share/doc/ghc-${GHC_VERSION}/html/libraries CABAL_LIBDIR= ${PREFIX}/lib/cabal/ghc-${GHC_VERSION} CABAL_LIBSUBDIR= ${PACKAGE} -CABAL_ARCH= x86_64 -.if ("${ARCH}" == "i386") -CABAL_ARCH= i386 -.endif +CABAL_ARCH= ${ARCH:S/amd64/x86_64/:C/armv.*/arm/} CABAL_ARCHSUBDIR= ${CABAL_ARCH}-freebsd-ghc-${GHC_VERSION} CABAL_LIBDIR_REL= ${CABAL_LIBDIR:S,^${PREFIX}/,,} CONFIGURE_ARGS+= --libdir=${CABAL_LIBDIR} --libsubdir=${CABAL_LIBSUBDIR} # Inherited via lang/ghc we need to depend on iconv and libgmp.so (stage q/a) USES+= iconv:translit LIB_DEPENDS+= libgmp.so:math/gmp PLIST_SUB+= GHC_VERSION=${GHC_VERSION} \ PORTNAME=${PORTNAME} \ PORTVERSION=${PORTVERSION} \ LIBDIR_REL=${CABAL_LIBDIR_REL}/${CABAL_LIBSUBDIR} CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CPPFLAGS+= -I${LOCALBASE}/include INSTALL_PORTDATA?= INSTALL_PORTEXAMPLES?= LOCALBASE?= /usr/local TMPDIR?= ${WRKDIR}/tmp .if !defined(CABALOPTIONSMKINCLUDED) .include "bsd.cabal.options.mk" .endif .if !defined(STANDALONE) || ${PORT_OPTIONS:MDYNAMIC} BUILD_DEPENDS+= ghc:lang/ghc BUILD_DEPENDS+= ghc>=${GHC_VERSION}:lang/ghc RUN_DEPENDS+= ghc:lang/ghc RUN_DEPENDS+= ghc>=${GHC_VERSION}:lang/ghc .else BUILD_DEPENDS+= ghc:lang/ghc BUILD_DEPENDS+= ghc>=${GHC_VERSION}:lang/ghc .endif CONFIGURE_ARGS+= --with-gcc=${CC} --with-ld=${LD} --with-ar=${AR} .if defined(USE_ALEX) BUILD_DEPENDS+= ${ALEX_CMD}:devel/hs-alex CONFIGURE_ARGS+= --with-alex=${ALEX_CMD} .endif .if defined(USE_HAPPY) BUILD_DEPENDS+= ${HAPPY_CMD}:devel/hs-happy CONFIGURE_ARGS+= --with-happy=${HAPPY_CMD} .endif .if defined(USE_C2HS) BUILD_DEPENDS+= ${C2HS_CMD}:devel/hs-c2hs CONFIGURE_ARGS+= --with-c2hs=${C2HS_CMD} .endif .if defined(USE_CPPHS) BUILD_DEPENDS+= ${CPPHS_CMD}:devel/hs-cpphs CONFIGURE_ARGS+= --with-cpphs=${CPPHS_CMD} .endif .if defined(EXECUTABLE) CONFIGURE_ARGS+= --enable-executable-stripping .endif .if defined(USE_CABAL) .include "bsd.hackage.mk" . for cabal_package in ${USE_CABAL} __u_h_r_package= ${cabal_package:C/[<=>].*$//g} __u_h_r_port= ${${__u_h_r_package}_port} __u_h_r_name= ${__u_h_r_port:C/.*\///g} . if empty(__u_h_r_port) IGNORE?= dependency fails: ${cabal_package} -> ${__u_h_r_package} is not known as a port . endif . if ${__u_h_r_port} != ${STAGE2_DUMMY} . if ${__u_h_r_package} == ${cabal_package} __u_h_r_version:= >=0 . else __u_h_r_version:= ${cabal_package:C/^[^<=>]*//g} . endif dependencies:= ${dependencies} \ ${HSPREFIX}${__u_h_r_package}${__u_h_r_version}:${__u_h_r_port} . else IGNORE?= dependency fail: ${__u_h_r_package} is part of lang/ghc . endif . endfor BUILD_DEPENDS+= ${dependencies} . if !defined(STANDALONE) || ${PORT_OPTIONS:MDYNAMIC} RUN_DEPENDS+= ${dependencies} . endif .endif .if ${PORT_OPTIONS:MDOCS} . if !defined(XMLDOCS) . if defined(HADDOCK_AVAILABLE) HADDOCK_OPTS= # empty . if ${PORT_OPTIONS:MHSCOLOUR} BUILD_DEPENDS+= HsColour:print/hs-hscolour HSCOLOUR_DATADIR= ${LOCALBASE}/share/cabal/ghc-${GHC_VERSION}/hscolour-${HSCOLOUR_VERSION} HADDOCK_OPTS+= --hyperlink-source --hscolour-css=${HSCOLOUR_DATADIR}/hscolour.css . endif # HSCOLOUR . endif # HADDOCK_AVAILABLE . endif # !XMLDOCS . if defined(XMLDOCS) BUILD_DEPENDS+= docbook-xsl>0:textproc/docbook-xsl \ ${LOCALBASE}/bin/xsltproc:textproc/libxslt . if defined(XMLDOCS_CONF) BUILD_DEPENDS+= autoconf>0:devel/autoconf . endif USES+= gmake . endif # XMLDOCS .endif # DOCS __handle_datadir__= --datadir='${DATADIR}' --datasubdir='' --docdir='${DOCSDIR}' .if defined(HADDOCK_AVAILABLE) && !defined(XMLDOCS) && ${PORT_OPTIONS:MDOCS} CONFIGURE_ARGS+= --haddock-options=-w --with-haddock=${HADDOCK_CMD} .endif .if ${PORT_OPTIONS:MDYNAMIC} CONFIGURE_ARGS+= --enable-shared --enable-executable-dynamic .else CONFIGURE_ARGS+= --disable-shared --disable-executable-dynamic .endif .if ${PORT_OPTIONS:MPROFILE} CONFIGURE_ARGS+= --enable-executable-profiling --enable-library-profiling .else CONFIGURE_ARGS+= --disable-profiling --disable-library-profiling .endif .SILENT: post-patch:: .if defined(XMLDOCS) && defined(XMLDOCS_CONF) @${REINPLACE_CMD} -e 's|/usr/local/share/xsl/docbook|${LOCALBASE}/share/xsl/docbook|' \ ${WRKSRC}/doc/configure.ac .endif _BUILD_SETUP= ${GHC_CMD} -o ${SETUP_CMD} -package Cabal --make .if !defined(METAPORT) . if !target(do-configure) do-configure: @${MKDIR} ${TMPDIR} @if [ -f ${WRKSRC}/Setup.hs ]; then \ cd ${WRKSRC} && ${_BUILD_SETUP} Setup.hs; fi @if [ -f ${WRKSRC}/Setup.lhs ]; then \ cd ${WRKSRC} && ${_BUILD_SETUP} Setup.lhs; fi @if [ -f ${WRKSRC}/${SETUP_CMD} ]; then \ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ ${SETUP_CMD} configure --ghc --prefix=${PREFIX} \ --extra-include-dirs="${LOCALBASE}/include" --extra-lib-dirs="${LOCALBASE}/lib" \ ${__handle_datadir__} ${CONFIGURE_ARGS}; \ else \ ${ECHO_MSG} "===> ${PKGNAME} configure fails: no setup program could be created."; \ exit 1; \ fi . if ${PORT_OPTIONS:MDOCS} . if defined(XMLDOCS) && defined(XMLDOCS_CONF) cd ${WRKSRC}/doc && ${LOCALBASE}/bin/autoconf && ./configure --prefix=${PREFIX} . endif . endif # DOCS . endif # target(do-configure) .endif # !METAPORT .if !defined(METAPORT) . if !target(do-build) do-build: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SETUP_CMD} build . if !defined(STANDALONE) cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SETUP_CMD} register --gen-script . endif . if ${PORT_OPTIONS:MDOCS} . if defined(HADDOCK_AVAILABLE) && !defined(XMLDOCS) && !defined(STANDALONE) && ${PORT_OPTIONS:MDOCS} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SETUP_CMD} haddock ${HADDOCK_OPTS} . endif # STANDALONE . if defined(XMLDOCS) @(cd ${WRKSRC}/doc && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} html) . endif # XMLDOCS . endif # DOCS . endif # target(do-build) .endif # !METAPORT .for sect in 1 2 3 4 5 6 7 8 9 . if defined(MAN${sect}PAGES) . for man in ${MAN${sect}PAGES} PLIST_FILES+= man/man${sect}/${man}.gz . endfor . endif .endfor .if !defined(METAPORT) . if !target(do-install) do-install: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SETUP_CMD} copy --destdir=${STAGEDIR} . if !defined(STANDALONE) @${MKDIR} ${STAGEDIR}${CABAL_LIBDIR}/${CABAL_LIBSUBDIR} cd ${WRKSRC} && ${INSTALL_SCRIPT} register.sh ${STAGEDIR}${CABAL_LIBDIR}/${CABAL_LIBSUBDIR}/register.sh . endif . if !empty(INSTALL_PORTDATA) @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_PORTDATA} . endif . if !empty(INSTALL_PORTEXAMPLES) && ${PORT_OPTIONS:MEXAMPLES} @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_PORTEXAMPLES} . endif . for sect in 1 2 3 4 5 6 7 8 9 . if defined(MAN${sect}SRC) . for man in ${MAN${sect}PAGES} @${INSTALL_MAN} ${WRKSRC}/${MAN${sect}SRC}/${man} ${STAGEDIR}${MANPREFIX}/man/man${sect} . endfor . endif # MAN${sect}SRC . endfor . if ${PORT_OPTIONS:MDOCS} . if !empty(XMLDOCS) . for xmldoc in ${XMLDOCS} @(cd ${WRKSRC}/${xmldoc:C/:.*$//g} && ${COPYTREE_SHARE} \* ${STAGEDIR}${DOCSDIR}/${xmldoc:C/^.*://g}) . endfor . endif # XMLDOCS . endif # DOCS . endif # target(do-install) .endif # !METAPORT .if !target(post-install-script) post-install-script: . if defined(EXECUTABLE) . for exe in ${EXECUTABLE} ${ECHO_CMD} 'bin/${exe}' >>${TMPPLIST} . endfor . endif # EXECUTABLE for dir in ${CABAL_DIRS}; do if [ -d ${STAGEDIR}$${dir} ]; then ${FIND} -ds ${STAGEDIR}$${dir} \ -type f -print | ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}; fi ; done @${ECHO} "================ CONTENTS OF TMPPLIST =================== " cat ${TMPPLIST} @${ECHO} "========================================================= " .endif # target(post-install-script) .if !defined(METAPORT) add-plist-post: add-plist-cabal add-plist-cabal: . if !defined(STANDALONE) @${ECHO_CMD} '@postunexec ${LOCALBASE}/bin/ghc-pkg unregister --no-user-package-db --force ${PORTNAME}-${PORTVERSION}' >> ${TMPPLIST} . endif . if defined(HADDOCK_AVAILABLE) && ${PORT_OPTIONS:MDOCS} # GHC_LIB_DOCSDIR_REL= share/doc/ghc-${GHC_VERSION}/html/libraries (${ECHO} '@postexec ${LN} -s ${DOCSDIR}/html ${LOCALBASE}/${GHC_LIB_DOCSDIR_REL}/${PACKAGE} && \ cd ${LOCALBASE}/${GHC_LIB_DOCSDIR_REL} && \ ${RM} doc-index*.html && ./gen_contents_index') >> ${TMPPLIST} (${ECHO} '@postunexec ${RM} -r ${LOCALBASE}/${GHC_LIB_DOCSDIR_REL}/${PACKAGE}' ; \ ${ECHO} '@postunexec cd ${LOCALBASE}/${GHC_LIB_DOCSDIR_REL} && \ ${RM} doc-index*.html && ./gen_contents_index') >> ${TMPPLIST} # Don't install index files ${ECHO} "@comment share/doc/ghc-%%GHC_VERSION%%/html/libraries/index.html" >> ${TMPPLIST} . endif . if !defined(STANDALONE) @${ECHO_CMD} '@postexec ${SH} %D/${CABAL_LIBDIR_REL}/${CABAL_LIBSUBDIR}/register.sh > /dev/null' >> ${TMPPLIST} . endif .endif # !METAPORT Index: head/lang/ghc/distinfo =================================================================== --- head/lang/ghc/distinfo (revision 478530) +++ head/lang/ghc/distinfo (revision 478531) @@ -1,9 +1,15 @@ TIMESTAMP = 1530033471 SHA256 (ghc-8.4.3-src.tar.xz) = ae47afda985830de8811243255aa3744dfb9207cb980af74393298b2b62160d6 SIZE (ghc-8.4.3-src.tar.xz) = 11315068 SHA256 (ghc-8.4.2-boot-amd64-freebsd.tar.xz) = 8fe44700c0b765b38a2072c8ea9ddb1da18b4a738397c9ceddcce80708900e4f SIZE (ghc-8.4.2-boot-amd64-freebsd.tar.xz) = 72751016 SHA256 (ghc-8.4.2-boot-i386-freebsd.tar.xz) = 673230735fc459a3c05cf845ef7beeeb6eab9576bc03471b9fb50bd3fe29d911 SIZE (ghc-8.4.2-boot-i386-freebsd.tar.xz) = 69976728 SHA256 (hscolour-1.24.4.tar.gz) = 243332b082294117f37b2c2c68079fa61af68b36223b3fc07594f245e0e5321d SIZE (hscolour-1.24.4.tar.gz) = 28729 +SHA256 (ghc-8.4.2-boot-aarch64-freebsd.tar.xz) = 18412f10bb172dbaff7f31505845fbd43fdde14046463fdacc42e26683be311d +SIZE (ghc-8.4.2-boot-aarch64-freebsd.tar.xz) = 100240140 +SHA256 (ghc-8.4.2-boot-armv6-freebsd.tar.xz) = 61d3a4486dbb904b05a735e98f23a49c2b464d6b19212dd655ff578f36d02f0d +SIZE (ghc-8.4.2-boot-armv6-freebsd.tar.xz) = 107368936 +SHA256 (ghc-8.4.2-boot-armv7-freebsd.tar.xz) = eedb9416870bfe82315155751871e31e815b718b381ccf4f7e45a99a6ad7c94d +SIZE (ghc-8.4.2-boot-armv7-freebsd.tar.xz) = 110153548 Index: head/lang/ghc/files/extra-patch-aclocal.m4 =================================================================== --- head/lang/ghc/files/extra-patch-aclocal.m4 (nonexistent) +++ head/lang/ghc/files/extra-patch-aclocal.m4 (revision 478531) @@ -0,0 +1,54 @@ +--- aclocal.m4.orig 2018-03-25 21:22:32 UTC ++++ aclocal.m4 +@@ -648,6 +648,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], + $3="$$3 -D_HPUX_SOURCE" + $5="$$5 -D_HPUX_SOURCE" + ;; ++ arm*freebsd*) ++ # On arm/freebsd, tell gcc to generate Arm ++ # instructions (ie not Thumb) and to link using the gold linker. ++ # Forcing LD to be ld.gold is done in FIND_LD m4 macro. ++ $2="$$2 -marm" ++ $3="$$3 -Wl,-z,noexecstack" ++ $4="$$4 -z noexecstack" ++ ;; + arm*linux*) + # On arm/linux and arm/android, tell gcc to generate Arm + # instructions (ie not Thumb). +@@ -656,6 +664,11 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], + $4="$$4 -z noexecstack" + ;; + ++ aarch64*freebsd*) ++ $3="$$3 -Wl,-z,noexecstack" ++ $4="$$4 -z noexecstack" ++ ;; ++ + aarch64*linux*) + $3="$$3 -Wl,-z,noexecstack" + $4="$$4 -z noexecstack" +@@ -1917,6 +1930,10 @@ case "$1" in + # converts the canonicalized target into someting llvm can understand + AC_DEFUN([GHC_LLVM_TARGET], [ + case "$2-$3" in ++ *-freebsd*-gnueabihf) ++ llvm_target_vendor="unknown" ++ llvm_target_os="freebsd-gnueabihf" ++ ;; + hardfloat-*eabi) + llvm_target_vendor="unknown" + llvm_target_os="$3""hf" +@@ -2361,13 +2378,6 @@ AC_DEFUN([FIND_LD],[ + [enable_ld_override=yes]) + + find_ld() { +- # Make sure the user didn't specify LD manually. +- if test "z$LD" != "z"; then +- AC_CHECK_TARGET_TOOL([LD], [ld]) +- LD_NO_GOLD=$LD +- return +- fi +- + # Manually iterate over possible names since we want to ensure that, e.g., + # if ld.lld is installed but gcc doesn't support -fuse-ld=lld, that we + # then still try ld.gold and -fuse-ld=gold. Property changes on: head/lang/ghc/files/extra-patch-aclocal.m4 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lang/ghc/files/patch-configure =================================================================== --- head/lang/ghc/files/patch-configure (nonexistent) +++ head/lang/ghc/files/patch-configure (revision 478531) @@ -0,0 +1,22 @@ +--- configure.orig 2018-03-06 20:04:54 UTC ++++ configure +@@ -9108,6 +9108,19 @@ $as_echo_n "checking Setting up CFLAGS, LDFLAGS, IGNOR + IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" + ;; + ++ arm*freebsd*) ++ # On arm/freebsd, tell gcc to generate Arm ++ # instructions (ie not Thumb). ++ CFLAGS="$CFLAGS -marm" ++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" ++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" ++ ;; ++ ++ aarch64*freebsd*) ++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" ++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack" ++ ;; ++ + powerpc-ibm-aix*) + # We need `-D_THREAD_SAFE` to unlock the thread-local `errno`. + CFLAGS="$CFLAGS -D_THREAD_SAFE" Property changes on: head/lang/ghc/files/patch-configure ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lang/ghc/files/patch-configure.ac =================================================================== --- head/lang/ghc/files/patch-configure.ac (revision 478530) +++ head/lang/ghc/files/patch-configure.ac (revision 478531) @@ -1,24 +1,24 @@ ---- configure.ac.orig 2018-03-06 16:48:53 UTC +--- configure.ac.orig 2018-04-17 19:30:22 UTC +++ configure.ac @@ -447,6 +447,9 @@ XCODE_VERSION() dnl ** Building a cross compiler? dnl -------------------------------------------------------------- CrossCompiling=NO + -+build=`echo $build | sed -e 's/amd64-/x86_64-/g; s/-freebsd.*$/-freebsd/g'` ++build=`echo $build | sed -e 's/amd64-/x86_64-/g; s/armv[[67]]-/arm-/g; s/-freebsd.*$/-freebsd/g'` + # If 'host' and 'target' differ, then this means we are building a cross-compiler. if test "$TargetPlatform" != "$HostPlatform" ; then CrossCompiling=YES @@ -1163,6 +1158,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; t # The flag MAP_NORESERVE is supported for source compatibility reasons, # but is completely ignored by OS mmap use_large_address_space=no + elif test "$ghc_host_os" = "freebsd" ; then + # FreeBSD does not support mmap with MAP_NORESERVE, removed in r273250. + # The flag MAP_NORESERVE is supported for source compatibility reasons, + # but is completely ignored by OS mmap + use_large_address_space=no else AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[], [ Index: head/lang/ghc/files/patch-llvm-targets =================================================================== --- head/lang/ghc/files/patch-llvm-targets (nonexistent) +++ head/lang/ghc/files/patch-llvm-targets (revision 478531) @@ -0,0 +1,10 @@ +--- llvm-targets.orig 2018-03-17 14:04:41 UTC ++++ llvm-targets +@@ -20,4 +20,7 @@ + ,("aarch64-apple-ios", ("e-m:o-i64:64-i128:128-n32:64-S128", "generic", "+neon")) + ,("i386-apple-ios", ("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128", "yonah", "")) + ,("x86_64-apple-ios", ("e-m:o-i64:64-f80:128-n8:16:32:64-S128", "core2", "")) ++,("armv6-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align")) ++,("armv7-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", "+strict-align")) ++,("aarch64-unknown-freebsd", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon")) + ] Property changes on: head/lang/ghc/files/patch-llvm-targets ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property