mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-26 19:47:17 +00:00
nanopb: Update 0.4.7 -> 0.4.8
Uses the new nanopb_PYTHON_INSTDIR_OVERRIDE to drop the previous patch. Maintains compatability with 0.4.7 and older by adding symlinks to the old header paths. Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
committed by
Khem Raj
parent
24b2848f04
commit
f0d3a2bc86
-67
@@ -1,67 +0,0 @@
|
|||||||
From 30c79d1b49839a15c05a0d0ca7e54787cd7988c6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Martin Jansa <Martin.Jansa@gmail.com>
|
|
||||||
Date: Thu, 4 May 2023 07:17:57 +0000
|
|
||||||
Subject: [PATCH] CMakeLists.txt: allow to set PYTHON_INSTDIR from outside
|
|
||||||
|
|
||||||
CMakeLists.txt used:
|
|
||||||
|
|
||||||
find_package(Python REQUIRED COMPONENTS Interpreter)
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${Python_EXECUTABLE} -c
|
|
||||||
"import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
|
||||||
OUTPUT_VARIABLE PYTHON_INSTDIR
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
|
|
||||||
but with python3native this returns:
|
|
||||||
|
|
||||||
nanopb/0.4.7-r0/git $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
|
||||||
lib/python3.11/site-packages
|
|
||||||
|
|
||||||
which doesn't respect target libdir which might be lib64 with multilib and with python3targetconfig
|
|
||||||
it also doesn't work right because of the long relative path:
|
|
||||||
|
|
||||||
nanopb/0.4.7-r0/build $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
|
||||||
../../../../../../../../../../../../usr/lib64/python3.11/site-packages
|
|
||||||
|
|
||||||
CMake Error at cmake_install.cmake:46 (file):
|
|
||||||
file cannot create directory:
|
|
||||||
/OE/lge/build/starfish/nanbield/BUILD/work/o22-starfish-linux/nanopb/0.4.7-r0/image/usr/../../../../../../../../../../../../usr/lib64/python3.11/site-packages/proto.
|
|
||||||
Maybe need administrative privileges.
|
|
||||||
|
|
||||||
Let CMake variable to be passed from the recipe to avoid this as we're already using
|
|
||||||
${D}${PYTHON_SITEPACKAGES_DIR} in do_install:append anyway.
|
|
||||||
|
|
||||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
|
||||||
Upstream-Status: Pending
|
|
||||||
---
|
|
||||||
CMakeLists.txt | 16 +++++++++-------
|
|
||||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
||||||
index 8d241c5..7d3f993 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -39,13 +39,15 @@ if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR)
|
|
||||||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/nanopb")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
-find_package(Python REQUIRED COMPONENTS Interpreter)
|
|
||||||
-execute_process(
|
|
||||||
- COMMAND ${Python_EXECUTABLE} -c
|
|
||||||
- "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
|
||||||
- OUTPUT_VARIABLE PYTHON_INSTDIR
|
|
||||||
- OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
-)
|
|
||||||
+if(NOT DEFINED PYTHON_INSTDIR)
|
|
||||||
+ find_package(Python REQUIRED COMPONENTS Interpreter)
|
|
||||||
+ execute_process(
|
|
||||||
+ COMMAND ${Python_EXECUTABLE} -c
|
|
||||||
+ "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
|
|
||||||
+ OUTPUT_VARIABLE PYTHON_INSTDIR
|
|
||||||
+ OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
+ )
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
if(nanopb_BUILD_GENERATOR)
|
|
||||||
set(generator_protos nanopb)
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
DESCRIPTION="Protocol Buffers with small code size"
|
|
||||||
LICENSE="Zlib"
|
|
||||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f"
|
|
||||||
|
|
||||||
DEPENDS = "protobuf-native"
|
|
||||||
|
|
||||||
SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https \
|
|
||||||
file://0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch \
|
|
||||||
"
|
|
||||||
SRCREV = "b97aa657a706d3ba4a9a6ccca7043c9d6fe41cba"
|
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
|
||||||
|
|
||||||
inherit cmake python3native
|
|
||||||
|
|
||||||
EXTRA_OECMAKE += "-DPYTHON_INSTDIR=${PYTHON_SITEPACKAGES_DIR}"
|
|
||||||
|
|
||||||
do_install:append() {
|
|
||||||
install -Dm 0755 ${S}/generator/nanopb_generator.py ${D}${bindir}/nanopb_generator.py
|
|
||||||
install -Dm 0755 ${S}/generator/protoc-gen-nanopb ${D}${bindir}/protoc-gen-nanopb
|
|
||||||
install -Dm 0755 ${S}/generator/proto/__init__.py ${D}${PYTHON_SITEPACKAGES_DIR}/proto/__init__.py
|
|
||||||
}
|
|
||||||
|
|
||||||
FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}"
|
|
||||||
FILES:${PN}-dev += "${libdir}/cmake/${BPN}"
|
|
||||||
|
|
||||||
RDEPENDS:${PN} += "\
|
|
||||||
${PYTHON_PN}-protobuf \
|
|
||||||
protobuf-compiler \
|
|
||||||
"
|
|
||||||
|
|
||||||
BBCLASSEXTEND = "native nativesdk"
|
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
DESCRIPTION="Protocol Buffers with small code size"
|
||||||
|
LICENSE="Zlib"
|
||||||
|
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f"
|
||||||
|
|
||||||
|
DEPENDS = "protobuf-native"
|
||||||
|
|
||||||
|
SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https"
|
||||||
|
SRCREV = "6cfe48d6f1593f8fa5c0f90437f5e6522587745e"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
inherit cmake python3-dir
|
||||||
|
|
||||||
|
EXTRA_OECMAKE += "-Dnanopb_PYTHON_INSTDIR_OVERRIDE=${PYTHON_SITEPACKAGES_DIR}"
|
||||||
|
|
||||||
|
RDEPENDS:${PN} += "${PYTHON_PN}-protobuf"
|
||||||
|
|
||||||
|
# Maintain compatability with old header locations for packages
|
||||||
|
# which haven't yet migrated to `nanopb/pb*.h`
|
||||||
|
do_install:append() {
|
||||||
|
for hdr in ${D}${includedir}/nanopb/*; do
|
||||||
|
ln -sv nanopb/$(basename "$hdr") ${D}${includedir}/
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}"
|
||||||
|
|
||||||
|
BBCLASSEXTEND = "native nativesdk"
|
||||||
|
|
||||||
Reference in New Issue
Block a user