aboutsummaryrefslogtreecommitdiff
path: root/devel/hs-cpphs
diff options
context:
space:
mode:
authorGabor Pali <pgj@FreeBSD.org>2009-09-02 15:38:45 +0000
committerGabor Pali <pgj@FreeBSD.org>2009-09-02 15:38:45 +0000
commit7d5781e5ab3aa2c4d9f46985acec697caae1c173 (patch)
treefb0e55efa60858746649977ee5813f549bfbad04 /devel/hs-cpphs
parent9acc5ac910695e85c7d24401bfecd5d6e6da0d7f (diff)
Notes
Diffstat (limited to 'devel/hs-cpphs')
-rw-r--r--devel/hs-cpphs/Makefile60
-rw-r--r--devel/hs-cpphs/distinfo6
-rw-r--r--devel/hs-cpphs/pkg-plist33
3 files changed, 91 insertions, 8 deletions
diff --git a/devel/hs-cpphs/Makefile b/devel/hs-cpphs/Makefile
index 09d85b1d1b05..7676e04e0d95 100644
--- a/devel/hs-cpphs/Makefile
+++ b/devel/hs-cpphs/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= cpphs
-PORTVERSION= 1.6
-PORTREVISION= 1
+PORTVERSION= 1.7
CATEGORIES= devel haskell
MASTER_SITES= http://www.cs.york.ac.uk/fp/cpphs/
PKGNAMEPREFIX= hs-
@@ -16,17 +15,68 @@ MAINTAINER= haskell@FreeBSD.org
COMMENT= A simplified re-implementation of cpp in Haskell
BUILD_DEPENDS= ghc:${PORTSDIR}/lang/ghc
+RUN_DEPENDS= ghc:${PORTSDIR}/lang/ghc
LIB_DEPENDS= gmp.8:${PORTSDIR}/math/libgmp4
-PLIST_FILES= bin/cpphs
+GHC_VERSION= 6.10.4
+CPPHS_VERSION= ${PORTVERSION}
+
+GHC_CMD= ${LOCALBASE}/bin/ghc
+SETUP_CMD= ./setup
+
+DATADIR= ${PREFIX}/share/${DISTNAME}
+DOCSDIR= ${PREFIX}/share/doc/${DISTNAME}
+CPPHS_LIBDIR_REL= lib/${DISTNAME}
+
+PLIST_SUB= GHC_VERSION=${GHC_VERSION} \
+ CPPHS_VERSION=${CPPHS_VERSION} \
+ CPPHS_LIBDIR_REL=${CPPHS_LIBDIR_REL}
MAN1= cpphs.1
+.if defined(NOPORTDOCS)
+PLIST_SUB+= NOPORTDOCS=""
+.else
+PLIST_SUB+= NOPORTDOCS="@comment "
+.endif
+
+.if !defined(NOPORTDOCS)
+
+PORT_HADDOCK!= (cd ${.CURDIR}/../../lang/ghc && ${MAKE} -V PORT_HADDOCK)
+.if !empty(PORT_HADDOCK:M?0)
+BUILD_DEPENDS+= haddock:${PORTSDIR}/devel/hs-haddock
+.endif
+
+BUILD_DEPENDS+= HsColour:${PORTSDIR}/print/hs-hscolour
+HSCOLOUR_VERSION= 1.13
+HSCOLOUR_DATADIR= ${PREFIX}/share/hscolour-${HSCOLOUR_VERSION}
+
+PORTDOCS= *
+.endif
+
+.SILENT:
+
+do-configure:
+ cd ${WRKSRC} && ${GHC_CMD} --make Setup.hs -o setup -package Cabal \
+ && ${SETUP_CMD} configure --haddock-options=-w --prefix=${PREFIX}
+
do-build:
- @(cd ${WRKSRC} && ghc -o cpphs --make cpphs)
+ cd ${WRKSRC} && ${SETUP_CMD} build \
+ && ${SETUP_CMD} register --gen-script
+
+.if !defined(NOPORTDOCS)
+ cd ${WRKSRC} && ${SETUP_CMD} haddock --hyperlink-source --executables \
+ --hscolour-css=${HSCOLOUR_DATADIR}/hscolour.css
+.endif
do-install:
- @${INSTALL_PROGRAM} ${WRKSRC}/cpphs ${PREFIX}/bin/cpphs
+ cd ${WRKSRC} && ${SETUP_CMD} install \
+ && ${INSTALL_SCRIPT} register.sh ${PREFIX}/${CPPHS_LIBDIR_REL}/register.sh
@${INSTALL_MAN} ${WRKSRC}/docs/cpphs.1 ${PREFIX}/man/man1
+ @${MKDIR} ${DATADIR} && ${INSTALL_DATA} ${WRKSRC}/docs/index.html ${DATADIR} \
+ && ${INSTALL_DATA} ${WRKSRC}/docs/design ${DATADIR}
+
+post-install:
+ ${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old
.include <bsd.port.mk>
diff --git a/devel/hs-cpphs/distinfo b/devel/hs-cpphs/distinfo
index 7229b6f1afd4..38a920099ce4 100644
--- a/devel/hs-cpphs/distinfo
+++ b/devel/hs-cpphs/distinfo
@@ -1,3 +1,3 @@
-MD5 (cpphs-1.6.tar.gz) = 8a7565ff3b2d7bdb594af4c10c594951
-SHA256 (cpphs-1.6.tar.gz) = 2e7c430fde17adbb3905e6d2a3c3845a40349c61a53fcfa40c733e8b43e73295
-SIZE (cpphs-1.6.tar.gz) = 110723
+MD5 (cpphs-1.7.tar.gz) = e76cba8387e7f4747b21fbca4881a78a
+SHA256 (cpphs-1.7.tar.gz) = 5c8c94f7a8f6c8441b908532288339196e02141dac1d7c69ea045fd4ac3a6944
+SIZE (cpphs-1.7.tar.gz) = 113724
diff --git a/devel/hs-cpphs/pkg-plist b/devel/hs-cpphs/pkg-plist
new file mode 100644
index 000000000000..80cbaac78ecf
--- /dev/null
+++ b/devel/hs-cpphs/pkg-plist
@@ -0,0 +1,33 @@
+@comment $FreeBSD$
+bin/cpphs
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/HScpphs-%%CPPHS_VERSION%%.o
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/CppIfdef.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/HashDefine.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/MacroPass.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/Options.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/Position.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/ReadFirst.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/RunCpphs.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/SymTab.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs/Tokenise.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Unlit.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/ParserCombinators/HuttonMeijer.hi
+%%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/libHScpphs-%%CPPHS_VERSION%%.a
+%%CPPHS_LIBDIR_REL%%/register.sh
+%%DATADIR%%/design
+%%DATADIR%%/index.html
+%%NOPORTDOCS%%%%DOCSDIR%%/LICENCE-LGPL
+%%NOPORTDOCS%%@dirrmtry %%DOCSDIR%%
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/ParserCombinators
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor/Cpphs
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language/Preprocessor
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Language
+@dirrm %%CPPHS_LIBDIR_REL%%/ghc-%%GHC_VERSION%%
+@dirrm %%CPPHS_LIBDIR_REL%%
+@dirrmtry %%DATADIR%%
+@exec /bin/sh %D/%%CPPHS_LIBDIR_REL%%/register.sh
+@exec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old
+@unexec %D/bin/ghc-pkg unregister cpphs
+@unexec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old