summaryrefslogtreecommitdiff
path: root/textproc/hs-HaXml/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'textproc/hs-HaXml/Makefile')
-rw-r--r--textproc/hs-HaXml/Makefile64
1 files changed, 57 insertions, 7 deletions
diff --git a/textproc/hs-HaXml/Makefile b/textproc/hs-HaXml/Makefile
index 714d223171d6..4f78c6c32bd4 100644
--- a/textproc/hs-HaXml/Makefile
+++ b/textproc/hs-HaXml/Makefile
@@ -5,21 +5,71 @@
# $FreeBSD$
PORTNAME= haxml
-PORTVERSION= 1.05
+PORTVERSION= 1.07
CATEGORIES= textproc
-MASTER_SITES= ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/
+MASTER_SITES= http://www.haskell.org/HaXml/ \
+ ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/
DISTNAME= HaXml-${PORTVERSION}
-MAINTAINER= obraun@informatik.unibw-muenchen.de
+MAINTAINER= obraun@FreeBSD.org
+.if !defined(WITHOUT_NHC98)
BUILD_DEPENDS= nhc98:${PORTSDIR}/lang/nhc98
+RUN_DEPENDS= nhc98:${PORTSDIR}/lang/nhc98
+.else
+WITH_GHC= yes
+BUILD_DEPENDS= hmake:${PORTSDIR}/devel/hmake
+.endif
+.if defined(WITH_GHC)
+BUILD_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
+RUN_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
+.endif
+HAS_CONFIGURE= yes
USE_GMAKE= yes
+ALL_TARGET= #empty
+
+CONFIGURE_ARGS+= --prefix=${PREFIX}
-do-install:
- @(cd ${WRKSRC} && ${INSTALL_PROGRAM} Canonicalise DrIFT DtdToHaskell Xtract ${PREFIX}/bin)
- @${MKDIR} ${PREFIX}/lib/haxml
- ${INSTALL_DATA} ${WRKSRC}/lib/* ${PREFIX}/lib/haxml
+.if !defined(WITHOUT_NHC98) && !defined(WITH_GHC)
+CONFIGURE_ARGS+= --buildwith=nhc98
+.elif defined(WITHOUT_NHC98)
+CONFIGURE_ARGS+= --buildwith=ghc
+.endif
+
+.if !defined(WITHOUT_NHC98)
+PLIST_SUB+= NHC98=""
+.else
+PLIST_SUB+= NHC98="@comment "
+.endif
+.if defined(WITH_GHC)
+GHC_VERSION= `${PREFIX}/bin/ghc --version 2>&1 | \
+ ${SED} 's/^.*version[ ]*\([0-9.]*\).*/\1/'`
+PLIST_SUB+= GHC="" GHC_VERSION="${GHC_VERSION}"
+.else
+PLIST_SUB+= GHC="@comment "
+.endif
+
+pre-everything:
+ @${ECHO_CMD} ""
+.if defined(WITH_GHC) && !defined(WITHOUT_NHC98)
+ @${ECHO_CMD} " HaXml will be installed for both nhc98 and ghc.
+.elif defined(WITHOUT_NHC98)
+ @${ECHO_CMD} " HaXml will be installed for ghc only."
+.else
+ @${ECHO_CMD} " HaXml will be installed for nhc98 only."
+ @${ECHO_CMD} " Define WITH_GHC to install for ghc, too."
+ @${ECHO_CMD} " Define WITHOUT_NHC98 to install for ghc only."
+.endif
+ @${ECHO_CMD} ""
+
+post-install:
+.if defined(WITH_GHC)
+ @${INSTALL_DATA} ${WRKSRC}/obj/ghc/pkg.conf \
+ ${PREFIX}/lib/ghc-${GHC_VERSION}/imports/HaXml/
+.endif
+ @(cd ${WRKSRC} && ${INSTALL_PROGRAM} \
+ Canonicalise DtdToHaskell MkOneOf Validate Xtract ${PREFIX}/bin)
.if !defined(NOPORTDOCS)
@${RM} -rf ${WRKSRC}/docs/CVS
@${MKDIR} ${DOCSDIR}