From 8877118e6c8aa39b6ecd3ed8d700f8eee8b66c08 Mon Sep 17 00:00:00 2001 From: "Carlos J. Puga Medina" Date: Sat, 18 Nov 2017 12:41:18 +0000 Subject: [PATCH] security/obfsproxy: Make argparse a conditional dependency Backport a patch to setup.py making argparse a conditional dependency to fix the following error at runtime: pkg_resources.DistributionNotFound: The 'argparse' distribution was not found and is required by obfsproxy While I'm here, pet portlint, USE_* comes before USES. Bump PORTREVISION. PR: 223320 Submitted by: cpm Reported by: Hadi Approved by: cs (maintainer timeout, 2 weeks) --- security/obfsproxy/Makefile | 4 ++-- security/obfsproxy/files/patch-setup.py | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/security/obfsproxy/Makefile b/security/obfsproxy/Makefile index f602c0fe8edc..220fc049dc19 100644 --- a/security/obfsproxy/Makefile +++ b/security/obfsproxy/Makefile @@ -3,7 +3,7 @@ PORTNAME= obfsproxy PORTVERSION= 0.2.13 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= security net python MASTER_SITES= http://www.c-s.li/ports/ @@ -18,8 +18,8 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyptlib>=0.0.5:security/py-pyptlib \ ${PYTHON_PKGNAMEPREFIX}twisted>=0:devel/py-twisted \ ${PYTHON_PKGNAMEPREFIX}yaml>=0:devel/py-yaml -USE_PYTHON= distutils USES= python +USE_PYTHON= distutils SUB_FILES= pkg-message PYDISTUTILS_PKGNAME=obfsproxy diff --git a/security/obfsproxy/files/patch-setup.py b/security/obfsproxy/files/patch-setup.py index 6fe547044e74..71a0f24824b1 100644 --- a/security/obfsproxy/files/patch-setup.py +++ b/security/obfsproxy/files/patch-setup.py @@ -1,11 +1,19 @@ ---- setup.py.orig 2013-07-14 19:01:36.000000000 +0000 -+++ setup.py 2013-07-14 19:02:02.000000000 +0000 -@@ -31,7 +31,7 @@ +--- setup.py.orig 2017-11-03 11:21:18 UTC ++++ setup.py +@@ -31,12 +31,14 @@ setup( install_requires = [ 'setuptools', 'PyCrypto', - 'Twisted', +- 'argparse', + 'Twisted_Core', - 'argparse', - 'pyptlib' + 'pyptlib >= 0.0.6', + 'pyyaml' ], + ++ if sys.version_info < (2, 7): ++ install_requires.append('argparse') ++ + extras_require = { + 'SOCKS': ["txsocksx"] + }