Skip to contentSkip to conversation

boost-asio: Add recipe

PATCH Superseded Gustav Lindberg 2 participants 2 messages Aug 31 – Sep 1

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 boost-asio: Add recipe

This is needed to build boost asio as a shared library rather than a header-only library, which is needed to save memory.

---
 .../boost/boost-asio/boost_asio.cpp           |  1 +
 .../boost/boost-asio_1.92.0.bb                | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/boost/boost-asio/boost_asio.cpp
 create mode 100644 meta/recipes-support/boost/boost-asio_1.92.0.bb
meta/recipes-support/boost/boost-asio/boost_asio.cpp new file +1 -0
new file mode 100644
index 0000000000..bf00c8ff26
@@ -0,0 +1 @@
+#include <boost/asio/impl/src.hpp>
meta/recipes-support/boost/boost-asio_1.92.0.bb new file +33 -0
new file mode 100644
index 0000000000..a71e647303
@@ -0,0 +1,33 @@
+SUMMARY = "Boost.Asio shared library shim"
+DESCRIPTION = "Builds libboost_asio as a shared library from boost/asio/impl/src.hpp"
+HOMEPAGE = "https://www.boost.org/doc/libs/1_90_0/doc/html/boost_asio.html"
+
+DEPENDS = "boost"
+
+# Reuse Boost source and licensing metadata.
+require recipes-support/boost/boost-${PV}.inc
+
+SRC_URI += " file://boost_asio.cpp"
+
+MAJOR_VER = "${@oe.utils.trim_version("${PV}", 1)}"
+
+do_compile() {
+	${CXX} ${CPPFLAGS} ${CXXFLAGS} \
+		-std=c++23 \
+		-DBOOST_ASIO_DYN_LINK=1 \
+		-fPIC \
+		-shared \
+		-Wl,-soname,libboost_asio.so.${MAJOR_VER} \
+		${UNPACKDIR}/boost_asio.cpp \
+		${LDFLAGS} \
+		-o ${B}/libboost_asio.so.${PV}
+}
+
+do_install() {
+	install -d ${D}${libdir}
+	install -m 0755 ${B}/libboost_asio.so.${PV} ${D}${libdir}/
+	ln -sf libboost_asio.so.${PV} ${D}${libdir}/libboost_asio.so.${MAJOR_VER}
+	ln -sf libboost_asio.so.${MAJOR_VER} ${D}${libdir}/libboost_asio.so
+}
+
+BBCLASSEXTEND = "native"
Signature · 3 lines
2.43.0

Fix review comments: extract major version into a variable and upgrade boost version to 1.92.0.
#1 lore raw

meta/recipes-support/boost/boost-asio/boost_asio.cpp

Quoted 16 lines · Gustav Lindberg via lists.openembedded.org

This is needed to build boost asio as a shared library rather than a header-only library, which is needed to save memory.

---
 .../boost/boost-asio/boost_asio.cpp           |  1 +
 .../boost/boost-asio_1.92.0.bb                | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/boost/boost-asio/boost_asio.cpp
 create mode 100644 meta/recipes-support/boost/boost-asio_1.92.0.bb
meta/recipes-support/boost/boost-asio/boost_asio.cpp new file +0 -0
new file mode 100644
index 0000000000..bf00c8ff26

Hi Gustav,

Thanks for the new version. It is still failing on the autobuilder:

ERROR: boost-asio-1.92.0-r0 do_package_qa: QA Issue: File /usr/lib/.debug/libboost_asio.so.1.92.0 in package boost-asio-dbg contains reference to TMPDIR [buildpaths]
ERROR: boost-asio-1.92.0-r0 do_package_qa: QA Issue: File /usr/lib/.debug/libboost_asio.so.1.92.0 in package boost-asio-dbg contains a reference to the build host HOME directory. If upstream hardcodes a directory path that matches your home, you can set OEQA_BUILDPATHS_SKIP = "/srv/pokybuild" in the recipe. [buildpaths]
ERROR: boost-asio-1.92.0-r0 do_package_qa: Fatal QA errors were found, failing task.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/6/builds/4560
https://autobuilder.yoctoproject.org/valkyrie/#/builders/25/builds/4543

Can you have a look at the issue?

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com