From sunpoet@sunpoet.net  Sat Oct 19 18:12:14 2013
Return-Path: <sunpoet@sunpoet.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id B7630CBA;
	Sat, 19 Oct 2013 18:12:14 +0000 (UTC)
	(envelope-from sunpoet@sunpoet.net)
Received: from sunpoet.net (sunpoet.net [220.135.71.135])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 830322956;
	Sat, 19 Oct 2013 18:12:14 +0000 (UTC)
Received: by sunpoet.net (Postfix, from userid 1000)
	id 66578475B; Sun, 20 Oct 2013 02:11:46 +0800 (CST)
Message-Id: <20131019181146.66578475B@sunpoet.net>
Date: Sun, 20 Oct 2013 02:11:46 +0800 (CST)
From: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dinoex@FreeBSD.org
Subject: [PATCH] audio/mp3asm: fix build with clang
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         183110
>Category:       ports
>Synopsis:       [PATCH] audio/mp3asm: fix build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 19 18:20:00 UTC 2013
>Closed-Date:    Fri Nov 08 06:59:42 CET 2013
>Last-Modified:  Fri Nov  8 06:00:00 UTC 2013
>Originator:     Sunpoet Po-Chuan Hsieh
>Release:        FreeBSD 10.0-BETA1 amd64
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD bonjour.sunpoet.net 10.0-BETA1 FreeBSD 10.0-BETA1 #0 r256445: Tue Oct 15 04:48:04 CST
>Description:
- Fix build with clang
- Convert to new options framework
- Support STAGEDIR
- Use PLIST_FILES and PORTDOCS instead of PLIST
- Use SED/REINPLACE_CMD instead of patch files

Port maintainer (dinoex@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_8 (mode: change, diff: SVN)
>How-To-Repeat:
>Fix:

--- mp3asm-0.1.3.1_1.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 330920)
+++ Makefile	(working copy)
@@ -13,7 +13,7 @@
 
 LICENSE=	GPLv2
 
-NO_STAGE=	yes
+OPTIONS_DEFINE=	DOCS
 
 USES=		gmake
 USE_BZIP2=	yes
@@ -20,6 +20,11 @@
 GNU_CONFIGURE=	yes
 WRKSRC=		${WRKDIR}/${PORTNAME}-0.1
 
+PLIST_FILES=	bin/mp3asm
+PORTDOCS=	Changelog README
+
+.include <bsd.port.options.mk>
+
 post-extract:
 	@${RM} ${WRKSRC}/config.cache
 
@@ -28,13 +33,15 @@
 		's|^CFLAGS=|#CFLAGS=|g' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e \
 		's|getprogname|_getprogname|g' ${WRKSRC}/src/mp3asm.c
+	@${REINPLACE_CMD} -e \
+		's|#include <argz.h>|#include <errno.h>|' ${WRKSRC}/src/mp3asm.h
+	@${REINPLACE_CMD} -e \
+		's|\([ (!]\)\(log[\.;]\)|\1mp3asm\2|g' ${WRKSRC}/src/*.c ${WRKSRC}/src/*.h
 
 post-install:
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-.for i in Changelog README
-	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
-.endfor
+.if ${PORT_OPTIONS:MDOCS}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}/
+	cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
 .endif
 
 .include <bsd.port.mk>
Index: files/patch-src::mp3asm.h
===================================================================
--- files/patch-src::mp3asm.h	(revision 330920)
+++ files/patch-src::mp3asm.h	(working copy)
@@ -1,10 +0,0 @@
---- src/mp3asm.h.orig	Fri Jul 20 11:17:05 2001
-+++ src/mp3asm.h	Fri Jul 20 11:17:58 2001
-@@ -30,7 +30,6 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sysexits.h>
--#include <argz.h>
- #include <ctype.h>
- 
- #define LOGBUFSIZE 4096
Index: files/patch-src::utils.c
===================================================================
--- files/patch-src::utils.c	(revision 330920)
+++ files/patch-src::utils.c	(working copy)
@@ -1,10 +0,0 @@
---- src/utils.c.orig	Fri Jul 20 11:14:59 2001
-+++ src/utils.c	Fri Jul 20 11:15:37 2001
-@@ -25,6 +25,7 @@
- #include "utils.h"
- #include <unistd.h>
- #include <stdio.h>
-+#include <errno.h>
- 
- /*
-  * tmalloc: mallocs cleanly
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 330920)
+++ pkg-plist	(working copy)
@@ -1,4 +0,0 @@
-bin/mp3asm
-%%PORTDOCS%%%%DOCSDIR%%/Changelog
-%%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
--- mp3asm-0.1.3.1_1.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Oct 19 18:20:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183110 
State-Changed-From-To: open->feedback 
State-Changed-By: dinoex 
State-Changed-When: Sun Oct 20 07:22:55 CEST 2013 
State-Changed-Why:  

OPTIONS_DEFINE should not be neededf, why did you include it? 

what clang problem is fixed with your patch. 

why should errno be include global? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=183110 
State-Changed-From-To: feedback->closed 
State-Changed-By: dinoex 
State-Changed-When: Fri Nov 8 06:59:23 CET 2013 
State-Changed-Why:  
committed with changes, thanks. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/183110: commit references a PR
Date: Fri,  8 Nov 2013 05:59:12 +0000 (UTC)

 Author: dinoex
 Date: Fri Nov  8 05:59:05 2013
 New Revision: 333182
 URL: http://svnweb.freebsd.org/changeset/ports/333182
 
 Log:
   - Fix build with clang
   - use STAGEDIR
   - use OPTIONS_DEFINE
   - Use PLIST_FILES and PORTDOCS instead of PLIST
   PR:		183110
   Submitted by:	sunpoet (Sunpoet Po-Chuan Hsieh)
   
   - rename patchfiles
   - merge REINPLACE_CMD
 
 Added:
   head/audio/mp3asm/files/patch-utils.c
      - copied unchanged from r333181, head/audio/mp3asm/files/patch-src::utils.c
 Deleted:
   head/audio/mp3asm/files/patch-src::mp3asm.h
   head/audio/mp3asm/files/patch-src::utils.c
   head/audio/mp3asm/pkg-plist
 Modified:
   head/audio/mp3asm/Makefile
 
 Modified: head/audio/mp3asm/Makefile
 ==============================================================================
 --- head/audio/mp3asm/Makefile	Fri Nov  8 05:29:43 2013	(r333181)
 +++ head/audio/mp3asm/Makefile	Fri Nov  8 05:59:05 2013	(r333182)
 @@ -13,28 +13,29 @@ COMMENT=	MP3 frame level editor
  
  LICENSE=	GPLv2
  
 -NO_STAGE=	yes
 -
  USES=		gmake
  USE_BZIP2=	yes
  GNU_CONFIGURE=	yes
  WRKSRC=		${WRKDIR}/${PORTNAME}-0.1
 +PLIST_FILES=	bin/mp3asm
 +PORTDOCS=	Changelog README
 +
 +.include <bsd.port.options.mk>
  
  post-extract:
  	@${RM} ${WRKSRC}/config.cache
  
  post-patch:
 -	@${REINPLACE_CMD} -e \
 -		's|^CFLAGS=|#CFLAGS=|g' ${WRKSRC}/configure
 -	@${REINPLACE_CMD} -e \
 -		's|getprogname|_getprogname|g' ${WRKSRC}/src/mp3asm.c
 +	${REINPLACE_CMD} -e 's|^CFLAGS=|#CFLAGS=|g' ${WRKSRC}/configure
 +	${REINPLACE_CMD} -e 's|#include <argz.h>||' \
 +		-e 's|getprogname|_getprogname|g' \
 +		-e 's|\([ (!]\)\(log[\.;]\)|\1mp3asm\2|g' \
 +		${WRKSRC}/src/mp3asm.h ${WRKSRC}/src/*.c
  
 +.if ${PORT_OPTIONS:MDOCS}
  post-install:
 -.if !defined(NOPORTDOCS)
 -	@${MKDIR} ${DOCSDIR}
 -.for i in Changelog README
 -	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
 -.endfor
 +	${MKDIR} ${STAGEDIR}${DOCSDIR}
 +	cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
  .endif
  
  .include <bsd.port.mk>
 
 Copied: head/audio/mp3asm/files/patch-utils.c (from r333181, head/audio/mp3asm/files/patch-src::utils.c)
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/audio/mp3asm/files/patch-utils.c	Fri Nov  8 05:59:05 2013	(r333182, copy of r333181, head/audio/mp3asm/files/patch-src::utils.c)
 @@ -0,0 +1,10 @@
 +--- src/utils.c.orig	Fri Jul 20 11:14:59 2001
 ++++ src/utils.c	Fri Jul 20 11:15:37 2001
 +@@ -25,6 +25,7 @@
 + #include "utils.h"
 + #include <unistd.h>
 + #include <stdio.h>
 ++#include <errno.h>
 + 
 + /*
 +  * tmalloc: mallocs cleanly
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
