Skip to contentSkip to conversation

abseil-cpp: A little clean-up

PATCH In review Peter Kjellerstedt 3 participants 5 messages Mar 6, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 abseil-cpp: A little clean-up

* Remove ASNEEDED:class-native and ASNEEDED:class-nativesdk as they make no difference since ${ASNEEDED} is only added to TARGET_LDFLAGS.
* Remove additions to FILES:${PN}-dev since the added paths are already added by default.

---
 .../recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb +2 -7
index 1ce6ff3fc..667693a4c 100644
@@ -1,7 +1,7 @@
 SUMMARY = "Abseil is a cpp library like STL"
 DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
 additional useful libraries like algorithm, container, debugging, hash, memory, \
-meta, numeric, strings, synchronization, time, types and utility"
+meta, numeric, strings, synchronization, time, types and utility."
 HOMEPAGE = "https://abseil.io/"
 SECTION = "libs"
 LICENSE = "Apache-2.0"
@@ -19,9 +19,6 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
 
 S = "${WORKDIR}/git"
 
-ASNEEDED:class-native = ""
-ASNEEDED:class-nativesdk = ""
-
 inherit cmake
 
 EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
@@ -29,8 +26,6 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
                  -DABSL_ENABLE_INSTALL=ON \
                 "
 
-BBCLASSEXTEND = "native nativesdk"
-
 SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
 
-FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig"
+BBCLASSEXTEND = "native nativesdk"
#1 lore raw

PATCH 2/2 abseil-cpp: Split so-files into separate packages

From: Ola x Nilsson <[email protected]>

Use PACKAGES_DYNAMIC and PACKAGESPLITFUNCS to put each shared object into its own package named libabsl-*.
The shared objects depend on each other which means you still get a lot of them if you link against a single one.

The main package abseil-cpp RDEPENDS on all of the libabsl-* packages.

---
 .../abseil-cpp/abseil-cpp_20230802.1.bb       | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb +23 -0
index 667693a4c..17db7b2e4 100644
@@ -28,4 +28,27 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
 
 SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
 
+PACKAGES_DYNAMIC = "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+    libdir = d.getVar('libdir')
+
+    libpackages = do_split_packages(
+        d,
+        root=libdir,
+        file_regex=r'^libabsl_(.*)\.so\..*$',
+        output_pattern='libabsl-%s',
+        description="abseil shared library %s",
+        prepend=True,
+        extra_depends='',
+    )
+    if libpackages:
+        d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
 BBCLASSEXTEND = "native nativesdk"
#2 lore raw
In reply to Peter Kjellerstedt

Which branch is it intended for?, if it is master then always rebase and test patches on latest master or master-next, otherwise add the name of branch in subject prefix
makes it easy for maintainers to route the patch.

Quoted 53 lines · Peter Kjellerstedt

* Remove ASNEEDED:class-native and ASNEEDED:class-nativesdk as they make no difference since ${ASNEEDED} is only added to TARGET_LDFLAGS.
* Remove additions to FILES:${PN}-dev since the added paths are already added by default.

---
 .../recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb +2 -8
index 1ce6ff3fc..667693a4c 100644
@@ -1,7 +1,7 @@
 SUMMARY = "Abseil is a cpp library like STL"
 DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
 additional useful libraries like algorithm, container, debugging, hash, memory, \
-meta, numeric, strings, synchronization, time, types and utility"
+meta, numeric, strings, synchronization, time, types and utility."
 HOMEPAGE = "https://abseil.io/"
 SECTION = "libs"
 LICENSE = "Apache-2.0"
@@ -19,9 +19,6 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
 
 S = "${WORKDIR}/git"
 
-ASNEEDED:class-native = ""
-ASNEEDED:class-nativesdk = ""
-
 inherit cmake
 
 EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
@@ -29,8 +26,6 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
                  -DABSL_ENABLE_INSTALL=ON \
                 "
 
-BBCLASSEXTEND = "native nativesdk"
-
 SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
 
-FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig"
+BBCLASSEXTEND = "native nativesdk"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#109170): https://lists.openembedded.org/g/openembedded-devel/message/109170
Mute This Topic: https://lists.openembedded.org/mt/104769052/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 8 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 6 mars 2024 17:49
To: Peter Kjellerstedt <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] abseil-cpp: A little clean-up

Quoted 4 lines

Which branch is it intended for?, if it is master then always rebase and test patches on latest master or master-next, otherwise add the name of branch in subject prefix
makes it easy for maintainers to route the patch.

It _is_ based on current master. I do not use master-next as I assume it to be a work in progress until it is merged to master.

//Peter

Quoted 49 lines · Peter Kjellerstedt
Quoted 47 lines

* Remove ASNEEDED:class-native and ASNEEDED:class-nativesdk as they make no difference since ${ASNEEDED} is only added to TARGET_LDFLAGS.
* Remove additions to FILES:${PN}-dev since the added paths are already added by default.

---
 .../recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb +2 -7
index 1ce6ff3fc..667693a4c 100644
@@ -1,7 +1,7 @@
 SUMMARY = "Abseil is a cpp library like STL"
 DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
 additional useful libraries like algorithm, container, debugging, hash, memory, \
-meta, numeric, strings, synchronization, time, types and utility"
+meta, numeric, strings, synchronization, time, types and utility."
 HOMEPAGE = "https://abseil.io/"
 SECTION = "libs"
 LICENSE = "Apache-2.0"
@@ -19,9 +19,6 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
 
 S = "${WORKDIR}/git"
 
-ASNEEDED:class-native = ""
-ASNEEDED:class-nativesdk = ""
-
 inherit cmake
 
 EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
@@ -29,8 +26,6 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
                  -DABSL_ENABLE_INSTALL=ON \
                 "
 
-BBCLASSEXTEND = "native nativesdk"
-
 SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
 
-FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig"
+BBCLASSEXTEND = "native nativesdk"
#4 lore raw
Quoted 9 lines · Peter Kjellerstedt
Quoted 9 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: den 6 mars 2024 17:49
To: Peter Kjellerstedt <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] abseil-cpp: A little clean-up

Quoted 7 lines
Quoted 4 lines

Which branch is it intended for?, if it is master then always rebase and test patches on latest master or master-next, otherwise add the name of branch in subject prefix
makes it easy for maintainers to route the patch.

It _is_ based on current master. I do not use master-next as I assume it to be a work in progress until it is merged to master.

Thanks, there is an upgrade for this recipe staged in master-next. perhaps would be good to test it on top of that and see if this works as you intend it to

Quoted 52 lines

//Peter

Quoted 49 lines · Peter Kjellerstedt
Quoted 47 lines

* Remove ASNEEDED:class-native and ASNEEDED:class-nativesdk as they make no difference since ${ASNEEDED} is only added to TARGET_LDFLAGS.
* Remove additions to FILES:${PN}-dev since the added paths are already added by default.

---
 .../recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_20230802.1.bb +2 -7
index 1ce6ff3fc..667693a4c 100644
@@ -1,7 +1,7 @@
 SUMMARY = "Abseil is a cpp library like STL"
 DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
 additional useful libraries like algorithm, container, debugging, hash, memory, \
-meta, numeric, strings, synchronization, time, types and utility"
+meta, numeric, strings, synchronization, time, types and utility."
 HOMEPAGE = "https://abseil.io/"
 SECTION = "libs"
 LICENSE = "Apache-2.0"
@@ -19,9 +19,6 @@ SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
 
 S = "${WORKDIR}/git"
 
-ASNEEDED:class-native = ""
-ASNEEDED:class-nativesdk = ""
-
 inherit cmake
 
 EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
@@ -29,8 +26,6 @@ EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
                  -DABSL_ENABLE_INSTALL=ON \
                 "
 
-BBCLASSEXTEND = "native nativesdk"
-
 SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
 
-FILES:${PN}-dev += "${includedir} ${libdir}/cmake ${libdir}/pkgconfig"
+BBCLASSEXTEND = "native nativesdk"