From amdmi3@amdmi3.ru  Wed Nov 24 16:53:40 2010
Return-Path: <amdmi3@amdmi3.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4673C1065670;
	Wed, 24 Nov 2010 16:53:40 +0000 (UTC)
	(envelope-from amdmi3@amdmi3.ru)
Received: from smtp.timeweb.ru (smtp.timeweb.ru [92.53.116.15])
	by mx1.freebsd.org (Postfix) with ESMTP id F3E3E8FC16;
	Wed, 24 Nov 2010 16:53:39 +0000 (UTC)
Received: from [213.148.20.85] (helo=hive.panopticon)
	by smtp.timeweb.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.71)
	(envelope-from <amdmi3@amdmi3.ru>)
	id 1PLII3-00028i-8j; Wed, 24 Nov 2010 19:33:51 +0300
Received: from hades.panopticon (hades.panopticon [192.168.0.32])
	by hive.panopticon (Postfix) with ESMTP id 4377EB84D;
	Wed, 24 Nov 2010 19:33:50 +0300 (MSK)
Received: by hades.panopticon (Postfix, from userid 1000)
	id 35DE1B844; Wed, 24 Nov 2010 19:33:50 +0300 (MSK)
Message-Id: <20101124163350.35DE1B844@hades.panopticon>
Date: Wed, 24 Nov 2010 19:33:50 +0300 (MSK)
From: Dmitry Marakasov <amdmi3@amdmi3.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dhn@FreeBSD.org
Subject: [PATCH] net/GeoIP: don't redefined memcpy
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         152548
>Category:       ports
>Synopsis:       [PATCH] net/GeoIP: don't redefined memcpy
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    dhn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 24 17:00:24 UTC 2010
>Closed-Date:    Sun Mar 27 11:58:40 UTC 2011
>Last-Modified:  Sun Mar 27 12:00:21 UTC 2011
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Jul 30 02:50:28 MSD 2010
>Description:
GeoIP.h instelled by net/GeoIP has

#define memcpy(dest, src, n) bcopy(src, dest, n)

which breaks building stuff that uses that include under certain
circumstances (see How-To-Repeat). In real world, this prevents
building qbittorrent without GUI.

The patch removes that bogus define. I've mailed GeoIP devs and
they are going to remove it upstream as well.

Added file(s):
- files/patch-libGeoIP-GeoIP.h

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

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
% cat > 1.cpp
#include <sys/param.h>
#include <cstring>
#include <GeoIP.h>

int main() {
    std::memcpy(NULL, NULL, 0);
}
^D
% c++ -I/usr/local/include 1.cpp
1.cpp: In function 'int main()':
1.cpp:6: error: 'bcopy' is not a member of 'std'
%
>Fix:

--- GeoIP-1.4.6_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/net/GeoIP/Makefile,v
retrieving revision 1.44
diff -u -u -r1.44 Makefile
--- Makefile	2 Aug 2009 19:34:54 -0000	1.44
+++ Makefile	24 Nov 2010 16:21:40 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	GeoIP
 PORTVERSION=	1.4.6
+PORTREVISION=	1
 CATEGORIES=	net geography
 MASTER_SITES=	http://geolite.maxmind.com/download/geoip/api/c/
 
Index: files/patch-libGeoIP-GeoIP.h
===================================================================
RCS file: files/patch-libGeoIP-GeoIP.h
diff -N files/patch-libGeoIP-GeoIP.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-libGeoIP-GeoIP.h	24 Nov 2010 16:21:26 -0000
@@ -0,0 +1,13 @@
+--- libGeoIP/GeoIP.h.orig	2009-02-24 19:03:23.000000000 +0300
++++ libGeoIP/GeoIP.h	2010-11-24 19:21:26.000000000 +0300
+@@ -241,10 +241,6 @@
+ /* Get timezone from country and region code */
+ GEOIP_API const char * GeoIP_time_zone_by_country_and_region(const char *country_code, const char *region_code);
+ 
+-#ifdef BSD
+-#define memcpy(dest, src, n) bcopy(src, dest, n)
+-#endif
+-
+ #ifdef __cplusplus
+ }
+ #endif
--- GeoIP-1.4.6_1.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dhn 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Nov 24 17:00:32 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152548 
State-Changed-From-To: open->closed 
State-Changed-By: dhn 
State-Changed-When: Sun Mar 27 11:58:38 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/152548: commit references a PR
Date: Sun, 27 Mar 2011 11:58:35 +0000 (UTC)

 dhn         2011-03-27 11:58:26 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/GeoIP            Makefile 
   Added files:
     net/GeoIP/files      patch-libGeoIP-GeoIP.h 
   Log:
   - Remove memcpy/bcopy macro
   - Bump PORTREVISION
   
   PR:             ports/152548
   Submitted by:   Dmitry Marakasov <amdmi3@amdmi3.ru>
   
   Revision  Changes    Path
   1.46      +1 -0      ports/net/GeoIP/Makefile
   1.1       +13 -0     ports/net/GeoIP/files/patch-libGeoIP-GeoIP.h (new)
 _______________________________________________
 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:
