summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools
diff options
context:
space:
mode:
authorMarkus Volk <f_l_k@t-online.de>2022-10-19 01:19:35 +0200
committerKhem Raj <raj.khem@gmail.com>2022-10-18 16:25:44 -0700
commita067e1ba9469c6ab509c72b903d1fdca86a71a89 (patch)
tree3ae294dc482bd0558b8bb7f02655041018636db9 /meta-oe/recipes-devtools
parent3eaf01fcd4fef7f37d75e2fc5b42be88186b3cbf (diff)
downloadmeta-openembedded-a067e1ba9469c6ab509c72b903d1fdca86a71a89.tar.gz
perfetto: build libperfetto
- Mesa has support for perfetto, but the libperfetto library is needed - Only v27 seems to be supported for now. Update perfetto accordingly - Make sure perfetto and libperfetto share the same codebase - Patch meson.build to allow shared build - Add a version number to avoid having a non symlink so file packaged into dev package - Create a PC file for libperfetto to allow mesa to find it using pkgconfig - Install needed header file - Add -latomic to LDFLAGS for some arch where the compiler doesn't provide it Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r--meta-oe/recipes-devtools/perfetto/files/0001-meson-add-pc-file-for-lib_perfetto.patch52
-rw-r--r--meta-oe/recipes-devtools/perfetto/libperfetto.bb14
-rw-r--r--meta-oe/recipes-devtools/perfetto/perfetto.bb6
-rw-r--r--meta-oe/recipes-devtools/perfetto/perfetto.inc9
4 files changed, 78 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/perfetto/files/0001-meson-add-pc-file-for-lib_perfetto.patch b/meta-oe/recipes-devtools/perfetto/files/0001-meson-add-pc-file-for-lib_perfetto.patch
new file mode 100644
index 000000000..70de44173
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/files/0001-meson-add-pc-file-for-lib_perfetto.patch
@@ -0,0 +1,52 @@
1From 027f90dc9386ec08f2a5107025683e5fed6f3444 Mon Sep 17 00:00:00 2001
2From: Markus Volk <f_l_k@t-online.de>
3Date: Mon, 17 Oct 2022 19:20:53 +0200
4Subject: [PATCH] meson: add PC file for lib_perfetto
5
6---
7 meson.build | 12 ++++++++++--
8 1 file changed, 10 insertions(+), 2 deletions(-)
9
10diff --git a/meson.build b/meson.build
11index 06015141c..752b4d928 100644
12--- a/meson.build
13+++ b/meson.build
14@@ -19,9 +19,12 @@
15 project(
16 'perfetto',
17 ['c','cpp'],
18- default_options: ['c_std=c99', 'cpp_std=c++11']
19+ default_options: ['c_std=c99', 'cpp_std=c++11'],
20+ version: '27.1'
21 )
22
23+soversion = meson.project_version()
24+
25 fs = import('fs')
26
27 if not fs.is_dir('sdk')
28@@ -30,8 +33,9 @@ endif
29
30 dep_threads = dependency('threads')
31
32-lib_perfetto = static_library(
33+lib_perfetto = shared_library(
34 'perfetto',
35+ version: soversion,
36 sources: 'sdk/perfetto.cc',
37 dependencies: dep_threads,
38 install: true,
39@@ -39,6 +43,10 @@ lib_perfetto = static_library(
40
41 inc_perfetto = include_directories('sdk')
42
43+install_headers('sdk/perfetto.h')
44+pkg = import('pkgconfig')
45+pkg.generate(lib_perfetto)
46+
47 dep_perfetto = declare_dependency(
48 link_with: lib_perfetto,
49 include_directories: inc_perfetto,
50--
512.34.1
52
diff --git a/meta-oe/recipes-devtools/perfetto/libperfetto.bb b/meta-oe/recipes-devtools/perfetto/libperfetto.bb
new file mode 100644
index 000000000..c8f56fd52
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/libperfetto.bb
@@ -0,0 +1,14 @@
1LICENSE = "Apache-2.0"
2LIC_FILES_CHKSUM = "file://LICENSE;md5=f87516e0b698007e9e75a1fe1012b390"
3
4require perfetto.inc
5
6inherit meson
7
8SRC_URI:append = " file://0001-meson-add-pc-file-for-lib_perfetto.patch"
9
10LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
11
12FILES:${PN} += "${datadir}"
13
14BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-devtools/perfetto/perfetto.bb b/meta-oe/recipes-devtools/perfetto/perfetto.bb
index 143445c14..98e39f068 100644
--- a/meta-oe/recipes-devtools/perfetto/perfetto.bb
+++ b/meta-oe/recipes-devtools/perfetto/perfetto.bb
@@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=f87516e0b698007e9e75a1fe1012b390 \
10 file://debian/copyright;md5=4e08364c82141f181de69d0a2b89d612 \ 10 file://debian/copyright;md5=4e08364c82141f181de69d0a2b89d612 \
11 file://python/LICENSE;md5=c602a632c34ade9c78a976734077bce7" 11 file://python/LICENSE;md5=c602a632c34ade9c78a976734077bce7"
12 12
13SRC_URI = "git://github.com/google/perfetto.git;branch=master;protocol=https;name=perfetto \ 13SRC_URI:append = " \
14 git://github.com/protocolbuffers/protobuf.git;branch=3.9.x;protocol=https;destsuffix=git/buildtools/protobuf;name=protobuf \ 14 git://github.com/protocolbuffers/protobuf.git;branch=3.9.x;protocol=https;destsuffix=git/buildtools/protobuf;name=protobuf \
15 git://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git;protocol=https;destsuffix=git/buildtools/libcxx;branch=main;name=libcxx \ 15 git://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git;protocol=https;destsuffix=git/buildtools/libcxx;branch=main;name=libcxx \
16 git://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git;protocol=https;destsuffix=git/buildtools/libcxxabi;branch=main;name=libcxxabi \ 16 git://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git;protocol=https;destsuffix=git/buildtools/libcxxabi;branch=main;name=libcxxabi \
@@ -19,7 +19,6 @@ SRC_URI = "git://github.com/google/perfetto.git;branch=master;protocol=https;nam
19 https://storage.googleapis.com/perfetto/gn-linux64-1968-0725d782;subdir=git/buildtools/;name=gn \ 19 https://storage.googleapis.com/perfetto/gn-linux64-1968-0725d782;subdir=git/buildtools/;name=gn \
20 file://0001-Remove-check_build_deps-build-steps.patch " 20 file://0001-Remove-check_build_deps-build-steps.patch "
21 21
22SRCREV_perfetto = "5bd3f582c075d0d026c5fe0b5e291d34dee0d976"
23SRCREV_protobuf = "6a59a2ad1f61d9696092f79b6d74368b4d7970a3" 22SRCREV_protobuf = "6a59a2ad1f61d9696092f79b6d74368b4d7970a3"
24SRCREV_libcxx = "d9040c75cfea5928c804ab7c235fed06a63f743a" 23SRCREV_libcxx = "d9040c75cfea5928c804ab7c235fed06a63f743a"
25SRCREV_libcxxabi = "196ba1aaa8ac285d94f4ea8d9836390a45360533" 24SRCREV_libcxxabi = "196ba1aaa8ac285d94f4ea8d9836390a45360533"
@@ -27,6 +26,8 @@ SRCREV_libunwind = "d999d54f4bca789543a2eb6c995af2d9b5a1f3ed"
27SRCREV_zlib = "5c85a2da4c13eda07f69d81a1579a5afddd35f59" 26SRCREV_zlib = "5c85a2da4c13eda07f69d81a1579a5afddd35f59"
28SRC_URI[gn.sha256sum] = "f706aaa0676e3e22f5fc9ca482295d7caee8535d1869f99efa2358177b64f5cd" 27SRC_URI[gn.sha256sum] = "f706aaa0676e3e22f5fc9ca482295d7caee8535d1869f99efa2358177b64f5cd"
29 28
29require perfetto.inc
30
30DEPENDS += " ninja-native" 31DEPENDS += " ninja-native"
31 32
32COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux*" 33COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm).*-linux*"
@@ -35,7 +36,6 @@ FILES:${PN}:append = " \
35 ${bindir}/tracebox \ 36 ${bindir}/tracebox \
36 " 37 "
37 38
38S = "${WORKDIR}/git"
39B = "${WORKDIR}/build" 39B = "${WORKDIR}/build"
40 40
41# Run the GN (Generate Ninja) script, and replace the compiler flags where applicable 41# Run the GN (Generate Ninja) script, and replace the compiler flags where applicable
diff --git a/meta-oe/recipes-devtools/perfetto/perfetto.inc b/meta-oe/recipes-devtools/perfetto/perfetto.inc
new file mode 100644
index 000000000..5cb6f8bb3
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/perfetto.inc
@@ -0,0 +1,9 @@
1SUMMARY = "Perfetto - System profiling, app tracing and trace analysis."
2HOMEPAGE = "https://github.com/google/perfetto"
3
4SRC_URI = "git://github.com/google/perfetto.git;protocol=https;name=perfetto;nobranch=1"
5
6SRCREV_perfetto = "1c52b5e132312aeb007ed180d4ba1d8d66227923"
7PV = "27.1"
8
9S = "${WORKDIR}/git"