ports/151597: don't build py-jsonlib with python 2.4

Ilya A. Arhipov pa36ouHu4er at yandex.ru
Wed Oct 20 11:50:08 UTC 2010


>Number:         151597
>Category:       ports
>Synopsis:       don't build py-jsonlib with python 2.4
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 11:50:07 UTC 2010
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list