# New ports collection makefile for:   c2hs
# Date created:        23 August 2002
# Whom:                Oliver Braun <obraun@FreeBSD.org>
#
# $FreeBSD: ports/devel/hs-c2hs/Makefile,v 1.35 2007/11/09 08:09:19 vs Exp $
#

PORTNAME=	c2hs
PORTVERSION=	0.15.0
CATEGORIES=	devel haskell
MASTER_SITES=	http://www.cse.unsw.edu.au/~chak/haskell/c2hs/
PKGNAMEPREFIX=	hs-

MAINTAINER=	haskell@FreeBSD.org
COMMENT=	C->Haskell, an Interface Generator for Haskell

BUILD_DEPENDS=	ghc:${PORTSDIR}/lang/ghc \
		happy:${PORTSDIR}/devel/hs-happy \
		alex:${PORTSDIR}/devel/hs-alex
LIB_DEPENDS=	gmp.7:${PORTSDIR}/math/libgmp4

.include <bsd.port.pre.mk>

GHC_VERSION=	6.6.1

# 'owned' by lang/ghc:
CABALDIR=       ${PREFIX}/${SUBDIR}
CABALCMD=       ${LOCALBASE}/bin/runghc Setup.hs
SUBDIR=		lib/ghc-${GHC_VERSION}/cabal

PLIST_FILES=	bin/c2hs ${SUBDIR}/${PORTNAME}/C2HS.hs
PLIST_DIRS=	${SUBDIR}/${PORTNAME}

CONFIGURE_ARGS=	--ghc --prefix=${PREFIX} --libdir=${CABALDIR} \
			--datadir=${CABALDIR}/${PORTNAME} \
			--libsubdir='' --datasubdir=''

do-configure:
	cd ${WRKSRC} && ${CABALCMD} configure ${CONFIGURE_ARGS}

do-build:
	cd ${WRKSRC} && ${CABALCMD} build

do-install:
	cd ${WRKSRC} && ${CABALCMD} install

post-install:
	@${STRIP_CMD} ${PREFIX}/bin/c2hs

.include <bsd.port.post.mk>
