From amdmi3@amdmi3.ru  Tue Mar 11 19:10:56 2014
Return-Path: <amdmi3@amdmi3.ru>
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 ESMTPS id 088A347E;
	Tue, 11 Mar 2014 19:10:56 +0000 (UTC)
Received: from smtpout3.timeweb.ru (smtpout3.timeweb.ru [92.53.117.25])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id B5D8A14D;
	Tue, 11 Mar 2014 19:10:55 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.76)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1WNS4W-0004tF-JA; Tue, 11 Mar 2014 23:10:40 +0400
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 3D8E7707;
	Tue, 11 Mar 2014 23:10:40 +0400 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 3364BB230; Tue, 11 Mar 2014 23:10:40 +0400 (MSK)
Message-Id: <20140311191040.3364BB230@hades.panopticon>
Date: Tue, 11 Mar 2014 23:10:40 +0400 (MSK)
From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: wxs@FreeBSD.org
Subject: [PATCH] devel/git: fix build on 10.x with libiconv from ports installed
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         187454
>Category:       ports
>Synopsis:       [PATCH] devel/git: fix build on 10.x with libiconv from ports installed
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    wxs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 11 19:20:03 UTC 2014
>Closed-Date:    Tue Mar 11 22:18:21 CET 2014
>Last-Modified:  Tue Mar 11 22:18:21 CET 2014
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 10.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD hades.panopticon 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260807: Fri Jan 17 13:14:28 MSK
>Description:
On 10.x, with libiconv from ports installed, git doesn't build as
it detectes and uses locale_charset() function from ports' libiconv,
but -liconv is not passed to linker because iconv functionality is
built into libc.

Fix this by adding -liconv to library list. This works in all
libiconv setups (system, ports and system+ports).

The same fix was sent upstream:
http://www.mail-archive.com/git@vger.kernel.org/msg45490.html

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

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

--- git-1.9.0.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 347902)
+++ Makefile	(working copy)
@@ -24,6 +24,7 @@
 SUB_FILES=	pkg-message
 PKGMESSAGE=	${WRKDIR}/pkg-message
 
+USE_AUTOTOOLS=	autoconf
 GNU_CONFIGURE=	yes
 USES=		gmake shebangfix
 CPPFLAGS+=	-I${LOCALBASE}/include
Index: files/patch-configure.ac
===================================================================
--- files/patch-configure.ac	(revision 0)
+++ files/patch-configure.ac	(working copy)
@@ -0,0 +1,11 @@
+--- configure.ac.orig	2014-03-11 21:52:06.068444421 +0400
++++ configure.ac	2014-03-11 21:52:29.280443652 +0400
+@@ -890,7 +890,7 @@
+ # and libcharset does
+ CHARSET_LIB=
+ AC_CHECK_LIB([iconv], [locale_charset],
+-       [],
++       [CHARSET_LIB=-liconv],
+        [AC_CHECK_LIB([charset], [locale_charset],
+                      [CHARSET_LIB=-lcharset])])
+ GIT_CONF_SUBST([CHARSET_LIB])

Property changes on: files/patch-configure.ac
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- git-1.9.0.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Mar 11 19:20:17 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: wxs@FreeBSD.org
Subject: Re: ports/187454: [PATCH] devel/git: fix build on 10.x with libiconv
 from ports installed
Date: Tue, 11 Mar 2014 23:55:56 +0400

 * Dmitry Marakasov (amdmi3@amdmi3.ru) wrote:
 > 
 > >Number:         187454
 > >Category:       ports
 > >Synopsis:       [PATCH] devel/git: fix build on 10.x with libiconv from ports installed
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       low
 > >Responsible:    freebsd-ports-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Tue Mar 11 19:20:03 UTC 2014
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Dmitry Marakasov
 > >Release:        FreeBSD 10.0-RELEASE amd64
 > >Organization:
 > >Environment:
 > System: FreeBSD hades.panopticon 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260807: Fri Jan 17 13:14:28 MSK
 > >Description:
 > On 10.x, with libiconv from ports installed, git doesn't build as
 > it detectes and uses locale_charset() function from ports' libiconv,
 > but -liconv is not passed to linker because iconv functionality is
 > built into libc.
 > 
 > Fix this by adding -liconv to library list. This works in all
 > libiconv setups (system, ports and system+ports).
 > 
 > The same fix was sent upstream:
 > http://www.mail-archive.com/git@vger.kernel.org/msg45490.html
 > 
 > Port maintainer (wxs@FreeBSD.org) is cc'd.
 > 
 > Generated with FreeBSD Port Tools 1.00.2014.03.03 (mode: change, diff: SVN)
 > >How-To-Repeat:
 > >Fix:
 > 
 > --- git-1.9.0.patch begins here ---
 > Index: Makefile
 > ===================================================================
 > --- Makefile	(revision 347902)
 > +++ Makefile	(working copy)
 > @@ -24,6 +24,7 @@
 >  SUB_FILES=	pkg-message
 >  PKGMESSAGE=	${WRKDIR}/pkg-message
 >  
 > +USE_AUTOTOOLS=	autoconf
 >  GNU_CONFIGURE=	yes
 >  USES=		gmake shebangfix
 >  CPPFLAGS+=	-I${LOCALBASE}/include
 > Index: files/patch-configure.ac
 > ===================================================================
 > --- files/patch-configure.ac	(revision 0)
 > +++ files/patch-configure.ac	(working copy)
 > @@ -0,0 +1,11 @@
 > +--- configure.ac.orig	2014-03-11 21:52:06.068444421 +0400
 > ++++ configure.ac	2014-03-11 21:52:29.280443652 +0400
 > +@@ -890,7 +890,7 @@
 > + # and libcharset does
 > + CHARSET_LIB=
 > + AC_CHECK_LIB([iconv], [locale_charset],
 > +-       [],
 > ++       [CHARSET_LIB=-liconv],
 > +        [AC_CHECK_LIB([charset], [locale_charset],
 > +                      [CHARSET_LIB=-lcharset])])
 > + GIT_CONF_SUBST([CHARSET_LIB])
 > 
 > Property changes on: files/patch-configure.ac
 > ___________________________________________________________________
 > Added: svn:mime-type
 > ## -0,0 +1 ##
 > +text/plain
 > \ No newline at end of property
 > Added: fbsd:nokeywords
 > ## -0,0 +1 ##
 > +yes
 > \ No newline at end of property
 > Added: svn:eol-style
 > ## -0,0 +1 ##
 > +native
 > \ No newline at end of property
 > --- git-1.9.0.patch ends here ---
 
 After some thought, this solution is not entirely correct, as it creates
 hidden dependency on libiconv from ports.
 
 Here's another solution:
 
 --- git.patch begins here ---
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 347902)
 +++ Makefile	(working copy)
 @@ -211,6 +211,10 @@
  	@${REINPLACE_CMD} -e 's|/bin/bash|/bin/sh|' \
  		${WRKSRC}/contrib/subtree/git-subtree.sh
  .endif
 +.if ${PORT_OPTIONS:MICONV} && empty(ICONV_LIB)
 +	@${REINPLACE_CMD} -e '/LIBS/ s|-liconv|-lno-iconv-from-ports|' \
 +		${WRKSRC}/configure
 +.endif
  
  post-build:
  .if ${PORT_OPTIONS:MP4} || ${PORT_OPTIONS:MCONTRIB}
 --- git.patch ends here ---
 
 it just disables using libiconv from ports if one from libc is
 available. This should not affect functionality as git has fallback for
 the case where locale_charset() is not found (gettext.c:16).
 
 -- 
 Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
 amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
State-Changed-From-To: open->closed 
State-Changed-By: tijl 
State-Changed-When: Tue Mar 11 22:09:48 CET 2014 
State-Changed-Why:  
Duplicate of ports/187326.  Please let upstream know they should either 
use iconv from libc + nl_langinfo from libc, or iconv from libiconv + 
locale_charset from libiconv, but not mix the two.  Actually they could 
just always use nl_langinfo when it's available because locale_charset 
is not much more than an alias for it. 

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