Make c2hs buildable with either ghc6 (default) or ghc5.

Submitted by:	Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
This commit is contained in:
Oliver Braun 2004-02-25 11:40:09 +00:00
parent fa66d83c33
commit dbace80aa2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=102083
2 changed files with 33 additions and 16 deletions

View file

@ -14,17 +14,34 @@ PKGNAMEPREFIX= hs-
MAINTAINER= obraun@FreeBSD.org
COMMENT= C->Haskell, an Interface Generator for Haskell
BUILD_DEPENDS= ghc:${PORTSDIR}/lang/ghc
RUN_DEPENDS= ghc:${PORTSDIR}/lang/ghc
OPTIONS= GHC5 "Build for ghc5" off
.include <bsd.port.pre.mk>
.if defined(WITH_GHC5)
GHC= ghc-5.04.3
GHCDEP= ghc5
GHCMAJOR= 5
.else
GHC= ghc-6.2
GHCDEP= ghc
GHCMAJOR= 6
.endif
PKGNAMESUFFIX= -${GHCDEP}
BUILD_DEPENDS= ${GHC}:${PORTSDIR}/lang/${GHCDEP}
RUN_DEPENDS= ${GHC}:${PORTSDIR}/lang/${GHCDEP}
USE_SIZE= yes
HAS_CONFIGURE= yes
USE_GMAKE= yes
GHC_VERSION= `${LOCALBASE}/bin/ghc --numeric-version`
GHC_VERSION= `${LOCALBASE}/bin/${GHC} --numeric-version`
PLIST_SUB+= C2HS_VERSION="${PORTVERSION}" GHC_VERSION="${GHC_VERSION}"
PLIST_SUB+= GHCMAJOR="${GHCMAJOR}"
CONFIGURE_ARGS+= --prefix=${PREFIX} --enable-add-package
CONFIGURE_ARGS+= --prefix=${PREFIX} --enable-add-package \
--with-hc=${GHC}
MAN1= c2hs-config.1 c2hs.1
@ -36,4 +53,4 @@ post-install:
${INSTALL_MAN} c2hs-config.1 c2hs.1 ${MANPREFIX}/man/man1)
@${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View file

@ -1,16 +1,16 @@
bin/c2hs
bin/c2hs-config
lib/c2hs-%%C2HS_VERSION%%/ghc6/c2hs.conf
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/C2HS.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/C2HSBase.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/C2HSDeprecated.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/C2HSMarsh.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/NewStablePtr.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/import/NewStorable.hi
lib/c2hs-%%C2HS_VERSION%%/ghc6/libc2hs.a
lib/c2hs-%%C2HS_VERSION%%/ghc6/c2hs.o
@dirrm lib/c2hs-%%C2HS_VERSION%%/ghc6/import
@dirrm lib/c2hs-%%C2HS_VERSION%%/ghc6
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/c2hs.conf
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/C2HS.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/C2HSBase.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/C2HSDeprecated.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/C2HSMarsh.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/NewStablePtr.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import/NewStorable.hi
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/libc2hs.a
lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/c2hs.o
@dirrm lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%/import
@dirrm lib/c2hs-%%C2HS_VERSION%%/ghc%%GHCMAJOR%%
@dirrm lib/c2hs-%%C2HS_VERSION%%
@exec %D/bin/c2hs-config --package-conf | %D/bin/ghc-pkg -u -g
@exec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old