Changeset View
Changeset View
Standalone View
Standalone View
lang/ghc/Makefile
# Created by: Simon Marlow <simonmar@microsoft.com> | # Created by: Simon Marlow <simonmar@microsoft.com> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= ghc | PORTNAME= ghc | ||||
PORTVERSION= ${GHC_VERSION} | PORTVERSION= ${GHC_VERSION} | ||||
PORTREVISION= 3 | |||||
CATEGORIES= lang haskell | CATEGORIES= lang haskell | ||||
MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ | MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \ | ||||
LOCAL/pgj/:boot | http://arrowd.name/:boot | ||||
DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source | DISTFILES= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source | ||||
MAINTAINER= haskell@FreeBSD.org | MAINTAINER= haskell@FreeBSD.org | ||||
COMMENT= Compiler for the functional language Haskell | COMMENT= Compiler for the functional language Haskell | ||||
LICENSE= BSD3CLAUSE | LICENSE= BSD3CLAUSE | ||||
LICENSE_FILE= ${WRKSRC}/LICENSE | LICENSE_FILE= ${WRKSRC}/LICENSE | ||||
ONLY_FOR_ARCHS= i386 amd64 | ONLY_FOR_ARCHS= i386 amd64 | ||||
GHC_VERSION= 8.0.2 | GHC_VERSION= 8.4.1 | ||||
HSCOLOUR_VERSION= 1.24.1 | HSCOLOUR_VERSION= 1.24.4 | ||||
DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | DATADIR= ${PREFIX}/share/ghc-${GHC_VERSION} | ||||
EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | EXAMPLESDIR= ${PREFIX}/share/examples/ghc-${GHC_VERSION} | ||||
CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* | CONFLICTS= ghc-7.4.* ghc-7.6.* ghc-7.8.* ghc-7.10.* ghc-8.0.* | ||||
LIB_DEPENDS+= libgmp.so:math/gmp | LIB_DEPENDS+= libgmp.so:math/gmp | ||||
USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | USES= autoreconf gmake iconv:translit localbase:ldflags ncurses perl5 tar:xz | ||||
USE_LOCALE= en_US.UTF-8 | USE_LOCALE= en_US.UTF-8 | ||||
USE_PERL5= build | USE_PERL5= build | ||||
NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | NO_CCACHE= ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied | ||||
# The configure process accepts,filters and canonicalises | # The configure process accepts,filters and canonicalises | ||||
# the CONFIGURE_TARGET variable. You can read the files | # the CONFIGURE_TARGET variable. You can read the files | ||||
# ${WRKSRC}/configure and ${WRKSRC}/config.sub. | # ${WRKSRC}/configure and ${WRKSRC}/config.sub. | ||||
# This is better fixed in files/build.mk.in | # This is better fixed in files/build.mk.in | ||||
GNU_CONFIGURE= yes | GNU_CONFIGURE= yes | ||||
CONFIGURE_ARGS= --with-ld=${LD} \ | CONFIGURE_ARGS= --with-gmp-includes=${LOCALBASE}/include \ | ||||
--with-gmp-includes=${LOCALBASE}/include \ | |||||
--with-gmp-libraries=${LOCALBASE}/lib \ | --with-gmp-libraries=${LOCALBASE}/lib \ | ||||
--with-iconv-includes=${LOCALBASE}/include \ | --with-iconv-includes=${LOCALBASE}/include \ | ||||
--with-iconv-libraries=${LOCALBASE}/lib | --with-iconv-libraries=${LOCALBASE}/lib | ||||
SUB_FILES= build.mk \ | SUB_FILES= build.mk \ | ||||
build.boot.mk | build.boot.mk | ||||
SUB_LIST= GHC_VERSION=${GHC_VERSION} \ | SUB_LIST= GHC_VERSION=${GHC_VERSION} \ | ||||
NCURSESINC="${NCURSESINC}" NCURSESLIB="${NCURSESLIB}" \ | NCURSESINC="${NCURSESINC}" NCURSESLIB="${NCURSESLIB}" \ | ||||
Show All 34 Lines | |||||
DOCS_SUB_LIST= WITH_DOCS="YES" | DOCS_SUB_LIST= WITH_DOCS="YES" | ||||
DOCS_SUB_LIST_OFF= WITH_DOCS="NO" | DOCS_SUB_LIST_OFF= WITH_DOCS="NO" | ||||
LOCALBASE?= /usr/local | LOCALBASE?= /usr/local | ||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
BOOT_GHC_VERSION= 7.10.2 | BOOT_GHC_VERSION= 8.4.1 | ||||
DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot | DISTFILES+= ghc-${BOOT_GHC_VERSION}-boot-${ARCH}-freebsd${EXTRACT_SUFX}:boot | ||||
.endif # MBOOT | .endif # MBOOT | ||||
CONFIGURE_ARGS+= -with-gcc=${CC} | .if ${OSVERSION} < 1200000 | ||||
.if empty(PORT_OPTIONS:MBOOT) | USE_GCC= yes | ||||
CONFIGURE_ARGS_BOOT+= --with-gcc=${CC} | .else | ||||
LD= ld.bfd | |||||
.endif | .endif | ||||
CONFIGURE_ENV+= CC=${CC} LD=${LD} | |||||
DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | DOCSDIR= ${PREFIX}/share/doc/${DISTNAME} | ||||
GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | GHC_LIBDIR= ${STAGEDIR}${PREFIX}/lib/ghc-${GHC_VERSION} | ||||
GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | GHC_LIBDIR_REL= lib/ghc-${GHC_VERSION} | ||||
PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | PLIST_SUB+= GHC_VERSION=${GHC_VERSION} GHC_LIBDIR=${GHC_LIBDIR_REL} | ||||
HACKAGE_SITE?= http://hackage.haskell.org/package/ | HACKAGE_SITE?= http://hackage.haskell.org/package/ | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-boot | BOOT_DIR= ${WRKDIR}/ghc-${BOOT_GHC_VERSION}-boot | ||||
BOOT_GHC= ${BOOT_DIR}/bin/ghc-${BOOT_GHC_VERSION} | BOOT_GHC= ${BOOT_DIR}/bin/ghc-${BOOT_GHC_VERSION} | ||||
BOOT_GHC-PKG= ${BOOT_DIR}/bin/ghc-pkg-${BOOT_GHC_VERSION} | BOOT_GHC-PKG= ${BOOT_DIR}/bin/ghc-pkg-${BOOT_GHC_VERSION} | ||||
BOOT_HSC2HS= ${BOOT_DIR}/bin/hsc2hs | BOOT_HSC2HS= ${BOOT_DIR}/bin/hsc2hs | ||||
SLAVE_CMD= ${SETENV} PATH=${BOOT_DIR}/bin:${PATH} | SLAVE_CMD= ${SETENV} PATH=${BOOT_DIR}/bin:${PATH} | ||||
CONFIGURE_ARGS_BOOT+= --prefix=${BOOT_DIR} --with-ld=${LD} | CONFIGURE_ARGS_BOOT+= --prefix=${BOOT_DIR} | ||||
CONFIGURE_ARGS+= --with-ghc=${BOOT_GHC} | CONFIGURE_ARGS+= --with-ghc=${BOOT_GHC} | ||||
.else # MBOOT | .else # MBOOT | ||||
SLAVE_CMD= # empty | SLAVE_CMD= # empty | ||||
CONFIGURE_ARGS+= --with-ghc=${LOCALBASE}/bin/ghc | CONFIGURE_ARGS+= --with-ghc=${LOCALBASE}/bin/ghc | ||||
.endif # MBOOT | .endif # MBOOT | ||||
# override TMPDIR because /tmp often doesn't have enough space | # override TMPDIR because /tmp often doesn't have enough space | ||||
# to build some of the larger libraries. | # to build some of the larger libraries. | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | .if ${PORT_OPTIONS:MDOCS} | ||||
${ECHO} '@postexec ${SH} -c "cd %D/${DOCSDIR_REL}/html/libraries && ./gen_contents_index"' >> ${TMPPLIST} | ${ECHO} '@postexec ${SH} -c "cd %D/${DOCSDIR_REL}/html/libraries && ./gen_contents_index"' >> ${TMPPLIST} | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; \ | @${REINPLACE_CMD} -e 's|%%CC%%|${CC}|; \ | ||||
s|%%AR%%|${AR}|; \ | s|%%AR%%|${AR}|; \ | ||||
s|%%LD%%|${LD}|' \ | s|%%LD%%|${LD}|' \ | ||||
${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | ${WRKSRC}/libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | ||||
.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 | pre-configure: apply-slist | ||||
# Copy the subbed build.mk to the proper position | # Copy the subbed build.mk to the proper position | ||||
${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ${CP} ${WRKDIR}/build.mk ${WRKSRC}/mk/build.mk | ||||
@${MKDIR} ${TMPDIR} | @${MKDIR} ${TMPDIR} | ||||
.if empty(PORT_OPTIONS:MBOOTH) && ${OPSYS} == FreeBSD && \ | .if empty(PORT_OPTIONS:MBOOT) && ${OPSYS} == FreeBSD && \ | ||||
${OSVERSION} >= 1200031 | ${OSVERSION} >= 1200031 | ||||
${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ${CC} ${CFLAGS} -c -o ${BOOT_DIR}/wrap.o ${PATCHDIR}/wrap.c | ||||
for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | for x in ${BOOT_DIR}/rts/dist/build/libCffi*.a; do \ | ||||
${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ${AR} q $$x ${BOOT_DIR}/wrap.o; ${RANLIB} $$x; \ | ||||
done | done | ||||
rm ${BOOT_DIR}/wrap.o | rm ${BOOT_DIR}/wrap.o | ||||
.endif # Do not merge, prev condition need to grow OSVER check. | .endif # Do not merge, prev condition need to grow OSVER check. | ||||
.if empty(PORT_OPTIONS:MBOOT) | .if empty(PORT_OPTIONS:MBOOT) | ||||
Show All 18 Lines | @(cd ${SLAVES_WRKDIRPREFIX} && \ | ||||
${TAR} xvf ${DISTDIR}/hscolour-${HSCOLOUR_VERSION}.tar.gz && \ | ${TAR} xvf ${DISTDIR}/hscolour-${HSCOLOUR_VERSION}.tar.gz && \ | ||||
cd hscolour-${HSCOLOUR_VERSION} && \ | cd hscolour-${HSCOLOUR_VERSION} && \ | ||||
${SLAVE_CMD} ghc --make -o Setup Setup.hs -package Cabal && \ | ${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 configure --ghc --prefix=${SLAVES_PREFIX} --with-gcc=${CC} --with-ld=${LD} && \ | ||||
${SLAVE_CMD} ./Setup build && \ | ${SLAVE_CMD} ./Setup build && \ | ||||
${SLAVE_CMD} ./Setup install) | ${SLAVE_CMD} ./Setup install) | ||||
.endif | .endif | ||||
_EXECUTABLES= ${STAGEDIR}${PREFIX}/bin/hp2ps \ | _EXECUTABLES= ${GHC_LIBDIR}/bin/unlit \ | ||||
${GHC_LIBDIR}/bin/unlit \ | |||||
${GHC_LIBDIR}/bin/hpc \ | ${GHC_LIBDIR}/bin/hpc \ | ||||
${GHC_LIBDIR}/bin/ghc-iserv \ | ${GHC_LIBDIR}/bin/ghc-iserv \ | ||||
${GHC_LIBDIR}/bin/ghc-pkg \ | ${GHC_LIBDIR}/bin/ghc-pkg \ | ||||
${GHC_LIBDIR}/bin/hsc2hs \ | ${GHC_LIBDIR}/bin/hsc2hs \ | ||||
${GHC_LIBDIR}/bin/runghc \ | ${GHC_LIBDIR}/bin/runghc \ | ||||
${GHC_LIBDIR}/bin/ghc | ${GHC_LIBDIR}/bin/ghc \ | ||||
${GHC_LIBDIR}/bin/hp2ps | |||||
.if ${PORT_OPTIONS:MPROFILE} | .if ${PORT_OPTIONS:MPROFILE} | ||||
_EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-prof | _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-prof | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MDYNAMIC} | .if ${PORT_OPTIONS:MDYNAMIC} | ||||
_EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-dyn | _EXECUTABLES+= ${GHC_LIBDIR}/bin/ghc-iserv-dyn | ||||
.endif | .endif | ||||
.if ${PORT_OPTIONS:MDOCS} | .if ${PORT_OPTIONS:MDOCS} | ||||
_EXECUTABLES+= ${GHC_LIBDIR}/bin/haddock | _EXECUTABLES+= ${GHC_LIBDIR}/bin/haddock | ||||
.endif | .endif | ||||
post-install: | post-install: | ||||
${RM} ${STAGEDIR}${PREFIX}/bin/haddock | ${RM} ${STAGEDIR}${PREFIX}/bin/haddock | ||||
.if ${PORT_OPTIONS:MDOCS} | .if ${PORT_OPTIONS:MDOCS} | ||||
${LN} -sf haddock-ghc-${GHC_VERSION} ${STAGEDIR}${PREFIX}/bin/haddock | ${LN} -sf haddock-ghc-${GHC_VERSION} ${STAGEDIR}${PREFIX}/bin/haddock | ||||
.endif | .endif | ||||
(for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so'); do \ | (for f in ${_EXECUTABLES} $$(${FIND} ${GHC_LIBDIR} -name '*.so*'); do \ | ||||
tcberner: Sure about this change? | |||||
Not Done Inline ActionsWithout last * libraries with names like libffi.so.6 were not stripped and stage-qa was complaining. arrowd: Without last `*` libraries with names like `libffi.so.6` were not stripped and stage-qa was… | |||||
${STRIP_CMD} $$f; done) | ${STRIP_CMD} $$f; done) | ||||
.include <bsd.port.mk> | .include <bsd.port.mk> | ||||
# Create a bootstrap compiler tar ball: run this in an interactive poudriere jail | # Create a bootstrap compiler tar ball: run this in an interactive poudriere jail | ||||
.PHONY: create-bootstrap | .PHONY: create-bootstrap | ||||
create-bootstrap: | create-bootstrap: | ||||
@${ECHO} "TODO: https://github.com/freebsd-haskell/ports/wiki/Updating-the-Bootstrap-Compiler" | cd ${WRKSRC} \ | ||||
cd ${WRKSCR} \ | && gmake binary-dist TAR_COMP=xz \ | ||||
&& ${CP} ${WRKDIR}/build.boot.mk mk \ | && mv ${WRKSRC}/ghc-${GHC_VERSION}-${ARCH}-portbld-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-boot-${ARCH}-freebsd.tar.xz | ||||
&& setenv ${CONFIGURE_ENV} ./configure --with-iconv-includes=${LOCALBASE}/include \ | |||||
--with-iconv-libraries=${LOCALBASE}/lib \ | |||||
--with-gcc=${CC} \ | |||||
--with-ld=${LD} \ | |||||
&& make binary-dist TAR_COMP=xz \\ | |||||
&& mv ghc-${GHC_VERSION}-boot-${GHC_ARCH}-unknown-freebsd.tar.xz /tmp/ghc-${GHC_VERSION}-${ARCH}-freebsd${FREEBSD_MAJOR_VERSION}-boot.tar.xz |
Sure about this change?