From jacula@gmail.com  Fri Jul 24 17:18:44 2009
Return-Path: <jacula@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F818106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jul 2009 17:18:44 +0000 (UTC)
	(envelope-from jacula@gmail.com)
Received: from mail-fx0-f219.google.com (mail-fx0-f219.google.com [209.85.220.219])
	by mx1.freebsd.org (Postfix) with ESMTP id 050F78FC19
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jul 2009 17:18:43 +0000 (UTC)
	(envelope-from jacula@gmail.com)
Received: by fxm19 with SMTP id 19so21158fxm.43
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jul 2009 10:18:43 -0700 (PDT)
Received: by 10.204.67.141 with SMTP id r13mr3424003bki.166.1248455922811;
        Fri, 24 Jul 2009 10:18:42 -0700 (PDT)
Received: from splork.wirewater.yow (host247-86-dynamic.55-79-r.retail.telecomitalia.it [79.55.86.247])
        by mx.google.com with ESMTPS id 13sm5427730fks.22.2009.07.24.10.18.41
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Fri, 24 Jul 2009 10:18:41 -0700 (PDT)
Received: from localhost.wirewater.yow [127.0.0.1]
 	by splork.wirewater.yow (Sendmail: 8.14.3/8.14.3) with ESMTP id n6OHIe9b090434
 	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jul 2009 17:18:40 GMT
Received: by splork.wirewater.yow (Sendmail: 8.14.3/8.14.3/Submit) id n6OHIesA090432
	;
 	Fri, 24 Jul 2009 17:18:40 GMT
Message-Id: <200907241718.n6OHIesA090432@splork.wirewater.yow>
Date: Fri, 24 Jul 2009 10:18:41 -0700 (PDT)
From: Jacula Modyun <jacula@gmail.com>
Reply-To: Jacula Modyun <jacula@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch]: update of devel/hs-cpphs from the 1.6 version to the 1.7 version
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         137071
>Category:       ports
>Synopsis:       [patch]: update of devel/hs-cpphs from the 1.6 version to the 1.7 version
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgj
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 24 17:20:06 UTC 2009
>Closed-Date:    Wed Sep 02 17:05:21 UTC 2009
>Last-Modified:  Wed Sep 02 17:05:21 UTC 2009
>Originator:     Jacula Modyun
>Release:        FreeBSD 7.1-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD splork.wirewater.yow 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sat Oct 18 11:22:07 UTC 2008 root@splork.wirewater.yow:/usr/obj/usr/src/sys/JACULA i386


	
>Description:

See the PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/137055

>How-To-Repeat:
	
>Fix:

	

--- patch-hs-cpphs.diff begins here ---
diff -uNr hs-cpphs.orig/Makefile hs-cpphs/Makefile
--- hs-cpphs.orig/Makefile	2009-05-13 09:45:49.000000000 +0000
+++ hs-cpphs/Makefile	2009-07-22 06:21:43.000000000 +0000
@@ -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 @@
 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 -uNr hs-cpphs.orig/distinfo hs-cpphs/distinfo
--- hs-cpphs.orig/distinfo	2009-01-24 00:13:28.000000000 +0000
+++ hs-cpphs/distinfo	2009-07-14 08:29:46.000000000 +0000
@@ -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 -uNr hs-cpphs.orig/pkg-descr hs-cpphs/pkg-descr
--- hs-cpphs.orig/pkg-descr	2004-06-14 18:28:55.000000000 +0000
+++ hs-cpphs/pkg-descr	2009-07-14 09:14:29.000000000 +0000
@@ -7,4 +7,11 @@
     * conditional compilation only (--nomacro),
     * and full macro-expansion (default).
 
-WWW: http://www.cs.york.ac.uk/fp/cpphs/
+Author:		Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
+Maintainer:	Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
+License:	LGPL
+URL:		http://haskell.org/cpphs/
+WWW:		http://www.cs.york.ac.uk/fp/cpphs/
+
+Exposed-Modules: Language.Preprocessor.Cpphs
+		 Language.Preprocessor.Unlit
diff -uNr hs-cpphs.orig/pkg-plist hs-cpphs/pkg-plist
--- hs-cpphs.orig/pkg-plist	1970-01-01 00:00:00.000000000 +0000
+++ hs-cpphs/pkg-plist	2009-07-20 19:05:03.000000000 +0000
@@ -0,0 +1,32 @@
+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
--- patch-hs-cpphs.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->haskell 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Jul 24 17:20:27 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137071 
Responsible-Changed-From-To: haskell->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Fri Jul 24 19:30:08 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137071 
Responsible-Changed-From-To: wxs->pgj 
Responsible-Changed-By: pgj 
Responsible-Changed-When: Fri Aug 28 20:12:12 UTC 2009 
Responsible-Changed-Why:  
Over to me. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137071 
State-Changed-From-To: open->closed 
State-Changed-By: pgj 
State-Changed-When: Wed Sep 2 17:05:04 UTC 2009 
State-Changed-Why:  
Committed.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137071 
>Unformatted:
