devel/py-pip: Fix build with DOCS option enabled on Python 3.6

PR:		255579
Reported by:	John Hein <jcfyecrayz@liamekaens.com>
This commit is contained in:
Po-Chuan Hsieh 2021-05-07 17:27:27 +08:00
parent 066d3dbe5c
commit 86c8db870a
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
2 changed files with 19 additions and 1 deletions

View File

@ -59,6 +59,13 @@ DOCS_PORTDOCS= *
DOCS_VARS= PYDISTUTILS_BUILD_TARGET=build_sphinx \
PYDISTUTILS_BUILDARGS="-n --all-files --fresh-env"
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 3700 && ${PORT_OPTIONS:MDOCS}
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}future-annotations>=0:devel/py-future-annotations@${PY_FLAVOR}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-python36
.endif
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/build/sphinx/html && \
@ -72,4 +79,4 @@ do-test:
${LN} -sf ${LOCALBASE}/bin/pip ${LOCALBASE}/bin/pip3
cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,11 @@
--- docs/docs_feedback_sphinxext.py.orig 2021-01-23 11:51:53 UTC
+++ docs/docs_feedback_sphinxext.py
@@ -1,6 +1,7 @@
+# -*- coding: future_annotations -*-
"""A sphinx extension for collecting per doc feedback."""
-from __future__ import annotations
+import future_annotations
from itertools import chain
from typing import TYPE_CHECKING