ports/160390: [PATCH] devel/py-ToscaWidgets: depend on simplejson conditionally

Ruslan Mahmatkhanov cvs-src at yandex.ru
Fri Sep 2 11:00:20 UTC 2011


>Number:         160390
>Category:       ports
>Synopsis:       [PATCH] devel/py-ToscaWidgets: depend on simplejson conditionally
>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:   Fri Sep 02 11:00:19 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Ruslan Mahmatkhanov
>Release:        9.0-BETA1
>Organization:
>Environment:
9.0-BETA1 i386
>Description:
Right now this port uncoditionally depends on devel/py-simplejson, but it actually should not. They use native json module if running on python 2.6+ and use external simplejson if python < 2.6. 

In setup.py:
"""
if sys.version_info < (2, 6):
    _install_requires.append("simplejson >= 2.0")
"""

In other code:
"""
try:
    from json import JSONEncoder
except ImportError: # Python < 2.6
    from simplejson import JSONEncoder
"""

This patch make it depend on devel/py-simplejson only if python version < 2.6.

tag: simplejson26
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruNa py-ToscaWidgets.orig/Makefile py-ToscaWidgets/Makefile
--- py-ToscaWidgets.orig/Makefile	2011-08-26 04:11:06.000000000 +0400
+++ py-ToscaWidgets/Makefile	2011-09-02 14:52:09.000000000 +0400
@@ -6,6 +6,7 @@
 
 PORTNAME=	ToscaWidgets
 PORTVERSION=	0.9.12
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -13,11 +14,16 @@
 MAINTAINER=	wen at FreeBSD.org
 COMMENT=	A python framework for building reusable web components
 
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}webob>=0:${PORTSDIR}/www/py-webob \
-		${PYTHON_PKGNAMEPREFIX}simplejson>=2.0:${PORTSDIR}/devel/py-simplejson
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}webob>=0:${PORTSDIR}/www/py-webob
 RUN_DEPENDS=	${BUILD_DEPENDS}
 
 USE_PYTHON=	2.5+
 USE_PYDISTUTILS=	easy_install
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_REL} < 260
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}simplejson>=2.0.9:${PORTSDIR}/devel/py-simplejson
+.endif
+
+.include <bsd.port.post.mk>


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list