Repository: conan-io/conan-center-index

Issue:
[package] dbus/>=1.14.0: Define dependency on libsystemd and add with_systemd option
### Description

DBus incorrectly detects `systemd` support in the build machine context instead of the host context. This causes `dbus` to fail to cross-compile when targeting a host sysroot without `systemd` support while the build machine has the `systemd` development package installed.

DBus should define a dependency on the `libsystemd` Conan package but does not which contributes to this problem.
The DBus Conan package should also include an option such as `with_systemd` to toggle systemd support in the package.
Of course, DBus doesn't correctly define some relationships between its targets and systemd, so patches will be required to make this work with DBus 1.14.0 and 1.15.0.

### Package and Environment Details

* Package Name/Version: **dbus/1.14.0 and dbus/1.15.0**
* Operating System+version: **Fedora Linux 37**
* Compiler+version: **GCC 12.2.1**
* Docker image: **N/A**
* Conan version: **conan 1.52.0**
* Python version: **Python 3.11.0rc2**


### Conan profile

[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=11
compiler.libcxx=libstdc++11
compiler.cppstd=20
build_type=Debug
[options]
[conf]
[build_requires]
[env]

### Steps to reproduce

1. Install the `systemd-devel` package on the build machine.

```sh
sudo dnf -y install systemd-devel
```

2. Now attempt to cross-compile `dbus` using a sysroot without `systemd`.

```sh
conan create . dbus/1.14.0@ -pr:b linux/gcc/release -pr:h aarch64-yocto-profile -u -b outdated -b cascade
````

### Logs

<details><summary>Click to expand log</summary>

```
[HOOK - conan-center.py] pre_export(): [DEPRECATED GLOBAL CPPSTD (KB-H001)] OK
[HOOK - conan-center.py] pre_export(): [REFERENCE LOWERCASE (KB-H002)] OK
[HOOK - conan-center.py] pre_export(): [RECIPE METADATA (KB-H003)] OK
[HOOK - conan-center.py] pre_export(): [HEADER_ONLY, NO COPY SOURCE (KB-H005)] OK
[HOOK - conan-center.py] pre_export(): WARN: [FPIC OPTION (KB-H006)] This recipe does not include an 'fPIC' option. Make sure you are using the right casing
[HOOK - conan-center.py] pre_export(): [FPIC OPTION (KB-H006)] OK
[HOOK - conan-center.py] pre_export(): [VERSION RANGES (KB-H008)] OK
[HOOK - conan-center.py] pre_export(): [RECIPE FOLDER SIZE (KB-H009)] Total recipe size: 15.2626953125 KB
[HOOK - conan-center.py] pre_export(): [RECIPE FOLDER SIZE (KB-H009)] OK
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] exports: None
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] exports: None
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE FOLDER (KB-H024)] OK
[HOOK - conan-center.py] pre_export(): [META LINES (KB-H025)] OK
[HOOK - conan-center.py] pre_export(): [CONAN CENTER INDEX URL (KB-H027)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE MINIMUM VERSION (KB-H028)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - RUN ENVIRONMENT (KB-H029)] OK
[HOOK - conan-center.py] pre_export(): [SYSTEM REQUIREMENTS (KB-H032)] OK
[HOOK - conan-center.py] pre_export(): [CONANDATA.YML FORMAT (KB-H030)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - NO IMPORTS() (KB-H034)] OK
[HOOK - conan-center.py] pre_export(): [NO AUTHOR (KB-H037)] OK
[HOOK - conan-center.py] pre_export(): [NOT ALLOWED ATTRIBUTES (KB-H039)] OK
[HOOK - conan-center.py] pre_export(): [NO TARGET NAME (KB-H040)] OK
[HOOK - conan-center.py] pre_export(): [NO FINAL ENDLINE (KB-H041)] OK
[HOOK - conan-center.py] pre_export(): [NO REQUIRES.ADD() (KB-H044)] OK
[HOOK - conan-center.py] pre_export(): [DELETE OPTIONS (KB-H045)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE VERBOSE MAKEFILE (KB-H046)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE VERSION REQUIRED (KB-H048)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE WINDOWS EXPORT ALL SYMBOLS (KB-H049)] OK
[HOOK - conan-center.py] pre_export(): [DEFAULT OPTIONS AS DICTIONARY (KB-H051)] OK
[HOOK - conan-center.py] pre_export(): [CONFIG.YML HAS NEW VERSION (KB-H052)] OK
[HOOK - conan-center.py] pre_export(): [PRIVATE IMPORTS (KB-H053)] OK
[HOOK - conan-center.py] pre_export(): [SINGLE REQUIRES (KB-H055)] OK
[HOOK - conan-center.py] pre_export(): [TOOLS RENAME (KB-H057)] OK
[HOOK - conan-center.py] pre_export(): [ILLEGAL CHARACTERS (KB-H058)] OK
[HOOK - conan-center.py] pre_export(): [CLASS NAME (KB-H059)] OK
[HOOK - conan-center.py] pre_export(): [NO CRLF (KB-H060)] OK
[HOOK - conan-center.py] pre_export(): [NO BUILD SYSTEM FUNCTIONS (KB-H061)] OK
[HOOK - conan-center.py] pre_export(): [TOOLS CROSS BUILDING (KB-H062)] OK
[HOOK - conan-center.py] pre_export(): [INVALID TOPICS (KB-H064)] OK
[HOOK - conan-center.py] pre_export(): [NO REQUIRED_CONAN_VERSION (KB-H065)] OK
[HOOK - conan-center.py] pre_export(): [TEST_TYPE MANAGEMENT (KB-H068)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - NO DEFAULT OPTIONS (KB-H069)] OK
[HOOK - conan-center.py] pre_export(): [MANDATORY SETTINGS (KB-H070)] OK
[HOOK - conan-center.py] pre_export(): [PYLINT EXECUTION (KB-H072)] OK
Exporting package recipe
dbus/1.14.0 exports: File 'conandata.yml' found. Exporting it...
dbus/1.14.0 exports: Copied 1 '.yml' file: conandata.yml
dbus/1.14.0: Calling export_sources()
dbus/1.14.0: Copied 1 '.txt' file: CMakeLists.txt
[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] Saving conandata.yml: {'sources': {'1.14.0': {'url': 'https://dbus.freedesktop.org/releases/dbus/dbus-1.14.0.tar.xz', 'sha256': 'ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4'}}}
[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] New conandata.yml contents: sources:
  1.14.0:
    sha256: ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4
    url: https://dbus.freedesktop.org/releases/dbus/dbus-1.14.0.tar.xz

[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] OK
[HOOK - conan-center.py] post_export(): [DEFAULT SHARED OPTION VALUE (KB-H050)] OK
[HOOK - conan-center.py] post_export(): [LICENSE PUBLIC DOMAIN (KB-H056)] OK
dbus/1.14.0: A new conanfile.py version was exported
dbus/1.14.0: Folder: /var/home/jordan/.conan/data/dbus/1.14.0/_/_/export
dbus/1.14.0: Using the exported files summary hash as the recipe revision: 3d463b58abc0d650d14e772b8a074d2b 
dbus/1.14.0: Exported revision: 3d463b58abc0d650d14e772b8a074d2b
Configuration (profile_host):
[settings]
arch=armv8
build_type=Debug
compiler=gcc
compiler.cppstd=20
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
[options]
[build_requires]
[env]
[conf]
tools.env.virtualenv:auto_use=True
tools.cmake.cmake_layout:build_folder_vars=['settings.arch', 'settings.compiler', 'options.shared']
tools.cmake.cmaketoolchain:find_package_prefer_config=True
tools.cmake.cmaketoolchain:generator=Ninja
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
tools.cmake.cmaketoolchain:system_processor=aarch64
tools.cmake.cmaketoolchain:user_toolchain=['/var/home/jordan/.conan/toolchains/yocto-sdk.cmake']

Configuration (profile_build):
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[options]
[build_requires]
[env]
[conf]
tools.env.virtualenv:auto_use=True
tools.cmake.cmake_layout:build_folder_vars=['settings.arch', 'settings.compiler', 'options.shared']
tools.cmake.cmaketoolchain:find_package_prefer_config=True
tools.cmake.cmaketoolchain:generator=Ninja
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

expat/2.4.9: WARN: Can't update, no package in remote
expat/2.4.9: Package is up to date
dbus/1.14.0 (test package): Installing package
Requirements
    dbus/1.14.0 from local cache - No remote
    expat/2.4.9 from 'conancenter' - Cache
Packages
    dbus/1.14.0:dfcb0585629c3a73e766748434522b6a7897473c - Build
    expat/2.4.9:b2251a9936385930069e8b8e11d81b9bb30eff31 - Cache

Cross-build from 'Linux:x86_64' to 'Linux:armv8'
Installing (downloading, building) binaries...
expat/2.4.9: Already installed!
[HOOK - conan-center.py] pre_source(): [IMMUTABLE SOURCES (KB-H010)] OK
dbus/1.14.0: Configuring sources in /var/home/jordan/.conan/data/dbus/1.14.0/_/_/source
dbus/1.14.0: 
[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK
[HOOK - conan-center.py] post_source(): [CPPSTD MANAGEMENT (KB-H022)] OK
[HOOK - conan-center.py] post_source(): [SHORT_PATHS USAGE (KB-H066)] OK
dbus/1.14.0: Copying sources to build folder
dbus/1.14.0: Building your package in /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c
dbus/1.14.0: Generator cmake created conanbuildinfo.cmake
dbus/1.14.0: Generator 'VirtualRunEnv' calling 'generate()'
dbus/1.14.0: Generator cmake_find_package created FindEXPAT.cmake
dbus/1.14.0: Generator 'VirtualBuildEnv' calling 'generate()'
dbus/1.14.0: Aggregating env generators
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
dbus/1.14.0: Calling build()
dbus/1.14.0: apply_conandata_patches(): No patches defined in conandata
Capturing current environment in /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/deactivate_conanbuildenv-debug-armv8.sh
Configuring environment variables
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/yocto-sdk/sysroots/x86_64-company-linux/usr/bin/aarch64-company-linux/aarch64-company-linux-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/yocto-sdk/sysroots/x86_64-company-linux/usr/bin/aarch64-company-linux/aarch64-company-linux-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
check_include_file(minix/config.h     HAVE_MINIX_CONFIG_H)
#cmakedefine HAVE_MINIX_CONFIG_H
check_include_file(wchar.h     HAVE_WCHAR_H)
#cmakedefine HAVE_WCHAR_H
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'libsystemd>=209'
--   Found libsystemd, version 251
-- Checking for module 'systemd'
--   Found systemd, version 251
-- Conan: Using autogenerated FindEXPAT.cmake
-- Found EXPAT: 2.4.9 (found version "2.4.9") 
-- Library expat found /var/home/jordan/.conan/data/expat/2.4.9/_/_/package/b2251a9936385930069e8b8e11d81b9bb30eff31/lib/libexpat.a
-- Found: /var/home/jordan/.conan/data/expat/2.4.9/_/_/package/b2251a9936385930069e8b8e11d81b9bb30eff31/lib/libexpat.a
-- Found X11: /usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/include   
-- Looking for XOpenDisplay in /usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libX11.so;/usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libX11.so;/usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found GLIB2: /usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libglib-2.0.so;/usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libgobject-2.0.so;/usr/local/yocto-sdk/sysroots/aarch64-company-linux/usr/lib/libgio-2.0.so  
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - found
-- Looking for crt/externs.h
-- Looking for crt/externs.h - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for expat.h
-- Looking for expat.h - found
-- Looking for grp.h
-- Looking for grp.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for locale.h
-- Looking for locale.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for syslog.h
-- Looking for syslog.h - found
-- Looking for 3 include files stdint.h, ..., sys/event.h
-- Looking for 3 include files stdint.h, ..., sys/event.h - not found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - found
-- Looking for sys/random.h
-- Looking for sys/random.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/uio.h
-- Looking for sys/uio.h - found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - found
-- Looking for sys/syslimits.h
-- Looking for sys/syslimits.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for time.h
-- Looking for time.h - found
-- Looking for ws2tcpip.h
-- Looking for ws2tcpip.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - found
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for getgrouplist
-- Looking for getgrouplist - found
-- Looking for getpeerucred
-- Looking for getpeerucred - not found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for getpwnam_r
-- Looking for getpwnam_r - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for clearenv
-- Looking for clearenv - found
-- Looking for writev
-- Looking for writev - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for socketpair
-- Looking for socketpair - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for localeconv
-- Looking for localeconv - found
-- Looking for poll
-- Looking for poll - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for inotify_init1
-- Looking for inotify_init1 - found
-- Looking for SCM_RIGHTS
-- Looking for SCM_RIGHTS - found
-- Looking for prctl
-- Looking for prctl - found
-- Looking for raise
-- Looking for raise - found
-- Looking for getrandom
-- Looking for getrandom - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for prlimit
-- Looking for prlimit - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for MSG_NOSIGNAL
-- Looking for MSG_NOSIGNAL - found
-- Looking for environ
-- Looking for environ - found
-- Looking for LOG_PERROR
-- Looking for LOG_PERROR - found
-- Performing Test HAVE_CMSGCRED
-- Performing Test HAVE_CMSGCRED - Failed
-- Performing Test DBUS_HAVE_LINUX_EPOLL
-- Performing Test DBUS_HAVE_LINUX_EPOLL - Success
-- Performing Test HAVE_VA_COPY
-- Performing Test HAVE_VA_COPY - Success
-- Performing Test HAVE___VA_COPY
-- Performing Test HAVE___VA_COPY - Success
-- Performing Test DBUS_USE_SYNC
-- Performing Test DBUS_USE_SYNC - Success
-- Performing Test HAVE_DIRFD
-- Performing Test HAVE_DIRFD - Failed
-- Performing Test HAVE_DDFD
-- Performing Test HAVE_DDFD - Failed
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of socklen_t
-- Check size of socklen_t - done
-- effectively used warnings for 'WARNINGS_CFLAGS': all;array-bounds;cast-align;char-subscripts;declaration-after-statement;double-promotion;duplicated-branches;duplicated-cond;extra;float-equal;format-nonliteral;format-security;format=2;implicit-function-declaration;init-self;inline;jump-misses-init;logical-op;missing-declarations;missing-format-attribute;missing-include-dirs;missing-noreturn;missing-prototypes;nested-externs;no-error=missing-field-initializers;no-error=unused-label;no-error=unused-parameter;no-missing-field-initializers;no-unused-label;no-unused-parameter;null-dereference;old-style-definition;packed;pointer-arith;pointer-sign;redundant-decls;restrict;return-type;shadow;sign-compare;strict-aliasing;strict-prototypes;switch-default;switch-enum;undef;unused-but-set-variable;write-strings
-- effectively used disabled warnings for 'WARNINGS_CFLAGS': error=overloaded-virtual;error=missing-field-initializers;error=unused-parameter;unused-parameter
-- effectively used warnings for 'WARNINGS_CXXFLAGS': all;array-bounds;cast-align;char-subscripts;declaration-after-statement;double-promotion;duplicated-branches;duplicated-cond;extra;float-equal;format-nonliteral;format-security;format=2;implicit-function-declaration;init-self;inline;jump-misses-init;logical-op;missing-declarations;missing-format-attribute;missing-include-dirs;missing-noreturn;missing-prototypes;nested-externs;no-error=missing-field-initializers;no-error=unused-label;no-error=unused-parameter;no-missing-field-initializers;no-unused-label;no-unused-parameter;null-dereference;old-style-definition;packed;pointer-arith;pointer-sign;redundant-decls;restrict;return-type;shadow;sign-compare;strict-aliasing;strict-prototypes;switch-default;switch-enum;undef;unused-but-set-variable;write-strings
-- effectively used disabled warnings for 'WARNINGS_CXXFLAGS': error=overloaded-virtual;error=missing-field-initializers;error=unused-parameter;unused-parameter
-- /usr/bin/xsltproc found
-- Could NOT find DocBookXSL (missing: DocBookXSL_DIR) 
 
set -DDBUS_INSTALL_SYSTEM_LIBS=1 to install runtime libraries too
set DBUSDIR (environment or cmake option) to overwrite the default install directory 
 
 
                  D-BUS 1.14.0                               
                  =============                                       
                                                                      
        install prefix:           /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c                           
        install exec_prefix:      /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c                      
        install libdir:           /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/lib        
        install libexecdir:       /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/bin    
        install bindir:           /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/bin        
        install sysconfdir:       /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/etc    
        install datadir:          /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/share       
        source code location:     /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/source_subfolder                 
        build dir:                /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/build_subfolder                 
        c compiler:               aarch64-company-linux-gcc                       
        cflags:                   -march=armv8-a+crc+crypto -mtune=cortex-a35 -Wno-psabi --sysroot=/usr/local/yocto-sdk/sysroots/aarch64-company-linux -fno-common  -Wall -Warray-bounds -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimplicit-function-declaration -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-error=missing-field-initializers -Wno-error=unused-label -Wno-error=unused-parameter -Wno-missing-field-initializers -Wno-unused-label -Wno-unused-parameter -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-but-set-variable -Wwrite-strings -Wno-error=overloaded-virtual -Wno-error=missing-field-initializers -Wno-error=unused-parameter -Wno-unused-parameter                    
        cflags debug:             -g -Wl,--export-dynamic -D_DEBUG              
        cflags release:           -O3 -DNDEBUG            
        cxx compiler:             aarch64-company-linux-g++                     
        cxxflags:                 -march=armv8-a+crc+crypto -mtune=cortex-a35 -Wno-psabi --sysroot=/usr/local/yocto-sdk/sysroots/aarch64-company-linux -fno-common  -Wall -Warray-bounds -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimplicit-function-declaration -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-error=missing-field-initializers -Wno-error=unused-label -Wno-error=unused-parameter -Wno-missing-field-initializers -Wno-unused-label -Wno-unused-parameter -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-but-set-variable -Wwrite-strings -Wno-error=overloaded-virtual -Wno-error=missing-field-initializers -Wno-error=unused-parameter -Wno-unused-parameter                  
        cxxflags debug:           -g -Wl,--export-dynamic            
        cxxflags release:         -O3 -DNDEBUG          
        64-bit int:               long                  
        32-bit int:               int                  
        16-bit int:               short                  
        Doxygen:                  DOXYGEN-NOTFOUND                          
        Docbook Generator:                   
        gcc coverage profiling:   OFF                
        Building unit tests:      False                 
        Building with GLib:       False                   
        Building verbose mode:    ON         
        Building w/o assertions:  False              
        Building w/o checks:      False              
        Building bus stats API:   OFF                
        installing system libs:   OFF         
        Building inotify support: 1          
        Building kqueue support:             
        Building systemd support: ON          
        systemd system install dir:lib/systemd/system      
        systemd user install dir: lib/systemd/user         
        Traditional activation:   ON    
        Building Doxygen docs:    False         
        Building Qt help docs:              
        Building XML docs:        False             
        Daemon executable name:   dbus-daemon
        System bus address:       unix:path=/var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/var/run/dbus/system_bus_socket  
        System bus socket:                       
        System bus PID file:      /var/home/jordan/.conan/data/dbus/1.14.0/_/_/package/dfcb0585629c3a73e766748434522b6a7897473c/var/run/dbus/pid             
        System bus user:          messagebus                        
        Session bus socket dir:   /tmp          
        pam_console auth dir:     (none)                              
        'make check' socket dir:                    
        Test listen address:                            
 
NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance.
NOTE: building with assertions increases library size and decreases performance.
 
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CONAN_COMPILER
    CONAN_COMPILER_VERSION
    CONAN_EXPORTED
    CONAN_IN_LOCAL_CACHE


-- Build files have been written to: /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/build_subfolder
Capturing current environment in /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/deactivate_conanbuildenv-debug-armv8.sh
Configuring environment variables
[1/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-marshal-byteswap.c.o
[2/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-errors.c.o
[3/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-address.c.o
[4/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-credentials.c.o
[5/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-keyring.c.o
[6/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-misc.c.o
[7/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-marshal-validate.c.o
[8/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-bus.c.o
[9/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-marshal-header.c.o
[10/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-nonce.c.o
[11/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-resources.c.o
[12/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-server-debug-pipe.c.o
[13/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-pending-call.c.o
[14/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-marshal-recursive.c.o
[15/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-syntax.c.o
[16/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-auth.c.o
[17/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-signature.c.o
[18/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-object-tree.c.o
[19/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-server-socket.c.o
[20/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-timeout.c.o
[21/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-threads.c.o
[22/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-server.c.o
[23/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-sha.c.o
[24/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-uuidgen.c.o
[25/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-file.c.o
[26/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-transport-unix.c.o
[27/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-watch.c.o
[28/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-dataslot.c.o
[29/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-server-unix.c.o
[30/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-list.c.o
[31/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-memory.c.o
[32/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-transport.c.o
[33/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-mempool.c.o
[34/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-internals.c.o
[35/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-transport-socket.c.o
[36/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-hash.c.o
[37/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-pipe.c.o
[38/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-marshal-basic.c.o
[39/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-pipe-unix.c.o
[40/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps.c.o
[41/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-file-unix.c.o
[42/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-message-util.c.o
[43/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-unix.c.o
FAILED: dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-unix.c.o 
/usr/local/yocto-sdk/sysroots/x86_64-company-linux/usr/bin/aarch64-company-linux/aarch64-company-linux-gcc -DDBUS_COMPILATION -DHAVE_CONFIG_H -Ddbus_1_EXPORTS -I/var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/source_subfolder/. -I/var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/build_subfolder -march=armv8-a+crc+crypto -mtune=cortex-a35 -Wno-psabi --sysroot=/usr/local/yocto-sdk/sysroots/aarch64-company-linux -fno-common  -Wall -Warray-bounds -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimplicit-function-declaration -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-error=missing-field-initializers -Wno-error=unused-label -Wno-error=unused-parameter -Wno-missing-field-initializers -Wno-unused-label -Wno-unused-parameter -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-but-set-variable -Wwrite-strings -Wno-error=overloaded-virtual -Wno-error=missing-field-initializers -Wno-error=unused-parameter -Wno-unused-parameter -g -Wl,--export-dynamic -D_DEBUG -fPIC -MD -MT dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-unix.c.o -MF dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-unix.c.o.d -o dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-unix.c.o -c /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/source_subfolder/dbus/dbus-sysdeps-unix.c
/var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/source_subfolder/dbus/dbus-sysdeps-unix.c:89:10: fatal error: systemd/sd-daemon.h: No such file or directory
   89 | #include <systemd/sd-daemon.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[44/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-asv-util.c.o
[45/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-message.c.o
[46/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-sysdeps-pthread.c.o
[47/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-userdb.c.o
[48/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-shell.c.o
[49/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-mainloop.c.o
[50/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-pollable-set.c.o
[51/120] Building C object tools/CMakeFiles/dbus-test-tool.dir/tool-common.c.o
[52/120] Building C object dbus/CMakeFiles/dbus-internal.dir/dbus-pollable-set-poll.c.o
[53/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-connection.c.o
[54/120] Building C object dbus/CMakeFiles/dbus-1.dir/dbus-string.c.o
ninja: build stopped: subcommand failed.
dbus/1.14.0: 
dbus/1.14.0: ERROR: Package 'dfcb0585629c3a73e766748434522b6a7897473c' build failed
dbus/1.14.0: WARN: Build folder /var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c
ERROR: dbus/1.14.0: Error in build() method, line 110
	cmake.build()
	ConanException: Error 1 while executing cmake --build '/var/home/jordan/.conan/data/dbus/1.14.0/_/_/build/dfcb0585629c3a73e766748434522b6a7897473c/build_subfolder' '--' '-j12'
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py
--- a/recipes/dbus/1.x.x/conanfile.py
+++ b/recipes/dbus/1.x.x/conanfile.py
@@ -1,8 +1,12 @@
 from conan import ConanFile
 from conan.errors import ConanInvalidConfiguration
 from conan.tools.apple import is_apple_os
-from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
-from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rmdir, save
+from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain
+from conan.tools.env import VirtualBuildEnv
+from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save
+from conan.tools.gnu import PkgConfigDeps
+from conan.tools.layout import basic_layout, cmake_layout
+from conan.tools.meson import Meson, MesonToolchain
 from conan.tools.scm import Version
 import os
 import textwrap
@@ -16,14 +20,15 @@ class DbusConan(ConanFile):
     url = "https://github.com/conan-io/conan-center-index"
     homepage = "https://www.freedesktop.org/wiki/Software/dbus"
     description = "D-Bus is a simple system for interprocess communication and coordination."
-    topics = ("dbus")
-
+    topics = ("bus", "interprocess", "message")
     settings = "os", "arch", "compiler", "build_type"
+    short_paths = True
     options = {
         "system_socket": ["ANY"],
         "system_pid_file": ["ANY"],
         "with_x11": [True, False],
         "with_glib": [True, False],
+        "with_systemd": [True, False],
         "with_selinux": [True, False],
         "session_socket_dir": ["ANY"],
     }
@@ -32,14 +37,21 @@ class DbusConan(ConanFile):
         "system_pid_file": "",
         "with_x11": False,
         "with_glib": False,
+        "with_systemd": False,
         "with_selinux": False,
         "session_socket_dir": "/tmp",
     }
 
+    @property
+    def _meson_available(self):
+        return Version(self.version) >= "1.15.0"
+
     def export_sources(self):
         export_conandata_patches(self)
 
     def config_options(self):
+        if self.settings.os not in ("Linux", "FreeBSD") or Version(self.version) < "1.14.0":
+            del self.options.with_systemd
         if self.settings.os not in ("Linux", "FreeBSD"):
             del self.options.with_x11
 
@@ -54,14 +66,24 @@ def configure(self):
             pass
 
     def layout(self):
-        cmake_layout(self, src_folder="src")
+        if self._meson_available:
+            basic_layout(self, src_folder="src")
+        else:
+            cmake_layout(self, src_folder="src")
+
+    def build_requirements(self):
+        if self._meson_available:
+            self.tool_requires("meson/0.63.3")
+            self.tool_requires("pkgconf/1.9.3")
 
     def requirements(self):
         self.requires("expat/2.4.9")
         if self.options.with_glib:
             self.requires("glib/2.74.0")
+        if self.options.get_safe("with_systemd"):
+            self.requires("libsystemd/251.4")
         if self.options.with_selinux:
-            self.requires("selinux/3.3")
+            self.requires("libselinux/3.3")
         if self.options.get_safe("with_x11"):
             self.requires("xorg/system")
 
@@ -69,54 +91,82 @@ def validate(self):
         if Version(self.version) >= "1.14.0":
             if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) < 7:
                 raise ConanInvalidConfiguration(f"{self.ref} requires at least gcc 7.")
-            if self.info.settings.os == "Windows":
-                raise ConanInvalidConfiguration(f"{self.ref} does not support windows. contributions are welcome")
+            
+        if not self._meson_available and self.info.settings.os == "Windows":
+            raise ConanInvalidConfiguration(f"{self.ref} does not support Windows. Contributions welcome.")
 
     def source(self):
         get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True)
 
     def generate(self):
-        tc = CMakeToolchain(self)
-        tc.variables["DBUS_BUILD_TESTS"] = False
-        tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False
-        tc.variables["DBUS_ENABLE_XML_DOCS"] = False
-        tc.variables["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False)
-        tc.variables["DBUS_WITH_GLIB"] = self.options.with_glib
-        tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self)
-        tc.variables["DBUS_DISABLE_CHECKS"] = False
-        # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a
-        tc.variables["DBUS_SESSION_SOCKET_DIR"] = self.options.session_socket_dir
-        tc.generate()
-
-        deps = CMakeDeps(self)
-        deps.generate()
-
-    def _patch_sources(self):
-        apply_conandata_patches(self)
-        # Unfortunately, there is currently no other way to force disable
-        # CMAKE_FIND_PACKAGE_PREFER_CONFIG ON in CMake conan_toolchain.
-        replace_in_file(
-            self,
-            os.path.join(self.generators_folder, "conan_toolchain.cmake"),
-            "set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)",
-            "",
-            strict=False,
-        )
+        if self._meson_available:
+            tc = MesonToolchain(self)
+            tc.project_options["asserts"] = not is_apple_os(self)
+            tc.project_options["checks"] = False
+            tc.project_options["doxygen_docs"] = "disabled"
+            tc.project_options["modular_tests"] = "disabled"
+            tc.project_options["session_socket_dir"] = str(self.options.session_socket_dir)
+            tc.project_options["selinux"] = "enabled" if self.options.get_safe("with_selinux", False) else "disabled"
+            tc.project_options["systemd"] = "enabled" if self.options.get_safe("with_systemd", False) else "disabled"
+            if self.options.get_safe("with_systemd", False):
+                tc.project_options["systemd_system_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "system")
+                tc.project_options["systemd_user_unitdir"] = os.path.join(self.package_folder, "lib", "systemd", "user")
+            if is_apple_os(self):
+                tc.project_options["launchd_agent_dir"] = os.path.join(self.package_folder, "res", "LaunchAgents")
+            tc.project_options["x11_autolaunch"] = "enabled" if self.options.get_safe("with_x11", False) else "disabled"
+            tc.project_options["xml_docs"] = "disabled"
+            tc.generate()
+            env = VirtualBuildEnv(self)
+            env.generate(scope="build")
+        else:
+            tc = CMakeToolchain(self)
+            tc.variables["DBUS_BUILD_TESTS"] = False
+            tc.variables["DBUS_ENABLE_DOXYGEN_DOCS"] = False
+            tc.variables["DBUS_ENABLE_XML_DOCS"] = False
+            tc.variables["DBUS_BUILD_X11"] = bool(self.options.get_safe("with_x11", False))
+            tc.variables["ENABLE_SYSTEMD"] = "ON" if self.options.get_safe("with_systemd", False) else "OFF"
+            tc.variables["DBUS_WITH_GLIB"] = bool(self.options.get_safe("with_glib", False))
+            tc.variables["DBUS_DISABLE_ASSERT"] = is_apple_os(self)
+            tc.variables["DBUS_DISABLE_CHECKS"] = False
+
+            # Conan does not provide an EXPAT_LIBRARIES CMake variable for the Expat library.
+            # Define EXPAT_LIBRARIES to be the expat::expat target provided by Conan to fix linking.
+            tc.variables["EXPAT_LIBRARIES"] = "expat::expat"
+
+            # https://github.com/freedesktop/dbus/commit/e827309976cab94c806fda20013915f1db2d4f5a
+            tc.variables["DBUS_SESSION_SOCKET_DIR"] = str(self.options.session_socket_dir)
+
+            tc.cache_variables["CMAKE_FIND_PACKAGE_PREFER_CONFIG"] = False
+            tc.generate()
+            cmake_deps = CMakeDeps(self)
+            cmake_deps.generate()
+        pkg_config_deps = PkgConfigDeps(self)
+        pkg_config_deps.generate()
 
     def build(self):
-        self._patch_sources()
-        cmake = CMake(self)
-        if Version(self.version) < "1.14.0":
-            cmake.configure(build_script_folder=os.path.join(self.source_folder, "cmake"))
+        apply_conandata_patches(self)
+        if self._meson_available:
+            meson = Meson(self)
+            meson.configure()
+            meson.build()
         else:
-            cmake.configure()
-        cmake.build()
+            cmake = CMake(self)
+            build_script_folder = None
+            if Version(self.version) < "1.14.0":
+                build_script_folder = "cmake"
+            cmake.configure(build_script_folder=build_script_folder)
+            cmake.build()
 
     def package(self):
         copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
-        cmake = CMake(self)
-        cmake.install()
+        if self._meson_available:
+            meson = Meson(self)
+            meson.install()
+        else:
+            cmake = CMake(self)
+            cmake.install()
 
+        rm(self, "*.pdb", os.path.join(self.package_folder, "bin"))
         rmdir(self, os.path.join(self.package_folder, "share", "doc"))
         mkdir(self, os.path.join(self.package_folder, "res"))
         for i in ["var", "share", "etc"]:


Test patch: