ports/160395: [PATCH] devel/rbtools: depend on simplejson conditionally

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


>Number:         160395
>Category:       ports
>Synopsis:       [PATCH] devel/rbtools: 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 14:40:07 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:
"""
try:
    import json
except ImportError:
    install_requires.append('simplejson')
"""

In other code:
"""
try:
    # Specifically import json_loads, to work around some issues with
    # installations containing incompatible modules named "json".
    from json import loads as json_loads
except ImportError:
    from simplejson import loads as json_loads
"""

This patch make it depend on devel/py-simplejson only if python version < 2.6.
And for python < 2.6 it's not only build dependency but run dependency too, so change this respectively.

tag: simplejson26
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruNa rbtools.orig/Makefile rbtools/Makefile
--- rbtools.orig/Makefile	2011-04-11 15:29:50.000000000 +0400
+++ rbtools/Makefile	2011-09-02 18:30:47.000000000 +0400
@@ -7,6 +7,7 @@
 
 PORTNAME=	${ORIGNAME:L}
 DISTVERSION=	0.3.2
+PORTVERSION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://downloads.reviewboard.org/releases/${ORIGNAME}/${DISTVERSION:C|^(...).*|\1|}/
 DISTNAME=	${ORIGNAME}-${DISTVERSION}
@@ -14,8 +15,6 @@
 MAINTAINER=	flz at FreeBSD.org
 COMMENT=	ReviewBoard Toolset
 
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}simplejson>=1.4:${PORTSDIR}/devel/py-simplejson
-
 ORIGNAME=	RBTools
 
 USE_PYTHON=	2.5+
@@ -23,4 +22,14 @@
 PYDISTUTILS_PKGNAME=	${ORIGNAME}
 PYDISTUTILS_PKGVERSION=	${DISTVERSION}
 
-.include <bsd.port.mk>
+PLIST_FILES=	bin/post-review \
+		%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%
+
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_REL} < 260
+BUILD_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}simplejson>=1.4:${PORTSDIR}/devel/py-simplejson
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}simplejson>=1.4:${PORTSDIR}/devel/py-simplejson
+.endif
+
+.include <bsd.port.post.mk>
diff -ruNa rbtools.orig/pkg-plist rbtools/pkg-plist
--- rbtools.orig/pkg-plist	2009-07-16 00:15:17.000000000 +0400
+++ rbtools/pkg-plist	1970-01-01 03:00:00.000000000 +0300
@@ -1,2 +0,0 @@
-bin/post-review
-%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%


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



More information about the freebsd-ports-bugs mailing list