From dbace80aa26917a8add5bf2d43b6fc08ed57577d Mon Sep 17 00:00:00 2001 From: Oliver Braun Date: Wed, 25 Feb 2004 11:40:09 +0000 Subject: [PATCH] Make c2hs buildable with either ghc6 (default) or ghc5. Submitted by: Volker Stolz --- devel/hs-c2hs/Makefile | 27 ++++++++++++++++++++++----- devel/hs-c2hs/pkg-plist | 22 +++++++++++----------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/devel/hs-c2hs/Makefile b/devel/hs-c2hs/Makefile index 1e45103b9e06..41f470dd8ef7 100644 --- a/devel/hs-c2hs/Makefile +++ b/devel/hs-c2hs/Makefile @@ -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 + +.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 +.include diff --git a/devel/hs-c2hs/pkg-plist b/devel/hs-c2hs/pkg-plist index 1b6fad7e747e..40bb485aae3c 100644 --- a/devel/hs-c2hs/pkg-plist +++ b/devel/hs-c2hs/pkg-plist @@ -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