Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake builds with Python 3.12, which deleted the long-deprecated 'distutils' module #13583

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmake/external/nanopb.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
diff -Naur nanopb/CMakeLists.txt nanopb-fix/CMakeLists.txt
--- nanopb/CMakeLists.txt 2021-03-22 08:50:07.000000000 -0400
+++ nanopb-fix/CMakeLists.txt 2022-06-24 16:17:09.130783413 -0400
@@ -41,7 +41,7 @@
@@ -41,10 +41,10 @@
if(nanopb_BUILD_GENERATOR)
set(generator_protos nanopb plugin)

- find_package(PythonInterp 2.7 REQUIRED)
+ find_package(PythonInterp 3.7 REQUIRED)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c
"from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
- "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
+ "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
OUTPUT_VARIABLE PYTHON_INSTDIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ehsannas marked this conversation as resolved.
Show resolved Hide resolved
diff -Naur nanopb/generator/nanopb_generator.py nanopb-fix/generator/nanopb_generator.py
--- nanopb/generator/nanopb_generator.py 2021-03-22 08:50:07.000000000 -0400
+++ nanopb-fix/generator/nanopb_generator.py 2022-11-01 15:37:38.112297044 -0400
Expand Down
Loading