summaryrefslogtreecommitdiff
path: root/textproc/hs-HaXml/Makefile
blob: 5e66f22cf059207c620dd846739f990c64db1d28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# New ports collection makefile for:	HaXml
# Date created:				01 June 2002
# Whom:					Oliver Braun <obraun@informatik.unibw-muenchen.de>
#
# $FreeBSD$

PORTNAME=	haxml
PORTVERSION=	1.09
PORTREVISION=	1
CATEGORIES=	textproc haskell
MASTER_SITES=	http://www.haskell.org/HaXml/ \
		ftp://ftp.cs.york.ac.uk/pub/haskell/HaXml/
PKGNAMEPREFIX=	hs-
DISTNAME=	HaXml-${PORTVERSION}

MAINTAINER=	obraun@FreeBSD.org
COMMENT=	A collection of utilities for using Haskell and XML together

.if !defined(WITHOUT_NHC98)
BUILD_DEPENDS=	nhc98:${PORTSDIR}/lang/nhc98
RUN_DEPENDS=	nhc98:${PORTSDIR}/lang/nhc98
.endif
.if !defined(WITHOUT_GHC)
BUILD_DEPENDS+=	ghc:${PORTSDIR}/lang/ghc
RUN_DEPENDS+=	ghc:${PORTSDIR}/lang/ghc
.endif

USE_REINPLACE=	yes
HAS_CONFIGURE=	yes
USE_GMAKE=	yes
ALL_TARGET=	#empty

CONFIGURE_ARGS+=	--prefix=${PREFIX}/bin

.if defined(WITHOUT_GHC)
CONFIGURE_ARGS+=	--buildwith=nhc98
.endif
.if defined(WITHOUT_NHC98)
CONFIGURE_ARGS+=	--buildwith=ghc
.endif

.if !defined(WITHOUT_NHC98)
PLIST_SUB+=	NHC98=""
.else
PLIST_SUB+=	NHC98="@comment "
.endif
.if !defined(WITHOUT_GHC)
GHC_VERSION=	`${LOCALBASE}/bin/ghc --numeric-version`
PLIST_SUB+=	GHC="" GHC_VERSION="${GHC_VERSION}"
.else
PLIST_SUB+=	GHC="@comment "
.endif

pre-everything::
	@${ECHO_CMD} ""
.if defined(WITHOUT_GHC) && defined(WITHOUT_NHC98)
	@${ECHO_CMD} "Without everything?"
	@${ECHO_CMD} ""
	@${FALSE}
.elif !defined(WITHOUT_GHC) && !defined(WITHOUT_NHC98)
	@${ECHO_CMD} " HaXml will be installed for both nhc98 and ghc."
	@${ECHO_CMD} " Define WITHOUT_GHC   to avoid installation for ghc."
	@${ECHO_CMD} " Define WITHOUT_NHC98 to avoid installation for nhc98."
.elif defined(WITHOUT_NHC98)
	@${ECHO_CMD} " HaXml will be installed for ghc only."
.elif defined(WITHOUT_GHC)
	@${ECHO_CMD} " HaXml will be installed for nhc98 only."
.endif
	@${ECHO_CMD} ""

post-patch:
	@${REINPLACE_CMD} -e 's,/bin/false,/usr/bin/false,' ${WRKSRC}/configure

post-install:
.if !defined(WITHOUT_GHC)
	@${INSTALL_DATA} ${WRKSRC}/obj/ghc/pkg.conf \
		${PREFIX}/lib/ghc-${GHC_VERSION}/imports/HaXml/
	@${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old
.endif
.if !defined(NOPORTDOCS)
	@${RM} -rf ${WRKSRC}/docs/CVS
	@${RM} -rf ${WRKSRC}/docs/HaXml/CVS
	@${MKDIR} ${DOCSDIR}
	@(cd ${WRKSRC} && ${CP} -R docs/* ${DOCSDIR})
.endif

.include <bsd.port.mk>