aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgj <pgj@FreeBSD.org>2010-01-03 06:59:58 +0800
committerpgj <pgj@FreeBSD.org>2010-01-03 06:59:58 +0800
commitf357b6113fcb8b3dd350ecf4cb69e4b736b4ca43 (patch)
tree73355f50054425f2e50f41fe0095ccc2ad0e8dbb
parentb94d7becb9fff4a1b71fe24c1cbd4c066be9261a (diff)
downloadfreebsd-ports-gnome-f357b6113fcb8b3dd350ecf4cb69e4b736b4ca43.tar.gz
freebsd-ports-gnome-f357b6113fcb8b3dd350ecf4cb69e4b736b4ca43.tar.zst
freebsd-ports-gnome-f357b6113fcb8b3dd350ecf4cb69e4b736b4ca43.zip
Partial functions from the Haskell base library, such as head and !!, modified
to return more descriptive error messages, programmer defined error messages, Maybe wrapped results and default values. These functions can be used to reduce the number of unsafe pattern matches in your code. WWW: http://www-users.cs.york.ac.uk/~ndm/safe/ PR: ports/142144 Submitted by: Jacula Modyun <jacula(at)gmail.com>
-rw-r--r--devel/Makefile1
-rw-r--r--devel/hs-safe/Makefile75
-rw-r--r--devel/hs-safe/distinfo3
-rw-r--r--devel/hs-safe/pkg-descr8
-rw-r--r--devel/hs-safe/pkg-plist13
5 files changed, 100 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 23821a513398..13998e8b9233 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -551,6 +551,7 @@
SUBDIR += hs-mmap
SUBDIR += hs-pcre-light-ghc
SUBDIR += hs-readline
+ SUBDIR += hs-safe
SUBDIR += hs-uniplate
SUBDIR += hs-utf8-string-ghc
SUBDIR += hs-uuagc
diff --git a/devel/hs-safe/Makefile b/devel/hs-safe/Makefile
new file mode 100644
index 000000000000..dc6f77d085e1
--- /dev/null
+++ b/devel/hs-safe/Makefile
@@ -0,0 +1,75 @@
+# New ports collection makefile for: hs-safe
+# Date created: December 20 2009
+# Whom: Giuseppe Pilichi aka Jacula Modyun <jacula@gmail.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= safe
+PORTVERSION= 0.2
+CATEGORIES= devel haskell
+MASTER_SITES= http://hackage.haskell.org/packages/archive/${PORTNAME}/${PORTVERSION}/
+PKGNAMEPREFIX= hs-
+
+MAINTAINER= jacula@gmail.com
+COMMENT= A Haskell library for safe (pattern match free) functions
+
+BUILD_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
+RUN_DEPENDS+= ghc:${PORTSDIR}/lang/ghc
+
+GHC_VERSION= 6.10.4
+SAFE_VERSION= ${PORTVERSION}
+
+GHC_CMD= ${LOCALBASE}/bin/ghc
+SETUP_CMD= ./setup
+
+DOCSDIR= ${PREFIX}/share/doc/${DISTNAME}
+SAFE_LIBDIR_REL= lib/${DISTNAME}
+
+PLIST_SUB= GHC_VERSION=${GHC_VERSION} \
+ SAFE_VERSION=${SAFE_VERSION} \
+ SAFE_LIBDIR_REL=${SAFE_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}/${SAFE_LIBDIR_REL}/register.sh
+
+post-install:
+ ${RM} -f ${PREFIX}/lib/ghc-${GHC_VERSION}/package.conf.old
+
+.include <bsd.port.mk>
diff --git a/devel/hs-safe/distinfo b/devel/hs-safe/distinfo
new file mode 100644
index 000000000000..931ffeaa4316
--- /dev/null
+++ b/devel/hs-safe/distinfo
@@ -0,0 +1,3 @@
+MD5 (safe-0.2.tar.gz) = e5331578ea7e0b68ed1ea4df923a23ca
+SHA256 (safe-0.2.tar.gz) = 73b9a247c3ba8092236c8c912687399778ff31bf3df42d707563a1528a6fc0e0
+SIZE (safe-0.2.tar.gz) = 3557
diff --git a/devel/hs-safe/pkg-descr b/devel/hs-safe/pkg-descr
new file mode 100644
index 000000000000..381c4a0f6a1d
--- /dev/null
+++ b/devel/hs-safe/pkg-descr
@@ -0,0 +1,8 @@
+Partial functions from the Haskell base library, such as head and !!, modified
+to return more descriptive error messages, programmer defined error messages,
+Maybe wrapped results and default values.
+
+These functions can be used to reduce the number of unsafe pattern matches in
+your code.
+
+WWW: http://www-users.cs.york.ac.uk/~ndm/safe/
diff --git a/devel/hs-safe/pkg-plist b/devel/hs-safe/pkg-plist
new file mode 100644
index 000000000000..f69bcafd8767
--- /dev/null
+++ b/devel/hs-safe/pkg-plist
@@ -0,0 +1,13 @@
+@comment $FreeBSD$
+%%SAFE_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/HSsafe-%%SAFE_VERSION%%.o
+%%SAFE_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/Safe.hi
+%%SAFE_LIBDIR_REL%%/ghc-%%GHC_VERSION%%/libHSsafe-%%SAFE_VERSION%%.a
+%%SAFE_LIBDIR_REL%%/register.sh
+%%NOPORTDOCS%%%%DOCSDIR%%/LICENSE
+%%NOPORTDOCS%%@dirrmtry %%DOCSDIR%%
+@dirrm %%SAFE_LIBDIR_REL%%/ghc-%%GHC_VERSION%%
+@dirrm %%SAFE_LIBDIR_REL%%
+@exec /bin/sh %D/%%SAFE_LIBDIR_REL%%/register.sh
+@exec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old
+@unexec %D/bin/ghc-pkg unregister safe
+@unexec /bin/rm -f %D/lib/ghc-%%GHC_VERSION%%/package.conf.old