From eb9b6ef2011178b353ba90e3a98226662b98943f Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Mon, 12 Aug 2019 01:11:25 +0000 Subject: [PATCH] textproc/py-sphinxcontrib-bitbucket: Fix Python 3 build/run Fix Python 3 build, identified while testing devel/py-virtualenvwrapper: Exception occurred: File "/usr/local/lib/python3.7/site-packages/sphinx/registry.py", line 196, in load_extension mod = __import__(extname, None, None, ['setup']) File "/usr/local/lib/python3.7/site-packages/sphinxcontrib/bitbucket.py", line 26 except AttributeError, err: ^ SyntaxError: invalid syntax While I'm here, level up ports/python compliance: - Add python to CATEGORIES - Add LICENSE/LICENSE_FILE - Add NO_ARCH - Add missing RUN_DEPENDS - Correct RUN_DEPENDS version-specs Approved by: portmgr (blanket(s): build fix, ports compliance, dependencies) MFH: 2019Q3 --- textproc/py-sphinxcontrib-bitbucket/Makefile | 12 +++++++++--- .../py-sphinxcontrib-bitbucket/files/patch-setup.py | 6 +++--- .../files/patch-sphinxcontrib_bitbucket.py | 13 +++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 textproc/py-sphinxcontrib-bitbucket/files/patch-sphinxcontrib_bitbucket.py diff --git a/textproc/py-sphinxcontrib-bitbucket/Makefile b/textproc/py-sphinxcontrib-bitbucket/Makefile index 0773c7387441..bee7529967d4 100644 --- a/textproc/py-sphinxcontrib-bitbucket/Makefile +++ b/textproc/py-sphinxcontrib-bitbucket/Makefile @@ -3,17 +3,23 @@ PORTNAME= sphinxcontrib-bitbucket PORTVERSION= 1.0 -PORTREVISION= 1 -CATEGORIES= textproc +PORTREVISION= 2 +CATEGORIES= textproc python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= nivit@FreeBSD.org COMMENT= Sphinx/BitBucket integration -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.1.3:textproc/py-sphinx@${PY_FLAVOR} +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=0.6:textproc/py-sphinx@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}docutils>=0.6:textproc/py-docutils@${PY_FLAVOR} USES= python USE_PYTHON= distutils autoplist +NO_ARCH= yes + .include diff --git a/textproc/py-sphinxcontrib-bitbucket/files/patch-setup.py b/textproc/py-sphinxcontrib-bitbucket/files/patch-setup.py index 88df160f2416..a224b3f67c2a 100644 --- a/textproc/py-sphinxcontrib-bitbucket/files/patch-setup.py +++ b/textproc/py-sphinxcontrib-bitbucket/files/patch-setup.py @@ -1,5 +1,5 @@ ---- ./setup.py.orig 2012-08-20 21:53:58.000000000 +0200 -+++ ./setup.py 2012-08-20 21:54:10.000000000 +0200 +--- setup.py.orig 2011-04-24 16:19:59 UTC ++++ setup.py @@ -1,9 +1,5 @@ # -*- coding: utf-8 -*- @@ -10,7 +10,7 @@ from setuptools import setup, find_packages try: -@@ -43,5 +39,4 @@ +@@ -43,5 +39,4 @@ setup( include_package_data=True, install_requires=requires, namespace_packages=['sphinxcontrib'], diff --git a/textproc/py-sphinxcontrib-bitbucket/files/patch-sphinxcontrib_bitbucket.py b/textproc/py-sphinxcontrib-bitbucket/files/patch-sphinxcontrib_bitbucket.py new file mode 100644 index 000000000000..23f8b9253af6 --- /dev/null +++ b/textproc/py-sphinxcontrib-bitbucket/files/patch-sphinxcontrib_bitbucket.py @@ -0,0 +1,13 @@ +# Fix Python 3 build + +--- sphinxcontrib/bitbucket.py.orig 2019-08-11 09:19:09 UTC ++++ sphinxcontrib/bitbucket.py +@@ -23,7 +23,7 @@ def make_link_node(rawtext, app, type, slug, options): + base = app.config.bitbucket_project_url + if not base: + raise AttributeError +- except AttributeError, err: ++ except AttributeError as err: + raise ValueError('bitbucket_project_url configuration value is not set (%s)' % str(err)) + # + slash = '/' if base[-1] != '/' else ''