aboutsummaryrefslogtreecommitdiffstats
path: root/converters/hs-json
diff options
context:
space:
mode:
authorpgj <pgj@FreeBSD.org>2010-05-13 00:33:59 +0800
committerpgj <pgj@FreeBSD.org>2010-05-13 00:33:59 +0800
commitf203c3895196ffa8b69517527e8c488cc49ada57 (patch)
treed7be6abb9940698d6dc43b1587948a03039a23b5 /converters/hs-json
parent965f4ecbcd1c9f6296e907af59901feeedfdc42f (diff)
downloadfreebsd-ports-gnome-f203c3895196ffa8b69517527e8c488cc49ada57.tar.gz
freebsd-ports-gnome-f203c3895196ffa8b69517527e8c488cc49ada57.tar.zst
freebsd-ports-gnome-f203c3895196ffa8b69517527e8c488cc49ada57.zip
Introduce a new (and hopefully better) ports infrastructure for Haskell Cabal
ports which makes possible the direct translation of Cabal package descriptions to FreeBSD ports. It promises both easier addition and maintenance for Cabal-based ports.
Diffstat (limited to 'converters/hs-json')
-rw-r--r--converters/hs-json/Makefile61
-rw-r--r--converters/hs-json/pkg-plist32
2 files changed, 18 insertions, 75 deletions
diff --git a/converters/hs-json/Makefile b/converters/hs-json/Makefile
index a7e5fba283ed..c374428a1af3 100644
--- a/converters/hs-json/Makefile
+++ b/converters/hs-json/Makefile
@@ -8,68 +8,11 @@
PORTNAME= json
PORTVERSION= 0.4.3
CATEGORIES= converters haskell
-MASTER_SITES= http://hackage.haskell.org/packages/archive/${PORTNAME}/${PORTVERSION}/
-PKGNAMEPREFIX= hs-
MAINTAINER= jacula@gmail.com
COMMENT= Support for serialising Haskell to and from JSON
-BUILD_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
-RUN_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
-
-GHC_VERSION= 6.10.4
-HSJSON_VERSION= ${PORTVERSION}
-
-GHC_CMD= ${LOCALBASE}/bin/ghc
-SETUP_CMD= ./setup
-
-DOCSDIR= ${PREFIX}/share/doc/${DISTNAME}
-HSJSON_LIBDIR_REL= lib/${DISTNAME}
-
-PLIST_SUB= GHC_VERSION=${GHC_VERSION} \
- HSJSON_VERSION=${HSJSON_VERSION} \
- HSJSON_LIBDIR_REL=${HSJSON_LIBDIR_REL}
-
-.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.15
-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} && ${SETUP_CMD} build \
- && ${SETUP_CMD} register --gen-script
-
-.if !defined(NOPORTDOCS)
- cd ${WRKSRC} && ${SETUP_CMD} haddock --hyperlink-source \
- --hscolour-css=${HSCOLOUR_DATADIR}/hscolour.css
-.endif
-
-do-install:
- cd ${WRKSRC} && ${SETUP_CMD} install \
- && ${INSTALL_SCRIPT} register.sh ${PREFIX}/${HSJSON_LIBDIR_REL}/register.sh
-
-post-install:
- ${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old
+CABAL_SETUP= Setup.hs
+.include "${.CURDIR}/../../lang/ghc/bsd.cabal.mk"
.include <bsd.port.mk>
diff --git a/converters/hs-json/pkg-plist b/converters/hs-json/pkg-plist
index e3be3739b6c2..e905410654af 100644
--- a/converters/hs-json/pkg-plist
+++ b/converters/hs-json/pkg-plist
@@ -1,21 +1,21 @@
@comment $FreeBSD$
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/HSjson-%%HSJSON_VERSION%%.o
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Generic.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Parsec.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Pretty.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/ReadP.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/String.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Types.hi
-%%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/libHSjson-%%HSJSON_VERSION%%.a
-%%HSJSON_LIBDIR_REL%%/register.sh
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/HS%%PORTNAME%%-%%PORTVERSION%%.o
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Generic.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Parsec.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Pretty.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/ReadP.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/String.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON/Types.hi
+%%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/libHS%%PORTNAME%%-%%PORTVERSION%%.a
+%%LIBDIR_REL%%/register.sh
%%NOPORTDOCS%%%%DOCSDIR%%/LICENSE
%%NOPORTDOCS%%@dirrmtry %%DOCSDIR%%
-@dirrm %%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON
-@dirrm %%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text
-@dirrm %%HSJSON_LIBDIR_REL%%/ghc-%%GHC_VERSION%%
-@dirrm %%HSJSON_LIBDIR_REL%%
-@exec /bin/sh %D/%%HSJSON_LIBDIR_REL%%/register.sh
+@dirrm %%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text/JSON
+@dirrm %%LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Text
+@dirrm %%LIBDIR_REL%%/ghc-%%GHC_VERSION%%
+@dirrm %%LIBDIR_REL%%
+@exec /bin/sh %D/%%LIBDIR_REL%%/register.sh
@exec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old
-@unexec %D/bin/ghc-pkg unregister json
+@unexec %D/bin/ghc-pkg unregister %%PORTNAME%%-%%PORTVERSION%%
@unexec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old