diff mbox series

[meta-oe,2/3] nanopb: Split into 2 packages

Message ID 20240210005921.1909326-3-wak@google.com
State Accepted
Headers show
Series nanopb: Updates and package split | expand

Commit Message

William Kennington Feb. 10, 2024, 12:59 a.m. UTC
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>
---
 .../nanopb/nanopb-generator_0.4.8.bb          | 14 +++++++++
 .../nanopb/nanopb-runtime_0.4.8.bb            | 16 ++++++++++
 .../recipes-devtools/nanopb/nanopb.bb         | 17 +++++++++++
 .../recipes-devtools/nanopb/nanopb.inc        | 13 +++++++++
 .../recipes-devtools/nanopb/nanopb_0.4.8.bb   | 29 -------------------
 5 files changed, 60 insertions(+), 29 deletions(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-generator_0.4.8.bb
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-runtime_0.4.8.bb
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.bb
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.inc
 delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.8.bb
diff mbox series

Patch

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 000000000..c86750f8b
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-generator_0.4.8.bb
@@ -0,0 +1,14 @@ 
+require nanopb.inc
+
+inherit python3-dir
+
+DEPENDS = "protobuf-native"
+RDEPENDS:${PN} += "python3-protobuf"
+
+EXTRA_OECMAKE += " \
+  -Dnanopb_PYTHON_INSTDIR_OVERRIDE=${PYTHON_SITEPACKAGES_DIR} \
+  -Dnanopb_BUILD_RUNTIME=OFF \
+  -Dnanopb_BUILD_GENERATOR=ON \
+  "
+
+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 000000000..e36abf808
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb-runtime_0.4.8.bb
@@ -0,0 +1,16 @@ 
+require nanopb.inc
+
+EXTRA_OECMAKE += " \
+  -Dnanopb_PROTOC_PATH=/bin/false \
+  -Dnanopb_BUILD_RUNTIME=ON \
+  -Dnanopb_BUILD_GENERATOR=OFF \
+  "
+
+# 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
+}
+
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 000000000..7ad6a3278
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.bb
@@ -0,0 +1,17 @@ 
+SUMMARY = "Combined nanopb package"
+PV = "1.0"
+PR = "r1"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+DEPENDS = " \
+    nanopb-generator \
+    nanopb-runtime \
+"
+
+RDEPENDS:${PN} = " \
+    nanopb-generator \
+    nanopb-runtime \
+"
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 000000000..87dbc73e6
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb.inc
@@ -0,0 +1,13 @@ 
+DESCRIPTION="Protocol Buffers with small code size"
+LICENSE="Zlib"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f"
+
+SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https"
+SRCREV = "6cfe48d6f1593f8fa5c0f90437f5e6522587745e"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+BBCLASSEXTEND = "native nativesdk"
+
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 d282bf1b2..000000000
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.8.bb
+++ /dev/null
@@ -1,29 +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"
-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"
-