Skip to content

Commit 3755841

Browse files
authored
Fix cmake builds with Python 3.12, which deleted the long-deprecated 'distutils' module (firebase#13583)
1 parent e0158c0 commit 3755841

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/external/nanopb.patch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
diff -Naur nanopb/CMakeLists.txt nanopb-fix/CMakeLists.txt
22
--- nanopb/CMakeLists.txt 2021-03-22 08:50:07.000000000 -0400
33
+++ nanopb-fix/CMakeLists.txt 2022-06-24 16:17:09.130783413 -0400
4-
@@ -41,7 +41,7 @@
4+
@@ -41,10 +41,10 @@
55
if(nanopb_BUILD_GENERATOR)
66
set(generator_protos nanopb plugin)
77

88
- find_package(PythonInterp 2.7 REQUIRED)
99
+ find_package(PythonInterp 3.7 REQUIRED)
1010
execute_process(
1111
COMMAND ${PYTHON_EXECUTABLE} -c
12-
"from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
12+
- "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
13+
+ "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
14+
OUTPUT_VARIABLE PYTHON_INSTDIR
15+
OUTPUT_STRIP_TRAILING_WHITESPACE
16+
)
1317
diff -Naur nanopb/generator/nanopb_generator.py nanopb-fix/generator/nanopb_generator.py
1418
--- nanopb/generator/nanopb_generator.py 2021-03-22 08:50:07.000000000 -0400
1519
+++ nanopb-fix/generator/nanopb_generator.py 2022-11-01 15:37:38.112297044 -0400

0 commit comments

Comments
 (0)