Repository: conan-io/conan-center-index

Issue:
[package] elfutils/0.180: with_bzlib, with_lzma, with_zlib options don't work when set to False
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: elfutils/0.180
  * Operating System+version: Linux Ubuntu 20.04
  * Compiler+version: GCC 9.4
  * Conan version: conan 1.46.0
  * Python version: Python 3.8.10


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
Configuration for profile default:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9
compiler.libcxx=libstdc++
build_type=Release
[options]
[conf]
[build_requires]
[env]
```

### Steps to reproduce (Include if Applicable)
```
conan install --build=missing -o elfutils:with_lzma=False -o elfutils:with_bzlib=False elfutils/0.180@
```


### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=9
os=Linux
os_build=Linux
[options]
with_bzlib=False
with_lzma=False
[build_requires]
[env]

Installing package: elfutils/0.180
Requirements
    elfutils/0.180 from 'conancenter' - Cache
    zlib/1.2.11 from 'conancenter' - Cache
Packages
    elfutils/0.180:8e0939db49a1d312829524beb4d0b6824e47691d - Cache
    zlib/1.2.11:6af9cc7cb931c5ad942174fd7838eb655717c709 - Cache

Installing (downloading, building) binaries...
zlib/1.2.11: Already installed!
elfutils/0.180: Already installed!
elfutils/0.180: Appending PATH env var with : /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin
elfutils/0.180: Setting ADDR2LINE to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-addr2line
elfutils/0.180: Setting AR to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-ar
elfutils/0.180: Setting ELFCLASSIFY to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-elfclassify
elfutils/0.180: Setting ELFCMP to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-elfcmp
elfutils/0.180: Setting ELFCOMPRESS to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-elfcompress
elfutils/0.180: Setting ELFLINT to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-elflint
elfutils/0.180: Setting FINDTEXTREL to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-findtextrel
elfutils/0.180: Setting MAKE_DEBUG_ARCHIVE to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-make-debug-archive
elfutils/0.180: Setting NM to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-nm
elfutils/0.180: Setting OBJDUMP to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-objdump
elfutils/0.180: Setting RANLIB to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-ranlib
elfutils/0.180: Setting READELF to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-readelf
elfutils/0.180: Setting SIZE to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-size
elfutils/0.180: Setting STACK to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-stack
elfutils/0.180: Setting STRINGS to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-strings
elfutils/0.180: Setting STRIP to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-strip
elfutils/0.180: Setting UNSTRIP to /root/.conan/data/elfutils/0.180/_/_/package/8e0939db49a1d312829524beb4d0b6824e47691d/bin/eu-unstrip
ERROR:
        ConanException: elfutils/0.180 package_info(): Package require 'bzip2' declared in components requires but not defined as a recipe requirement

```

</details>


Additionally, even though it is configurable in elfutils's build system, you can't actually disable zlib:

```
conan install --build=missing -o elfutils:with_zlib=False elfutils/0.180@
```

<details><summary>Click to expand log</summary>

```
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=9
os=Linux
os_build=Linux
[options]
with_zlib=False
[build_requires]
[env]

Installing package: elfutils/0.180
Requirements
    bzip2/1.0.8 from 'conancenter' - Cache
    elfutils/0.180 from 'conancenter' - Cache
    xz_utils/5.2.5 from 'conancenter' - Cache
Packages
    bzip2/1.0.8:da606cf731e334010b0bf6e85a2a6f891b9f36b0 - Cache
    elfutils/0.180:ad50d14834f40a11a444fcf83593bcdc541230e1 - Build
    xz_utils/5.2.5:6af9cc7cb931c5ad942174fd7838eb655717c709 - Cache
Build requirements
    autoconf/2.71 from 'conancenter' - Cache
    automake/1.16.4 from 'conancenter' - Cache
    bison/3.7.6 from 'conancenter' - Cache
    flex/2.6.4 from 'conancenter' - Cache
    m4/1.4.19 from 'conancenter' - Cache
    pkgconf/1.7.4 from 'conancenter' - Cache
Build requirements packages
    autoconf/2.71:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    automake/1.16.4:258f6f05ca54813b3d7180161753df7f9ccf7e1d - Cache
    bison/3.7.6:342e3231dc960817bf56ef67435733b30b1e7c97 - Cache
    flex/2.6.4:342e3231dc960817bf56ef67435733b30b1e7c97 - Cache
    m4/1.4.19:24647d9fe8ec489125dfbae4b3ebefaf7581674c - Cache
    pkgconf/1.7.4:6af9cc7cb931c5ad942174fd7838eb655717c709 - Cache

Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
bzip2/1.0.8: Appending PATH environment variable: /root/.conan/data/bzip2/1.0.8/_/_/package/da606cf731e334010b0bf6e85a2a6f891b9f36b0/bin
m4/1.4.19: Already installed!
m4/1.4.19: Appending PATH environment variable: /root/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin
m4/1.4.19: Setting M4 environment variable: /root/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/m4
pkgconf/1.7.4: Already installed!
pkgconf/1.7.4: Appending PATH env var: /root/.conan/data/pkgconf/1.7.4/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/bin
pkgconf/1.7.4: Setting PKG_CONFIG env var: /root/.conan/data/pkgconf/1.7.4/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/bin/pkgconf
pkgconf/1.7.4: Appending AUTOMAKE_CONAN_INCLUDES env var: /root/.conan/data/pkgconf/1.7.4/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/bin/aclocal
xz_utils/5.2.5: Already installed!
autoconf/2.71: Already installed!
autoconf/2.71: Appending PATH env var with : /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin
autoconf/2.71: Setting AC_MACRODIR to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf
autoconf/2.71: Setting AUTOCONF to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoconf
autoconf/2.71: Setting AUTORECONF to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoreconf
autoconf/2.71: Setting AUTOHEADER to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoheader
autoconf/2.71: Setting AUTOM4TE to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autom4te
autoconf/2.71: Setting AUTOM4TE_PERLLIBDIR to /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf
bison/3.7.6: Already installed!
bison/3.7.6: Setting BISON_ROOT environment variable: /root/.conan/data/bison/3.7.6/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97
bison/3.7.6: Appending PATH environment variable: /root/.conan/data/bison/3.7.6/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97/bin
bison/3.7.6: Setting the BISON_PKGDATADIR environment variable: /root/.conan/data/bison/3.7.6/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97/res/bison
flex/2.6.4: Already installed!
flex/2.6.4: Appending PATH environment variable: /root/.conan/data/flex/2.6.4/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97/bin
flex/2.6.4: Setting LEX environment variable: /root/.conan/data/flex/2.6.4/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97/bin/flex
automake/1.16.4: Already installed!
automake/1.16.4: Appending PATH environment variable:: /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin
automake/1.16.4: Appending ACLOCAL environment variable with: /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal
automake/1.16.4: Setting AUTOMAKE_DATADIR to /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res
automake/1.16.4: Setting AUTOMAKE_LIBDIR to /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16
automake/1.16.4: Setting AUTOMAKE_PERLLIBDIR to /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16
automake/1.16.4: Setting AUTOMAKE to /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/automake
automake/1.16.4: Append M4 include directories to AUTOMAKE_CONAN_INCLUDES environment variable
elfutils/0.180: Applying build-requirement: automake/1.16.4
elfutils/0.180: Applying build-requirement: flex/2.6.4
elfutils/0.180: Applying build-requirement: bison/3.7.6
elfutils/0.180: Applying build-requirement: pkgconf/1.7.4
elfutils/0.180: Applying build-requirement: autoconf/2.71
elfutils/0.180: Applying build-requirement: m4/1.4.19
elfutils/0.180: Copying sources to build folder
elfutils/0.180: Building your package in /root/.conan/data/elfutils/0.180/_/_/build/ad50d14834f40a11a444fcf83593bcdc541230e1
elfutils/0.180: Generator pkg_config created automake.pc
elfutils/0.180: Generator pkg_config created flex.pc
elfutils/0.180: Generator pkg_config created bison.pc
elfutils/0.180: Generator pkg_config created libpkgconf.pc
elfutils/0.180: Generator pkg_config created bzip2.pc
elfutils/0.180: Generator pkg_config created liblzma.pc
elfutils/0.180: Generator pkg_config created autoconf.pc
elfutils/0.180: Generator pkg_config created m4.pc
elfutils/0.180: Aggregating env generators
elfutils/0.180: Calling build()
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoconf --force
configure.ac:93: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from...
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from...
aclocal.m4:1068: AM_PROG_LEX is expanded from...
configure.ac:93: the top level
configure.ac:424: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:424: You should run autoupdate.
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/zip.m4:5: eu_ZIPLIB is expanded from...
configure.ac:424: the top level
configure.ac:432: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:432: You should run autoupdate.
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/zip.m4:5: eu_ZIPLIB is expanded from...
configure.ac:432: the top level
configure.ac:436: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:436: You should run autoupdate.
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/zip.m4:5: eu_ZIPLIB is expanded from...
configure.ac:436: the top level
configure.ac:676: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:676: You should run autoupdate.
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
m4/biarch.m4:28: utrace_BIARCH is expanded from...
configure.ac:676: the top level
configure.ac:711: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:711: You should run autoupdate.
/home/conan/w/BuildSingleReference/.conan/data/autoconf/2.71/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:711: the top level
autoreconf: running: /root/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoheader --force
autoreconf: running: /root/.conan/data/automake/1.16.4/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/automake --add-missing --copy --force-missing
autoreconf: Leaving directory '.'
elfutils/0.180: Calling:
 > source_subfolder/configure '--disable-werror' '--enable-static=yes' '--enable-deterministic-archives' '--enable-silent-rules' '--without-zlib' '--with-bzlib' '--with-lzma' '--disable-debuginfod' 'BUILD_STATIC=1' '--prefix=/root/.conan/data/elfutils/0.180/_/_/package/ad50d14834f40a11a444fcf83593bcdc541230e1' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' 
configure: No --program-prefix given, using "eu-"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for bison... bison -y
checking for flex... /root/.conan/data/flex/2.6.4/_/_/package/342e3231dc960817bf56ef67435733b30b1e7c97/bin/flex
checking for lex output file root... lex.yy
checking for lex library... none needed
checking for library containing yywrap... -lfl
checking whether yytext is a pointer... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for readelf... readelf
checking for nm... nm
checking for gcc with GNU99 support... yes
checking whether gcc supports __attribute__((visibility()))... yes
checking whether gcc supports __attribute__((gcc_struct))... yes
checking whether gcc supports -fPIC... yes
checking whether gcc supports -fPIE... yes
checking whether gcc supports -Wl,-z,defs... yes
checking whether the compiler generates build-ids... yes
checking whether gcc supports -Wl,-z,relro... yes
checking for __thread support... yes
checking whether gcc provides stdatomic.h... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether fts.h is bad when included (with LFS)... no
checking whether to add -D_FORTIFY_SOURCE=2 to CFLAGS... yes
checking whether to treat warnings as errors... no
checking whether to build elfutils as a static library... yes
configure: error: zlib not found but is required
elfutils/0.180: 
elfutils/0.180: WARN: Package binary is corrupted, removing: ad50d14834f40a11a444fcf83593bcdc541230e1
elfutils/0.180: WARN: Build folder is dirty, removing it: /root/.conan/data/elfutils/0.180/_/_/build/ad50d14834f40a11a444fcf83593bcdc541230e1
elfutils/0.180: ERROR: Package 'ad50d14834f40a11a444fcf83593bcdc541230e1' build failed
elfutils/0.180: WARN: Build folder /root/.conan/data/elfutils/0.180/_/_/build/ad50d14834f40a11a444fcf83593bcdc541230e1
ERROR: elfutils/0.180: Error in build() method, line 114
	autotools = self._configure_autotools()
while calling '_configure_autotools', line 106
	self._autotools.configure(configure_dir=self._source_subfolder, args=args)
	ConanException: Error 1 while executing source_subfolder/configure '--disable-werror' '--enable-static=yes' '--enable-deterministic-archives' '--enable-silent-rules' '--without-zlib' '--with-bzlib' '--with-lzma' '--disable-debuginfod' 'BUILD_STATIC=1' '--prefix=/root/.conan/data/elfutils/0.180/_/_/package/ad50d14834f40a11a444fcf83593bcdc541230e1' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' 

```

</details>


Discussion:

Resolving patch:
diff --git a/recipes/elfutils/all/conanfile.py b/recipes/elfutils/all/conanfile.py
--- a/recipes/elfutils/all/conanfile.py
+++ b/recipes/elfutils/all/conanfile.py
@@ -21,7 +21,6 @@ class ElfutilsConan(ConanFile):
         "with_bzlib": [True, False],
         "with_lzma": [True, False],
         "with_sqlite3": [True, False],
-        "with_zlib": [True, False],
     }
     default_options = {
         "shared": False,
@@ -30,7 +29,6 @@ class ElfutilsConan(ConanFile):
         "with_bzlib": True,
         "with_lzma": True,
         "with_sqlite3": False,
-        "with_zlib": True,
     }
 
     generators = "pkg_config"
@@ -60,12 +58,11 @@ def validate(self):
             self.output.warn("Compiler %s is not gcc." % self.settings.compiler)
 
     def requirements(self):
+        self.requires("zlib/1.2.11")
         if self.options.with_sqlite3:
             self.requires("sqlite3/3.37.0")
         if self.options.with_bzlib:
             self.requires("bzip2/1.0.8")
-        if self.options.with_zlib:
-            self.requires("zlib/1.2.11")
         if self.options.with_lzma:
             self.requires("xz_utils/5.2.5")
         if self.options.debuginfod:
@@ -96,7 +93,7 @@ def _configure_autotools(self):
                 "--enable-static={}".format("no" if self.options.shared else "yes"),
                 "--enable-deterministic-archives",
                 "--enable-silent-rules",
-                "--with-zlib" if self.options.with_zlib else "--without-zlib",
+                "--with-zlib",
                 "--with-bzlib" if self.options.with_bzlib else "--without-bzlib",
                 "--with-lzma" if self.options.with_lzma else "--without-lzma",
                 "--enable-debuginfod" if self.options.debuginfod else "--disable-debuginfod",
@@ -132,7 +129,11 @@ def package_info(self):
         self.cpp_info.components["libelf"].requires = ["zlib::zlib"]
 
         self.cpp_info.components["libdw"].libs = ["dw"]
-        self.cpp_info.components["libdw"].requires = ["libelf", "zlib::zlib", "bzip2::bzip2", "xz_utils::xz_utils"]
+        self.cpp_info.components["libdw"].requires = ["libelf", "zlib::zlib"]
+        if self.options.with_bzlib:
+            self.cpp_info.components["libdw"].requires.append("bzip2::bzip2")
+        if self.options.with_lzma:
+            self.cpp_info.components["libdw"].requires.append("xz_utils::xz_utils")
 
         self.cpp_info.components["libasm"].includedirs = ["include/elfutils"]
         self.cpp_info.components["libasm"].libs = ["asm"]


Test patch: