diff options
| author | William A. Kennington III <wak@google.com> | 2024-02-09 16:59:19 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-02-10 01:48:01 -0800 |
| commit | 30bb83b306db5be21eaceaec44454ea3b5ca93a0 (patch) | |
| tree | 520a0f1cf414d507852358954e44d4169d9cbc62 | |
| parent | f0d3a2bc867ad5354066476f8ac9412f628d0fae (diff) | |
| download | meta-openembedded-30bb83b306db5be21eaceaec44454ea3b5ca93a0.tar.gz | |
nanopb: Split into 2 packages
This makes it possible to avoid building components which are not used
in the native or runtime tooling. Most users of nanopb just want to
build `nanopb-generator-native` and `nanopb-runtime` and not the other
two combinations as they are building software for their target
leveraging nanopb.
Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
5 files changed, 60 insertions, 29 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-generator_0.4.8.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-generator_0.4.8.bb new file mode 100644 index 0000000000..c86750f8b6 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-generator_0.4.8.bb | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | require nanopb.inc | ||
| 2 | |||
| 3 | inherit python3-dir | ||
| 4 | |||
| 5 | DEPENDS = "protobuf-native" | ||
| 6 | RDEPENDS:${PN} += "python3-protobuf" | ||
| 7 | |||
| 8 | EXTRA_OECMAKE += " \ | ||
| 9 | -Dnanopb_PYTHON_INSTDIR_OVERRIDE=${PYTHON_SITEPACKAGES_DIR} \ | ||
| 10 | -Dnanopb_BUILD_RUNTIME=OFF \ | ||
| 11 | -Dnanopb_BUILD_GENERATOR=ON \ | ||
| 12 | " | ||
| 13 | |||
| 14 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" | ||
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-runtime_0.4.8.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-runtime_0.4.8.bb new file mode 100644 index 0000000000..e36abf808d --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-runtime_0.4.8.bb | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | require nanopb.inc | ||
| 2 | |||
| 3 | EXTRA_OECMAKE += " \ | ||
| 4 | -Dnanopb_PROTOC_PATH=/bin/false \ | ||
| 5 | -Dnanopb_BUILD_RUNTIME=ON \ | ||
| 6 | -Dnanopb_BUILD_GENERATOR=OFF \ | ||
| 7 | " | ||
| 8 | |||
| 9 | # Maintain compatability with old header locations for packages | ||
| 10 | # which haven't yet migrated to `nanopb/pb*.h` | ||
| 11 | do_install:append() { | ||
| 12 | for hdr in ${D}${includedir}/nanopb/*; do | ||
| 13 | ln -sv nanopb/$(basename "$hdr") ${D}${includedir}/ | ||
| 14 | done | ||
| 15 | } | ||
| 16 | |||
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.bb new file mode 100644 index 0000000000..7ad6a32782 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.bb | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | SUMMARY = "Combined nanopb package" | ||
| 2 | PV = "1.0" | ||
| 3 | PR = "r1" | ||
| 4 | |||
| 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 6 | |||
| 7 | inherit packagegroup | ||
| 8 | |||
| 9 | DEPENDS = " \ | ||
| 10 | nanopb-generator \ | ||
| 11 | nanopb-runtime \ | ||
| 12 | " | ||
| 13 | |||
| 14 | RDEPENDS:${PN} = " \ | ||
| 15 | nanopb-generator \ | ||
| 16 | nanopb-runtime \ | ||
| 17 | " | ||
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.inc b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.inc new file mode 100644 index 0000000000..87dbc73e63 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.inc | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | DESCRIPTION="Protocol Buffers with small code size" | ||
| 2 | LICENSE="Zlib" | ||
| 3 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f" | ||
| 4 | |||
| 5 | SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https" | ||
| 6 | SRCREV = "6cfe48d6f1593f8fa5c0f90437f5e6522587745e" | ||
| 7 | |||
| 8 | S = "${WORKDIR}/git" | ||
| 9 | |||
| 10 | inherit cmake | ||
| 11 | |||
| 12 | BBCLASSEXTEND = "native nativesdk" | ||
| 13 | |||
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.8.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.8.bb deleted file mode 100644 index d282bf1b2c..0000000000 --- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.8.bb +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | DESCRIPTION="Protocol Buffers with small code size" | ||
| 2 | LICENSE="Zlib" | ||
| 3 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f" | ||
| 4 | |||
| 5 | DEPENDS = "protobuf-native" | ||
| 6 | |||
| 7 | SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https" | ||
| 8 | SRCREV = "6cfe48d6f1593f8fa5c0f90437f5e6522587745e" | ||
| 9 | |||
| 10 | S = "${WORKDIR}/git" | ||
| 11 | |||
| 12 | inherit cmake python3-dir | ||
| 13 | |||
| 14 | EXTRA_OECMAKE += "-Dnanopb_PYTHON_INSTDIR_OVERRIDE=${PYTHON_SITEPACKAGES_DIR}" | ||
| 15 | |||
| 16 | RDEPENDS:${PN} += "${PYTHON_PN}-protobuf" | ||
| 17 | |||
| 18 | # Maintain compatability with old header locations for packages | ||
| 19 | # which haven't yet migrated to `nanopb/pb*.h` | ||
| 20 | do_install:append() { | ||
| 21 | for hdr in ${D}${includedir}/nanopb/*; do | ||
| 22 | ln -sv nanopb/$(basename "$hdr") ${D}${includedir}/ | ||
| 23 | done | ||
| 24 | } | ||
| 25 | |||
| 26 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" | ||
| 27 | |||
| 28 | BBCLASSEXTEND = "native nativesdk" | ||
| 29 | |||
