diff --git a/devel/py-python-ptrace/Makefile b/devel/py-python-ptrace/Makefile index 4a8497ea69c7..ac545482c6d8 100644 --- a/devel/py-python-ptrace/Makefile +++ b/devel/py-python-ptrace/Makefile @@ -1,20 +1,20 @@ PORTNAME= python-ptrace PORTVERSION= 0.9.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= 0mp@FreeBSD.org COMMENT= Python binding of ptrace library WWW= https://github.com/vstinner/python-ptrace LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING USES= python USE_PYTHON= autoplist concurrent distutils NO_ARCH= yes .include diff --git a/devel/py-python-ptrace/files/patch-setup.py b/devel/py-python-ptrace/files/patch-setup.py new file mode 100644 index 000000000000..f175159d441f --- /dev/null +++ b/devel/py-python-ptrace/files/patch-setup.py @@ -0,0 +1,27 @@ +--- setup.py.orig 2021-03-17 20:17:30 UTC ++++ setup.py +@@ -28,7 +28,8 @@ + # - git commit -a -m "post-release" + # - git push + +-from imp import load_source ++import importlib.machinery ++import importlib.util + from os import path + try: + # setuptools supports bdist_wheel +@@ -55,7 +56,13 @@ with open('README.rst') as fp: + with open('README.rst') as fp: + LONG_DESCRIPTION = fp.read() + +-ptrace = load_source("version", path.join("ptrace", "version.py")) ++filepath = path.join("ptrace", "version.py") ++loader = importlib.machinery.SourceFileLoader("version", filepath) ++spec = importlib.util.spec_from_file_location( ++ "version", filepath, loader=loader) ++module = importlib.util.module_from_spec(spec) ++loader.exec_module(module) ++ptrace = module + PACKAGES = {} + for name in MODULES: + PACKAGES[name] = name.replace(".", "/") diff --git a/devel/py-python-ptrace/files/patch-setup__cptrace.py b/devel/py-python-ptrace/files/patch-setup__cptrace.py new file mode 100644 index 000000000000..a9824690d38d --- /dev/null +++ b/devel/py-python-ptrace/files/patch-setup__cptrace.py @@ -0,0 +1,27 @@ +--- setup_cptrace.py.orig 2026-07-11 13:49:49 UTC ++++ setup_cptrace.py +@@ -17,7 +17,8 @@ def main(): + + + def main(): +- from imp import load_source ++ import importlib.machinery ++ import importlib.util + from os import path + from sys import argv + +@@ -29,7 +30,13 @@ def main(): + + cptrace_ext = Extension('cptrace', sources=SOURCES) + +- cptrace = load_source("version", path.join("cptrace", "version.py")) ++ filepath = path.join("cptrace", "version.py") ++ loader = importlib.machinery.SourceFileLoader("version", filepath) ++ spec = importlib.util.spec_from_file_location( ++ "version", filepath, loader=loader) ++ module = importlib.util.module_from_spec(spec) ++ loader.exec_module(module) ++ cptrace = module + + install_options = { + "name": cptrace.PACKAGE,