From nobody@FreeBSD.org  Tue Jun  5 11:14:30 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 87876106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Jun 2012 11:14:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 722D48FC21
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Jun 2012 11:14:30 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q55BEUSo051969
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 5 Jun 2012 11:14:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q55BEUf1051968;
	Tue, 5 Jun 2012 11:14:30 GMT
	(envelope-from nobody)
Message-Id: <201206051114.q55BEUf1051968@red.freebsd.org>
Date: Tue, 5 Jun 2012 11:14:30 GMT
From: Marco Brder <marco.broeder@gmx.eu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [maintainer-update] [patch] devel/diffuse: Convert to new options framework
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         168707
>Category:       ports
>Synopsis:       [maintainer-update] [patch] devel/diffuse: Convert to new options framework
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sylvio
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 05 11:20:13 UTC 2012
>Closed-Date:    Wed Jun 06 20:58:11 UTC 2012
>Last-Modified:  Wed Jun  6 21:00:29 UTC 2012
>Originator:     Marco Brder
>Release:        stable/9 amd64
>Organization:
>Environment:
>Description:
- Convert to new options framework
- Add two additional options and disable automatic sorting
- Add necessary checks for conflicting options vs. make.conf settings
(NOPORTDOCS, NOPORTDATA, WITHOUT_NLS)
- Port passes all tests of all combinations of options, including potentially
conflicting make.conf settings (NOPORTDOCS, NOPORTDATA, WITHOUT_NLS)
- Mark conflict with biology/tinker, both ports install ${PREFIX}/bin/diffuse
- Bump PORTREVISION

Tested: portlint, several tinderbox runs, pkg_add / pkg_delete, runtime

Thanks!


PS: NOPORTDATA is not covered by new options framework. It should probably be
treated like NOPORTDOCS => DOCS and NOPORTEXAMPLES => EXAMPLES:


bsd.options.mk:

.if !defined(NOPORTDATA)
PORT_OPTIONS+=DATA
.endif

.if empty(PORT_OPTIONS:MDATA)
NOPORTDATA=yes
.endif


bsd.options.desc.mk:

DATA_DESC=Build and install additional or special data files


.. or a better description than that.

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/devel/diffuse/Makefile b/devel/diffuse/Makefile
index 7b87415..4eb95be 100644
--- a/devel/diffuse/Makefile
+++ b/devel/diffuse/Makefile
@@ -7,7 +7,7 @@
 
 PORTNAME=	diffuse
 PORTVERSION=	0.4.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel python
 MASTER_SITES=	SF
 
@@ -25,41 +25,49 @@ USE_BZIP2=	yes
 
 MAN1=		diffuse.1
 
-OPTIONS=	MENU	"Install a desktop menu entry"	on \
-		NLS	"Install translations (work in progress)"	on
+CONFLICTS=	tinker-[0-9]*
 
-.include <bsd.port.options.mk>
-
-.ifndef (NOPORTDOCS)
-PORTDOCS=	AUTHORS COPYING ChangeLog ChangeLog_ru README README_ru
-.endif
+NO_OPTIONS_SORT=	yes
+OPTIONS_DEFINE=	MENU DATA NLS DOCS
+MENU_DESC=	Enable a desktop program menu entry
+DATA_DESC=	Enable syntax highlighting support
+DOCS_DESC=	Install some documentation text files
+OPTIONS_DEFAULT=	MENU DATA NLS DOCS
 
-.ifndef (NOPORTDATA)
-PORTDATA=	syntax
-.endif
+.include <bsd.port.options.mk>
 
-.ifdef (WITH_MENU)
-PLIST_SUB+=	MENU=""
+.if ${PORT_OPTIONS:MMENU}
 USE_GNOME+=	desktopfileutils
+PLIST_SUB+=	MENU=""
 .else
 PLIST_SUB+=	MENU="@comment "
 .endif
 
-.ifndef (WITHOUT_NLS)
-PLIST_SUB+=	NLS=""
+.if ${PORT_OPTIONS:MDATA}
+PORTDATA=	syntax
+.endif
+
+.if ${PORT_OPTIONS:MNLS} && !defined(WITHOUT_NLS)
+# Both checks required. If option is selected, but WITHOUT_NLS is set
+# in make.conf, it breaks pkg-plist.
 USE_GETTEXT=	yes
 TRANSLATIONS=	de es it ja ko ru zh_CN
 MANLANG=	"" it ru
+PLIST_SUB+=	NLS=""
 .else
 PLIST_SUB+=	NLS="@comment "
 .endif
 
+.if ${PORT_OPTIONS:MDOCS}
+PORTDOCS=	AUTHORS COPYING ChangeLog ChangeLog_ru README README_ru
+.endif
+
 post-patch:
-.ifndef (NOPORTDATA)
+.if ${PORT_OPTIONS:MDATA} && !defined(NOPORTDATA)
 	${REINPLACE_CMD} -e 's|../usr|${PREFIX}|g; s|/etc|${PREFIX}/etc|g' \
 		${WRKSRC}/src/etc/${PORTNAME}rc
 .else
-	${REINPLACE_CMD} -e 's|import ../usr|\#(Disabled by NOPORTDATA !) \
+	${REINPLACE_CMD} -e 's|import ../usr|\#(Option disabled!) \
 		import ${PREFIX}|g; s|/etc|${PREFIX}/etc|g' \
 		${WRKSRC}/src/etc/${PORTNAME}rc
 .endif
@@ -75,18 +83,21 @@ do-install:
 		${MANPREFIX}/man/man1/
 
 post-install:
-.ifndef (NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
-	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
+.if ${PORT_OPTIONS:MMENU}
+	${INSTALL_DATA} ${WRKSRC}/src/usr/share/pixmaps/${PORTNAME}.png \
+		${PREFIX}/share/pixmaps/
+	${INSTALL_DATA} ${WRKSRC}/src/usr/share/applications/*.desktop \
+		${DESKTOPDIR}
+	${LOCALBASE}/bin/update-desktop-database -q
 .endif
 
-.ifndef (NOPORTDATA)
+.if ${PORT_OPTIONS:MDATA} && !defined(NOPORTDATA)
 	${MKDIR} ${DATADIR}/syntax
 	(cd ${WRKSRC}/src/usr/share/${PORTNAME} && \
 		${COPYTREE_SHARE} \* ${DATADIR})
 .endif
 
-.ifndef (WITHOUT_NLS)
+.if ${PORT_OPTIONS:MNLS} && !defined(WITHOUT_NLS)
 	for x in ${TRANSLATIONS}; do \
 		${MKDIR} ${WRKSRC}/translations/$${x}; \
 		${LOCALBASE}/bin/msgfmt -c ${WRKSRC}/translations/$${x}.po \
@@ -101,12 +112,9 @@ post-install:
 	done
 .endif
 
-.ifdef (WITH_MENU)
-	${INSTALL_DATA} ${WRKSRC}/src/usr/share/pixmaps/${PORTNAME}.png \
-		${PREFIX}/share/pixmaps/
-	${INSTALL_DATA} ${WRKSRC}/src/usr/share/applications/*.desktop \
-		${DESKTOPDIR}
-	${LOCALBASE}/bin/update-desktop-database -q
+.if ${PORT_OPTIONS:MDOCS} && !defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
 .endif
 
 .include <bsd.port.mk>


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->sylvio 
Responsible-Changed-By: sylvio 
Responsible-Changed-When: Tue Jun 5 13:37:09 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168707 
State-Changed-From-To: open->closed 
State-Changed-By: sylvio 
State-Changed-When: Wed Jun 6 20:58:10 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168707 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/168707: commit references a PR
Date: Wed,  6 Jun 2012 20:58:22 +0000 (UTC)

 sylvio      2012-06-06 20:57:59 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/diffuse        Makefile 
   Log:
   - Convert to new options framework
   - Add two additional options and disable automatic sorting
   - Add necessary checks for conflicting options vs. make.conf settings
   (NOPORTDOCS, NOPORTDATA, WITHOUT_NLS)
   - Port passes all tests of all combinations of options, including potentially
   conflicting make.conf settings (NOPORTDOCS, NOPORTDATA, WITHOUT_NLS)
   - Mark conflict with biology/tinker, both ports install ${PREFIX}/bin/diffuse
   - Bump PORTREVISION
   
   PR:             ports/168707
   Submitted by:   Marco Bröder <marco.broeder@gmx.eu> (maintainer)
   
   Revision  Changes    Path
   1.17      +36 -28    ports/devel/diffuse/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
