diff options
Diffstat (limited to 'lang/ghc/bsd.cabal.mk')
-rw-r--r-- | lang/ghc/bsd.cabal.mk | 78 |
1 files changed, 23 insertions, 55 deletions
diff --git a/lang/ghc/bsd.cabal.mk b/lang/ghc/bsd.cabal.mk index 871db7b439a4..825b138e373a 100644 --- a/lang/ghc/bsd.cabal.mk +++ b/lang/ghc/bsd.cabal.mk @@ -26,18 +26,7 @@ DIST_SUBDIR?= cabal FILE_LICENSE?= LICENSE -.if !defined(DOCUMENTATION) && \ - (${PORTNAME} == haddock || ${PORTNAME} == ghc-paths || \ - ${PORTNAME} == hscolour || ${PORTNAME} == mtl || \ - ${PORTNAME} == transformers || ${PORTNAME} == xhtml) -NOPORTDOCS= yes -.endif - -.if defined(NOPORTDOCS) && defined(DOCUMENTATION) -IGNORE+= is a documentation-only port, do not install if no documentation needed -.endif - -.if !defined(DOCUMENTATION) && !defined(STANDALONE) +.if !defined(STANDALONE) BUILD_DEPENDS+= ghc:${PORTSDIR}/lang/ghc BUILD_DEPENDS+= ghc>=${GHC_VERSION}:${PORTSDIR}/lang/ghc RUN_DEPENDS+= ghc:${PORTSDIR}/lang/ghc @@ -47,7 +36,7 @@ BUILD_DEPENDS+= ghc:${PORTSDIR}/lang/ghc BUILD_DEPENDS+= ghc>=${GHC_VERSION}:${PORTSDIR}/lang/ghc .endif -GHC_VERSION?= 7.0.4 +GHC_VERSION?= 7.4.1 GHC_VERSION_N= ${GHC_VERSION:S/./0/g} GHC_CMD?= ${LOCALBASE}/bin/ghc @@ -59,14 +48,10 @@ HAPPY_CMD?= ${LOCALBASE}/bin/happy HADDOCK_CMD?= ${LOCALBASE}/bin/haddock C2HS_CMD?= ${LOCALBASE}/bin/c2hs -.if !defined(DOCUMENTATION) CABAL_DIRS+= ${DATADIR} ${EXAMPLESDIR} ${CABAL_LIBDIR}/${CABAL_LIBSUBDIR} -.endif GHC_HADDOCK_CMD=${LOCALBASE}/bin/haddock-ghc-${GHC_VERSION} -HADDOCK_PORT= ${PORTSDIR}/devel/hs-haddock - CABAL_DOCSDIR= ${PREFIX}/share/doc/ghc-${GHC_VERSION}/cabal CABAL_DOCSDIR_REL= ${CABAL_DOCSDIR:S,^${PREFIX}/,,} @@ -114,26 +99,10 @@ LIB_DEPENDS+= gmp.10:${PORTSDIR}/math/gmp USE_ICONV= yes .endif -.if defined(EXECUTABLE) || defined(DOCUMENTATION) +.if defined(EXECUTABLE) HADDOCK_EXE?= --executables .endif -.if defined(DOCUMENTATION) - -.if defined(PORTREVISION) && ${PORTREVISION} != 0 -_SUF1= _${PORTREVISION} -.endif - -.if defined(PORTEPOCH) && ${PORTEPOCH} != 0 -_SUF2= ,${PORTEPOCH} -.endif - -PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2} - -PKGNAMESUFFIX= -docs -USE_CABAL+= ${PORTNAME}==${PKGVERSION} -.endif - .if defined(USE_CABAL) .include "bsd.hackage.mk" @@ -175,9 +144,7 @@ PLIST_SUB+= NOPORTDOCS="@comment " .endif .if !defined(NOPORTDOCS) -.if !defined(XMLDOCS) || defined(DOCUMENTATION) -BUILD_DEPENDS+= ${HADDOCK_CMD}:${HADDOCK_PORT} - +.if !defined(XMLDOCS) HADDOCK_OPTS= ${HADDOCK_EXE} .if defined(WITH_HSCOLOUR_DOCS) @@ -198,10 +165,6 @@ USE_GMAKE= yes .endif # !XMLDOCS -.if defined(DOCUMENTATION) -DOCSDIR= ${CABAL_DOCSDIR}/${DISTNAME}/html -.endif - .if !defined(METAPORT) PORTDOCS= * .endif # !METAPORT @@ -214,7 +177,7 @@ __handle_datadir__= --datadir='' --datasubdir='' --docdir='${DOCSDIR}' __handle_datadir__= --datadir='${DATADIR}' --datasubdir='' --docdir='${DOCSDIR}' .endif -.if (!defined(XMLDOCS) || defined(DOCUMENTATION)) && !defined(NOPORTDOCS) +.if !defined(XMLDOCS) && !defined(NOPORTDOCS) CONFIGURE_ARGS+= --haddock-options=-w --with-haddock=${HADDOCK_CMD} .endif @@ -242,6 +205,22 @@ post-patch:: ${WRKSRC}/doc/configure.ac .endif +# Purge Haskell 98 (required for GHC 7.2 or later) +.if defined(HASKELL98) + @${REINPLACE_CMD} -E 's|haskell98[,]?||' \ + ${WRKSRC}/${PORTNAME}.cabal + + @${REINPLACE_CMD} 's|import List|import Data.List| ; \ + s|import Char|import Data.Char| ; \ + s|import Ratio|import Data.Ratio| ; \ + s|import Monad|import Control.Monad| ; \ + s|import IO|import System.IO.Error| ; \ + s|import Directory|import System.Directory| ; \ + s|import Maybe|import Data.Maybe| ; \ + s|import Array|import Data.Array|' \ + `${FIND} ${WRKSRC} -name '*.hs'` +.endif + .if !target(do-configure) do-configure: .if !defined(METAPORT) @@ -262,15 +241,13 @@ do-configure: .if !target(do-build) do-build: .if !defined(METAPORT) -.if !defined(DOCUMENTATION) cd ${WRKSRC} && ${SETUP_CMD} build .if !defined(STANDALONE) cd ${WRKSRC} && ${SETUP_CMD} register --gen-script .endif -.endif # !DOCUMENTATION .if !defined(NOPORTDOCS) -.if (!defined(XMLDOCS) && !defined(STANDALONE)) || defined(DOCUMENTATION) +.if !defined(XMLDOCS) && !defined(STANDALONE) cd ${WRKSRC} && ${SETUP_CMD} haddock ${HADDOCK_OPTS} .endif # STANDALONE .if defined(XMLDOCS) @@ -285,7 +262,6 @@ do-build: .if !target(do-install) do-install: .if !defined(METAPORT) -.if !defined(DOCUMENTATION) cd ${WRKSRC} && ${SETUP_CMD} install .if !defined(STANDALONE) @@ -308,12 +284,6 @@ do-install: .endfor .endif # MAN1SRC -.else - - @(cd ${WRKSRC}/dist/doc/html/${PORTNAME} && ${COPYTREE_SHARE} \* ${DOCSDIR}/html) - -.endif # !DOCUMENTATION - .if !defined(NOPORTDOCS) .if !empty(XMLDOCS) .for xmldoc in ${XMLDOCS} @@ -343,13 +313,11 @@ post-install-script: add-plist-post: add-plist-cabal add-plist-cabal: .if !defined(METAPORT) -.if !defined(DOCUMENTATION) @if [ -f ${CABAL_LIBDIR}/${CABAL_LIBSUBDIR}/register.sh ]; then \ (${ECHO_CMD} '@exec ${SH} %D/${CABAL_LIBDIR_REL}/${CABAL_LIBSUBDIR}/register.sh'; \ ${ECHO_CMD} '@exec ${RM} -f %D/lib/ghc-${GHC_VERSION}/package.conf.old'; \ ${ECHO_CMD} '@unexec %D/bin/ghc-pkg unregister --force ${PORTNAME}-${PORTVERSION}'; \ ${ECHO_CMD} '@unexec ${RM} -f %D/lib/ghc-${GHC_VERSION}/package.conf.old') >> ${TMPPLIST}; fi -.endif .if defined(NOPORTDOCS) @if [ -f ${DOCSDIR}/${FILE_LICENSE} ]; then \ (${ECHO_CMD} '${DOCSDIR_REL}/${FILE_LICENSE}'; \ @@ -374,7 +342,7 @@ post-install:: fi .endif -.if !defined(STANDALONE) && !defined(DOCUMENTATION) +.if !defined(STANDALONE) ${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old .endif |