Skip to contentSkip to conversation

Building wmbusmeters with Yocto

DISCUSSION Daniel Kampert 2 participants 6 messages Dec 17, 2024

lore
Share & tools
lore
#0 lore raw

Hi,

I´m a Yocto newbie and I try to build wmbusmeters for my Yocto project (https://github.com/wmbusmeters/wmbusmeters/tree/1.18.0). I added a recipe to a custom meta-layer and add the missing rtlsdr library as a second recipe to this meta-layer. For building wmbusmeters I use this bb file:

inherit autotools

SUMMARY = "wmbusmeters integration"
HOMEPAGE = "https://github.com/wmbusmeters/wmbusmeters"

LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"

# Use version 1.18.0
SRC_URI = "git://github.com/wmbusmeters/wmbusmeters;protocol=https;branch=master" SRC_URI[sha256sum] = "57ecd94793ba5c985dc412876253a7b0d8a006f0c8e440f1b1f146d4c30da2b7" SRCREV = "2f2720d9d8e043304a366d11d933be9d535e17a5"

DEPENDS = "rtlsdr"
RDEPENDS_${PN} = "rtlsdr"
S = "${WORKDIR}/git"

But I get this error:

| checking for xmlFreeDoc in -lxml2... yes
| configure: creating build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/build/aarch64-tdx-linux-gnu/config.status
| config.status: error: cannot find input file: `/build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/autoconf/spec.gmk.in'
| NOTE: The following config.log files may provide further information.
| NOTE: build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/config.log

But the "autoconf" directory is available in the git directory under "/tmp/work". Why is Yocto using the wrong path and where is my issue?

Thanks for helping me out!

#1 lore raw
Quoted 5 lines · Daniel Kampert via lists.yoctoproject.org
| checking for xmlFreeDoc in -lxml2... yes 
| configure: creating build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/build/aarch64-tdx-linux-gnu/config.status 
| config.status: error: cannot find input file: `/build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/autoconf/spec.gmk.in' 
| NOTE: The following config.log files may provide further information. 
| NOTE: build/tmp/work/aarch64-tdx-linux/wmbusmeters/0.1-r0/build/config.log

The problem here is that the Makefiles are not automake, whereas the autotools class is for autoconf+automake usage.

You can’t control where the build tree is with that configure script, so inheriting autotools-brokensep instead might solve this problem.

Ross

#2 lore raw

Hi Ross,

thanks. After changing it I got the error

Quoted 4 lines

fatal error: unicode/ucnv.h: No such file or directory

So I had to add "icu" as dependency. The complete recipe looks like this

inherit autotools-brokensep

SUMMARY = "wmbusmeters integration"
HOMEPAGE = "https://github.com/wmbusmeters/wmbusmeters"

LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"

# Use version 1.18.0
SRC_URI = "git://github.com/wmbusmeters/wmbusmeters;protocol=https;branch=master" SRC_URI[sha256sum] = "57ecd94793ba5c985dc412876253a7b0d8a006f0c8e440f1b1f146d4c30da2b7" SRCREV = "2f2720d9d8e043304a366d11d933be9d535e17a5"

DEPENDS = "rtlsdr icu"
RDEPENDS_${PN} = "rtlsdr icu"

S = "${WORKDIR}/git"

FILES_${PN} += " ${systemd_system_unitdir}/wmbusmeters.service"

Now I get this error

Quoted 4 lines

QA Issue: File '/usr/bin/wmbusmeters' from wmbusmeters was already stripped, this will prevent future debugging!

#3 lore raw
Quoted 2 lines · Daniel Kampert via Lists.Yoctoproject.Org

QA Issue: File '/usr/bin/wmbusmeters' from wmbusmeters was already stripped, this will prevent future debugging!

I’ll spare you my rant about how hand-written Makefiles are a pain for everyone involved…

The message is hopefully descriptive: the binary wmbusmeters is already stripped, so we can’t extract debug symbols.

Looking at the Makefile we see STRIP?=strip, so we can nuke that by adding this to the recipe so that when the Makefile thinks it is stripping, it’s actually just running ’true’:

EXTRA_OEMAKE += “STRIP=true”

Ross

#4 lore raw

Hi Ross,

thanks for the explanation! Everything is clear now :)