libperfetto-c: Add recipe
PATCH 1/1 libperfetto-c: Add recipe
From: Heinrich Fink <[email protected]>
Upstream only provides the C++ SDK as a static library or amalgamated source, and strongly discourages building it as a shared library [0]. libperfetto does so anyway. The C SDK is designed as a shared library [1], so system components may prefer it.
Based on the v59.1 release. The ABI may still break with future upgrades until officially frozen, so the major SDK version determines the SO version (libperfetto_c.so.59).
The amalgamated perfetto_c.cc and perfetto_c.h are not part of the perfetto git tree and are only shipped as a GitHub release asset, so fetch that tarball and build it with an added meson.build.
Tested by building the recipe with poky master and capturing a trace in qemux86-64 with tracebox and the upstream C SDK track event example.
[0] https://github.com/google/perfetto/blob/1e9c61e9844affd7dccd3d42d9ea9f3a3d10cf6d/docs/design-docs/api-and-abi.md#L491-L501
[1] https://github.com/google/perfetto/blob/1e9c61e9844affd7dccd3d42d9ea9f3a3d10cf6d/examples/shared_lib/example_shlib_track_event.c
AI-Generated: Uses Claude Code (commit message, file move)
--- .../perfetto/libperfetto-c/libperfetto_c.map | 8 +++ .../perfetto/libperfetto-c/meson.build | 62 +++++++++++++++++++ .../perfetto/libperfetto-c_59.1.bb | 22 +++++++ 3 files changed, 92 insertions(+) create mode 100644 meta-oe/recipes-devtools/perfetto/libperfetto-c/libperfetto_c.map create mode 100644 meta-oe/recipes-devtools/perfetto/libperfetto-c/meson.build create mode 100644 meta-oe/recipes-devtools/perfetto/libperfetto-c_59.1.bb
meta-oe/recipes-devtools/perfetto/libperfetto-c/libperfetto_c.map new file +8 -0
@@ -0,0 +1,8 @@ +{ + global: + perfetto_*; + Perfetto*; + + local: + *; +};
meta-oe/recipes-devtools/perfetto/libperfetto-c/meson.build new file +62 -0
62 lines not on this page · raw message
meta-oe/recipes-devtools/perfetto/libperfetto-c_59.1.bb new file +22 -0
@@ -0,0 +1,22 @@ +SUMMARY = "Perfetto C SDK shared library" +DESCRIPTION = "Shared library built from the amalgamated Perfetto C SDK sources" +HOMEPAGE = "https://perfetto.dev" +LICENSE = "Apache-2.0" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=0b17e8eda713c18363c16102cacd41f3" + +SRC_URI = "\ + https://github.com/google/perfetto/releases/download/v${PV}/perfetto-c-sdk-src.zip;downloadfilename=${BPN}-${PV}.zip;subdir=${BP} \ + file://meson.build;subdir=${BP} \ + file://libperfetto_c.map;subdir=${BP} \ +" + +SRC_URI[sha256sum] = "28d497a5b01c7517b2084c4b4768a1fdbbac587242775af50f5219936056361f" + +S = "${UNPACKDIR}/${BP}" + +inherit meson + +do_configure:prepend() { + echo "${PV}" > ${S}/VERSION +}
Signature · 1 line
2.43.0