git: b4937fd5c4b5 - main - math/py-pdal: Fix build with setuptools 58.0.0+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Fri, 25 Mar 2022 13:50:34 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b4937fd5c4b533c54cd664c00e48792d805b3cd0

commit b4937fd5c4b533c54cd664c00e48792d805b3cd0
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-03-25 13:32:43 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-03-25 13:38:16 +0000

    math/py-pdal: Fix build with setuptools 58.0.0+
    
    With hat:       python
---
 math/py-pdal/Makefile         |  2 ++
 math/py-pdal/files/patch-2to3 | 27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/math/py-pdal/Makefile b/math/py-pdal/Makefile
index 19fe41f8e920..af7da466456d 100644
--- a/math/py-pdal/Makefile
+++ b/math/py-pdal/Makefile
@@ -24,6 +24,8 @@ USE_PYTHON=	autoplist cython distutils
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME}/libpdalpython*.so
+	${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
+	${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
 
 do-test:
 	@cd ${WRKSRC} && py.test -v test
diff --git a/math/py-pdal/files/patch-2to3 b/math/py-pdal/files/patch-2to3
new file mode 100644
index 000000000000..055f6a9a3246
--- /dev/null
+++ b/math/py-pdal/files/patch-2to3
@@ -0,0 +1,27 @@
+--- pdal/pipeline.py.orig	2021-11-24 10:30:42 UTC
++++ pdal/pipeline.py
+@@ -1,5 +1,5 @@
+-from __future__ import annotations
+ 
++
+ import json
+ import logging
+ from typing import Any, Container, Dict, Iterator, List, Optional, Sequence, Union, cast
+@@ -19,7 +19,7 @@ LogLevelToPDAL = {
+     logging.INFO: 2,
+     logging.DEBUG: 8,  # pdal::LogLevel::Debug5
+ }
+-LogLevelFromPDAL = {v: k for k, v in LogLevelToPDAL.items()}
++LogLevelFromPDAL = {v: k for k, v in list(LogLevelToPDAL.items())}
+ 
+ 
+ class Pipeline(libpdalpython.Pipeline):
+@@ -106,7 +106,7 @@ class Pipeline(libpdalpython.Pipeline):
+         if all(isinstance(stage, Reader) for stage in stages):
+             stages = [*stages, Filter.merge()]
+         for stage in stages:
+-            stage2tag[stage] = stage.tag or _generate_tag(stage, stage2tag.values())
++            stage2tag[stage] = stage.tag or _generate_tag(stage, list(stage2tag.values()))
+             options = stage.options
+             options["tag"] = stage2tag[stage]
+             inputs = _get_input_tags(stage, stage2tag)