summaryrefslogtreecommitdiffstats
path: root/textproc/hs-haxml/Makefile
blob: 14408da0bdb3afccb9e5648fa4552bdac7b01897 (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# New ports collection makefile for:	HaXml
# Date created:				01 June 2002
# Whom:					Oliver Braun <obraun@informatik.unibw-muenchen.de>
#
# $FreeBSD$

PORTNAME=	haxml
PORTVERSION=	1.13
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=	haskell@FreeBSD.org
COMMENT=	A collection of utilities for using Haskell and XML together

USE_REINPLACE=	yes
HAS_CONFIGURE=	yes
USE_GMAKE=	yes

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

.include <bsd.port.pre.mk>

.if exists(${LOCALBASE}/bin/nhc98)
WITH_NHC98=	yes
.endif
.if exists(${LOCALBASE}/bin/ghc)
WITH_GHC=	yes
.endif
.if exists(${LOCALBASE}/bin/hugs)
WITH_HUGS=	yes
.endif

.if defined(PACKAGE_BUILDING)
WITH_GHC=	yes
#WITH_HUGS=	yes
.endif

.if defined(WITH_NHC98)
BUILD_DEPENDS+=	nhc98:${PORTSDIR}/lang/nhc98
RUN_DEPENDS=	nhc98:${PORTSDIR}/lang/nhc98
.endif
.if defined(WITH_GHC)
BUILD_DEPENDS+=	ghc:${PORTSDIR}/lang/ghc
RUN_DEPENDS+=	ghc:${PORTSDIR}/lang/ghc
.endif
.if defined(WITH_HUGS)
BUILD_DEPENDS+=	hugs:${PORTSDIR}/lang/hugs
RUN_DEPENDS+=	hugs:${PORTSDIR}/lang/hugs
.endif

.if defined(WITH_NHC98)
PLIST_SUB+=	NHC98=""
.else
PLIST_SUB+=	NHC98="@comment "
.endif
.if defined(WITH_GHC)
GHC_VERSION=	`${LOCALBASE}/bin/ghc --numeric-version`
PLIST_SUB+=	GHC="" GHC_VERSION="${GHC_VERSION}"
.else
PLIST_SUB+=	GHC="@comment "
.endif
.if defined(WITH_HUGS)
PLIST_SUB+=	HUGS=""
.else
PLIST_SUB+=	HUGS="@comment "
.endif

pre-everything::
	@${ECHO_CMD} ""
.if defined(WITH_NHC98)
	@${ECHO_CMD} " HaXml will be installed for nhc98."
.else
	@${ECHO_CMD} " Define WITH_NHC98 to install HaXml for nhc98."
.endif
.if defined(WITH_GHC)
	@${ECHO_CMD} " HaXml will be installed for ghc."
.else
	@${ECHO_CMD} " Define WITH_GHC   to install HaXml for ghc."
.endif
.if defined(WITH_HUGS)
	@${ECHO_CMD} " HaXml will be installed for hugs"
.else
	@${ECHO_CMD} " Define WITH_HUGS  to install HaXml for hugs"
.endif
.if !defined(WITH_GHC) && !defined(WITH_NHC98) && !defined(WITH_HUGS)
	@${FALSE}
.endif
	@${ECHO_CMD} ""

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

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

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud