From nobody@FreeBSD.org  Wed Oct 20 11:40:27 2010
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 AD886106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2010 11:40:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 809F28FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2010 11:40:27 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9KBeQ3U043980
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2010 11:40:26 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9KBeQpW043979;
	Wed, 20 Oct 2010 11:40:26 GMT
	(envelope-from nobody)
Message-Id: <201010201140.o9KBeQpW043979@www.freebsd.org>
Date: Wed, 20 Oct 2010 11:40:26 GMT
From: "Ilya A. Arhipov" <pa36ouHu4er@yandex.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: don't build py-jsonlib with python 2.4
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151597
>Category:       ports
>Synopsis:       [patch] can't build devel/py-jsonlib with python 2.4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wen
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 11:50:07 UTC 2010
>Closed-Date:    Fri Oct 29 08:41:27 UTC 2010
>Last-Modified:  Fri Oct 29 08:41:27 UTC 2010
>Originator:     Ilya A. Arhipov
>Release:        FreeBSD 8.1-RELEASE amd64 && i386
>Organization:
gorodkirov.ru
>Environment:
>Description:
don't build py-jsonlib with python 2.4

creating temp.freebsd-8.1-RELEASE-i386-2.4
cc -fno-strict-aliasing -DNDEBUG -O2 -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -O2 -pipe -fno-strict-aliasing -fPIC -I/usr/local/include/python2.4 -c _jsonlib.c -o temp.freebsd-8.1-RELEASE-i386-2.4/_jsonlib.o
_jsonlib.c:1428: error: expected declaration specifiers or '...' before 'Py_ssize_t'
_jsonlib.c: In function 'serializer_validate_string':
_jsonlib.c:1430: error: 'Py_ssize_t' undeclared (first use in this function)
_jsonlib.c:1430: error: (Each undeclared identifier is reported only once
_jsonlib.c:1430: error: for each function it appears in.)
_jsonlib.c:1430: error: expected ';' before 'ii'
_jsonlib.c:1433: error: 'ii' undeclared (first use in this function)
_jsonlib.c:1433: error: 'char_count' undeclared (first use in this function)
_jsonlib.c: In function 'serialize_unicode':
_jsonlib.c:1460: error: 'Py_ssize_t' undeclared (first use in this function)
_jsonlib.c:1460: error: expected ';' before 'char_count'
_jsonlib.c:1467: error: 'char_count' undeclared (first use in this function)
_jsonlib.c:1468: error: 'ii' undeclared (first use in this function)
_jsonlib.c:1491: error: too many arguments to function 'serializer_validate_string'
_jsonlib.c: In function 'serialize_dict':
_jsonlib.c:1580: error: 'Py_ssize_t' undeclared (first use in this function)
_jsonlib.c:1580: error: expected ';' before 'dict_pos'
_jsonlib.c:1593: error: 'dict_pos' undeclared (first use in this function)
_jsonlib.c: In function 'serializer_append_unicode':
_jsonlib.c:1994: error: 'Py_ssize_t' undeclared (first use in this function)
_jsonlib.c:1994: error: expected ';' before 'ii'
_jsonlib.c:1999: error: 'ii' undeclared (first use in this function)
_jsonlib.c:1999: error: 'len_text' undeclared (first use in this function)
error: command 'cc' failed with exit status 1
*** Error code 1

Stop in /usr/ports/devel/py-jsonlib.
*** Error code 1

>How-To-Repeat:
echo "PYTHON_VERSION=2.4" >> /etc/make.conf
make -C /usr/ports/devel/py-jsonlib install clean
>Fix:
http://www.python.org/dev/peps/pep-0353/

#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif

add in _jsonlib.c
patch in attache

Patch attached with submission follows:

--- _jsonlib.c.orig	2010-10-20 11:09:48.792940743 +0000
+++ _jsonlib.c	2010-10-20 11:11:06.166556561 +0000
@@ -21,6 +21,12 @@
 #include <ctype.h>
 #include <math.h>
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 /* Parser {{{ */
 typedef struct _Parser
 {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wen 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 23 07:54:50 UTC 2010 
Responsible-Changed-Why:  
Fix synopsis and assign. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/151597: commit references a PR
Date: Fri, 29 Oct 2010 08:38:37 +0000 (UTC)

 wen         2010-10-29 08:38:33 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/py-jsonlib     Makefile 
   Added files:
     devel/py-jsonlib/files patch-_jsonlib.c 
   Log:
   - Fix build with python-2.4
   
   PR:             ports/151597
   Submitted by:   "Ilya A. Arhipov" <pa36ouHu4er@yandex.ru>
   
   Revision  Changes    Path
   1.9       +1 -0      ports/devel/py-jsonlib/Makefile
   1.1       +14 -0     ports/devel/py-jsonlib/files/patch-_jsonlib.c (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"
 
State-Changed-From-To: open->closed 
State-Changed-By: wen 
State-Changed-When: Fri Oct 29 08:41:26 UTC 2010 
State-Changed-Why:  
Committed. Thanks! 

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