We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] dbus/1.12.20: cannot connect to system bus on linux
# dbus/1.12.20 cannot connect to the system bus on linux
The system bus socket in improperly configured (see log) when dbus/1.12.20 is built. This makes any connection attempt to the system bus impossible.

### Package and Environment Details
  * Package Name/Version: **dbus/1.12.20**
  * Operating System+version: **Linux Ubuntu 20.04**
  * Compiler+version: **GCC 9**
  * Docker image: **n/a**
  * Conan version: **conan 1.46.2**
  * Python version: **Python 3.8.10**


### Conan profile
```
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++11
build_type=Release
[options]
[conf]
[build_requires]
[env]
```


### Steps to reproduce
Minimal Example:

conanfile.txt:
```
[requires]
dbus/1.12.20
qt/5.15.2

[options]
qt:shared=True
qt:with_dbus=True

[generators]
CMakeDeps
CMakeToolchain
VirtualRunEnv
```

CMakeLists.txt:
```cmake
cmake_minimum_required(VERSION 3.15)
project(dbus-test)

find_package(Qt5 REQUIRED COMPONENTS DBus)
add_executable(dbus-test main.cpp)
target_link_libraries(dbus-test Qt5::DBus)
```

main.cpp:
```cpp
#include <iostream>

#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>

int main(int argc, char**argv) {
    QDBusConnection connection = QDBusConnection::systemBus();

    std::cout << "Is connected? " << connection.isConnected()
        << "\nError: \"" << connection.lastError().message().toStdString() << "\"\n";

    return 0;
}
```

1. run `mkdir build && cd build && conan install .. --build=missing`
2. run `cmake -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake ..`
3. run `make`
4. run `source conanrun.sh`
5. run `./dbus-test`

Expected output:
```
Is connected? 1
Error: ""
```
Actual output:
```
Is connected? 0
Error: "Socket name too long
"
```

**Note** that running `dbus-test` outside of the conan runenv will produce the expected behavior, as the system dbus library is used (as seen by `ldd dbus-test`).

### Logs (Include/Attach if Applicable)
[log.txt](https://github.com/conan-io/conan-center-index/files/8470511/log.txt)




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/dbus/1.x.x/conanfile.py`
Content:
```
1 from conans import AutoToolsBuildEnvironment, ConanFile, tools, CMake
2 import os
3 import shutil
4 import textwrap
5 
6 required_conan_version = ">=1.43.0"
7 
8 
9 class DbusConan(ConanFile):
10     name = "dbus"
11     license = ("AFL-2.1", "GPL-2.0-or-later")
12     url = "https://github.com/conan-io/conan-center-index"
13     homepage = "https://www.freedesktop.org/wiki/Software/dbus"
14     description = "D-Bus is a simple system for interprocess communication and coordination."
15     topics = ("dbus")
16 
17     settings = "os", "arch", "compiler", "build_type"
18     options = {
19         "with_x11": [True, False],
20         "with_glib": [True, False],
21     }
22     default_options = {
23         "with_x11": False,
24         "with_glib": False,
25     }
26 
27     generators = "pkg_config", "cmake", "cmake_find_package"
28     _autotools = None
29     _cmake = None
30 
31     @property
32     def _source_subfolder(self):
33         return "source_subfolder"
34 
35     @property
36     def _build_subfolder(self):
37         return "build_subfolder"
38 
39     def config_options(self):
40         if self.settings.os not in ("Linux", "FreeBSD"):
41             del self.options.with_x11
42 
43     def configure(self):
44         del self.settings.compiler.libcxx
45         del self.settings.compiler.cppstd
46 
47     def requirements(self):
48         self.requires("expat/2.4.6")
49         if self.options.with_glib:
50             self.requires("glib/2.70.1")
51         if self.options.get_safe("with_x11"):
52             self.requires("xorg/system")
53 
54     def source(self):
55         tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
56 
57     def _configure_autotools(self):
58         if not self._autotools:
59             self._autotools = AutoToolsBuildEnvironment(self)
60 
61             args = []
62             args.append("--disable-tests")
63             args.append("--disable-doxygen-docs")
64             args.append("--disable-xml-docs")
65 
66             args.append("--with-x=%s" % ("yes" if self.options.get_safe("with_x11", False) else "no"))
67             args.append("--%s-x11-autolaunch" % ("enable" if self.options.get_safe("with_x11", False) else "disable"))
68             args.append("--disable-asserts")
69             args.append("--disable-checks")
70 
71             args.append("--with-systemdsystemunitdir=%s" % os.path.join(self.package_folder, "lib", "systemd", "system"))
72             args.append("--with-systemduserunitdir=%s" % os.path.join(self.package_folder, "lib", "systemd", "user"))
73 
74             args.append("--disable-launchd")
75             args.append("--disable-systemd")
76 
77             self._autotools.configure(args=args, configure_dir=self._source_subfolder)
78         return self._autotools
79 
80     def _configure_cmake(self):
81         if not self._cmake:
82             self._cmake = CMake(self)
83 
84             self._cmake.definitions["DBUS_BUILD_TESTS"] = False
85             self._cmake.definitions["DBUS_ENABLE_DOXYGEN_DOCS"] = False
86             self._cmake.definitions["DBUS_ENABLE_XML_DOCS"] = False
87 
88             self._cmake.definitions["DBUS_BUILD_X11"] = self.options.get_safe("with_x11", False)
89             self._cmake.definitions["DBUS_WITH_GLIB"] = self.options.with_glib
90             self._cmake.definitions["DBUS_DISABLE_ASSERT"] = False
91             self._cmake.definitions["DBUS_DISABLE_CHECKS"] = False
92 
93             path_to_cmake_lists = os.path.join(self._source_subfolder, "cmake")
94 
95             self._cmake.configure(source_folder=path_to_cmake_lists,
96                                   build_folder=self._build_subfolder)
97         return self._cmake
98 
99     def build(self):
100         tools.replace_in_file(os.path.join(self._source_subfolder, "cmake", "CMakeLists.txt"),
101                               "project(dbus)",
102                               "project(dbus)\ninclude(../../conanbuildinfo.cmake)\nconan_basic_setup()")
103         if self.settings.os == "Windows":
104             cmake = self._configure_cmake()
105             cmake.build()
106         else:
107             autotools = self._configure_autotools()
108             autotools.make()
109 
110     def package(self):
111         self.copy(pattern="COPYING", dst="licenses",
112                   src=self._source_subfolder)
113         if self.settings.os == "Windows":
114             cmake = self._configure_cmake()
115             cmake.install()
116         else:
117             autotools = self._configure_autotools()
118             autotools.install()
119 
120         tools.rmdir(os.path.join(self.package_folder, "share", "doc"))
121         for i in ["var", "share", "etc"]:
122             shutil.move(os.path.join(self.package_folder, i), os.path.join(self.package_folder, "res", i))
123 
124         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
125         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
126         tools.rmdir(os.path.join(self.package_folder, "lib", "systemd"))
127         tools.remove_files_by_mask(self.package_folder, "*.la")
128 
129         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
130         self._create_cmake_module_alias_targets(
131             os.path.join(self.package_folder, self._module_file_rel_path),
132             {"dbus-1": "dbus-1::dbus-1"}
133         )
134 
135     @staticmethod
136     def _create_cmake_module_alias_targets(module_file, targets):
137         content = ""
138         for alias, aliased in targets.items():
139             content += textwrap.dedent("""\
140                 if(TARGET {aliased} AND NOT TARGET {alias})
141                     add_library({alias} INTERFACE IMPORTED)
142                     set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})
143                 endif()
144             """.format(alias=alias, aliased=aliased))
145         tools.save(module_file, content)
146 
147     @property
148     def _module_file_rel_path(self):
149         return os.path.join("lib", "cmake", "conan-official-{}-targets.cmake".format(self.name))
150 
151     def package_info(self):
152         self.cpp_info.set_property("cmake_file_name", "DBus1")
153         self.cpp_info.set_property("cmake_target_name", "dbus-1")
154         self.cpp_info.set_property("pkg_config_name", "dbus-1")
155         self.cpp_info.includedirs.extend([
156             os.path.join("include", "dbus-1.0"),
157             os.path.join("lib", "dbus-1.0", "include"),
158         ])
159         self.cpp_info.libs = ["dbus-1"]
160 
161         # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed
162         self.cpp_info.filenames["cmake_find_package"] = "DBus1"
163         self.cpp_info.filenames["cmake_find_package_multi"] = "DBus1"
164         self.cpp_info.names["cmake_find_package"] = "dbus-1"
165         self.cpp_info.names["cmake_find_package_multi"] = "dbus-1"
166         self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path]
167         self.cpp_info.build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
168         self.cpp_info.names["pkg_config"] = "dbus-1"
169
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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
@@ -16,10 +16,14 @@
 
     settings = "os", "arch", "compiler", "build_type"
     options = {
+        "system_socket": "ANY",
+        "system_pid_file": "ANY",
         "with_x11": [True, False],
         "with_glib": [True, False],
     }
     default_options = {
+        "system_socket": "",
+        "system_pid_file": "",
         "with_x11": False,
         "with_glib": False,
     }
@@ -71,6 +75,11 @@
             args.append("--with-systemdsystemunitdir=%s" % os.path.join(self.package_folder, "lib", "systemd", "system"))
             args.append("--with-systemduserunitdir=%s" % os.path.join(self.package_folder, "lib", "systemd", "user"))
 
+            if str(self.options.system_socket) is not "":
+                args.append("--with-system-socket=%s" % self.options.system_socket)
+            if str(self.options.system_pid_file) is not "":
+                args.append("--with-system-pid-file=%s" % self.options.system_pid_file)
+
             args.append("--disable-launchd")
             args.append("--disable-systemd")

{"golden_diff": "diff --git a/recipes/dbus/1.x.x/conanfile.py b/recipes/dbus/1.x.x/conanfile.py\n--- a/recipes/dbus/1.x.x/conanfile.py\n+++ b/recipes/dbus/1.x.x/conanfile.py\n@@ -16,10 +16,14 @@\n \n     settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n     options = {\n+        \"system_socket\": \"ANY\",\n+        \"system_pid_file\": \"ANY\",\n         \"with_x11\": [True, False],\n         \"with_glib\": [True, False],\n     }\n     default_options = {\n+        \"system_socket\": \"\",\n+        \"system_pid_file\": \"\",\n         \"with_x11\": False,\n         \"with_glib\": False,\n     }\n@@ -71,6 +75,11 @@\n             args.append(\"--with-systemdsystemunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"system\"))\n             args.append(\"--with-systemduserunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"user\"))\n \n+            if str(self.options.system_socket) is not \"\":\n+                args.append(\"--with-system-socket=%s\" % self.options.system_socket)\n+            if str(self.options.system_pid_file) is not \"\":\n+                args.append(\"--with-system-pid-file=%s\" % self.options.system_pid_file)\n+\n             args.append(\"--disable-launchd\")\n             args.append(\"--disable-systemd\")\n", "issue": "[package] dbus/1.12.20: cannot connect to system bus on linux\n# dbus/1.12.20 cannot connect to the system bus on linux\r\nThe system bus socket in improperly configured (see log) when dbus/1.12.20 is built. This makes any connection attempt to the system bus impossible.\r\n\r\n### Package and Environment Details\r\n  * Package Name/Version: **dbus/1.12.20**\r\n  * Operating System+version: **Linux Ubuntu 20.04**\r\n  * Compiler+version: **GCC 9**\r\n  * Docker image: **n/a**\r\n  * Conan version: **conan 1.46.2**\r\n  * Python version: **Python 3.8.10**\r\n\r\n\r\n### Conan profile\r\n```\r\nConfiguration for profile default:\r\n\r\n[settings]\r\nos=Linux\r\nos_build=Linux\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=9\r\ncompiler.libcxx=libstdc++11\r\nbuild_type=Release\r\n[options]\r\n[conf]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce\r\nMinimal Example:\r\n\r\nconanfile.txt:\r\n```\r\n[requires]\r\ndbus/1.12.20\r\nqt/5.15.2\r\n\r\n[options]\r\nqt:shared=True\r\nqt:with_dbus=True\r\n\r\n[generators]\r\nCMakeDeps\r\nCMakeToolchain\r\nVirtualRunEnv\r\n```\r\n\r\nCMakeLists.txt:\r\n```cmake\r\ncmake_minimum_required(VERSION 3.15)\r\nproject(dbus-test)\r\n\r\nfind_package(Qt5 REQUIRED COMPONENTS DBus)\r\nadd_executable(dbus-test main.cpp)\r\ntarget_link_libraries(dbus-test Qt5::DBus)\r\n```\r\n\r\nmain.cpp:\r\n```cpp\r\n#include <iostream>\r\n\r\n#include <QCoreApplication>\r\n#include <QDBusConnection>\r\n#include <QDBusError>\r\n\r\nint main(int argc, char**argv) {\r\n    QDBusConnection connection = QDBusConnection::systemBus();\r\n\r\n    std::cout << \"Is connected? \" << connection.isConnected()\r\n        << \"\\nError: \\\"\" << connection.lastError().message().toStdString() << \"\\\"\\n\";\r\n\r\n    return 0;\r\n}\r\n```\r\n\r\n1. run `mkdir build && cd build && conan install .. --build=missing`\r\n2. run `cmake -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake ..`\r\n3. run `make`\r\n4. run `source conanrun.sh`\r\n5. run `./dbus-test`\r\n\r\nExpected output:\r\n```\r\nIs connected? 1\r\nError: \"\"\r\n```\r\nActual output:\r\n```\r\nIs connected? 0\r\nError: \"Socket name too long\r\n\"\r\n```\r\n\r\n**Note** that running `dbus-test` outside of the conan runenv will produce the expected behavior, as the system dbus library is used (as seen by `ldd dbus-test`).\r\n\r\n### Logs (Include/Attach if Applicable)\r\n[log.txt](https://github.com/conan-io/conan-center-index/files/8470511/log.txt)\r\n\r\n\r\n\n", "before_files": [{"content": "from conans import AutoToolsBuildEnvironment, ConanFile, tools, CMake\nimport os\nimport shutil\nimport textwrap\n\nrequired_conan_version = \">=1.43.0\"\n\n\nclass DbusConan(ConanFile):\n    name = \"dbus\"\n    license = (\"AFL-2.1\", \"GPL-2.0-or-later\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://www.freedesktop.org/wiki/Software/dbus\"\n    description = \"D-Bus is a simple system for interprocess communication and coordination.\"\n    topics = (\"dbus\")\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"with_x11\": [True, False],\n        \"with_glib\": [True, False],\n    }\n    default_options = {\n        \"with_x11\": False,\n        \"with_glib\": False,\n    }\n\n    generators = \"pkg_config\", \"cmake\", \"cmake_find_package\"\n    _autotools = None\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _build_subfolder(self):\n        return \"build_subfolder\"\n\n    def config_options(self):\n        if self.settings.os not in (\"Linux\", \"FreeBSD\"):\n            del self.options.with_x11\n\n    def configure(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def requirements(self):\n        self.requires(\"expat/2.4.6\")\n        if self.options.with_glib:\n            self.requires(\"glib/2.70.1\")\n        if self.options.get_safe(\"with_x11\"):\n            self.requires(\"xorg/system\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version], strip_root=True, destination=self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self)\n\n            args = []\n            args.append(\"--disable-tests\")\n            args.append(\"--disable-doxygen-docs\")\n            args.append(\"--disable-xml-docs\")\n\n            args.append(\"--with-x=%s\" % (\"yes\" if self.options.get_safe(\"with_x11\", False) else \"no\"))\n            args.append(\"--%s-x11-autolaunch\" % (\"enable\" if self.options.get_safe(\"with_x11\", False) else \"disable\"))\n            args.append(\"--disable-asserts\")\n            args.append(\"--disable-checks\")\n\n            args.append(\"--with-systemdsystemunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"system\"))\n            args.append(\"--with-systemduserunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"user\"))\n\n            args.append(\"--disable-launchd\")\n            args.append(\"--disable-systemd\")\n\n            self._autotools.configure(args=args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n\n            self._cmake.definitions[\"DBUS_BUILD_TESTS\"] = False\n            self._cmake.definitions[\"DBUS_ENABLE_DOXYGEN_DOCS\"] = False\n            self._cmake.definitions[\"DBUS_ENABLE_XML_DOCS\"] = False\n\n            self._cmake.definitions[\"DBUS_BUILD_X11\"] = self.options.get_safe(\"with_x11\", False)\n            self._cmake.definitions[\"DBUS_WITH_GLIB\"] = self.options.with_glib\n            self._cmake.definitions[\"DBUS_DISABLE_ASSERT\"] = False\n            self._cmake.definitions[\"DBUS_DISABLE_CHECKS\"] = False\n\n            path_to_cmake_lists = os.path.join(self._source_subfolder, \"cmake\")\n\n            self._cmake.configure(source_folder=path_to_cmake_lists,\n                                  build_folder=self._build_subfolder)\n        return self._cmake\n\n    def build(self):\n        tools.replace_in_file(os.path.join(self._source_subfolder, \"cmake\", \"CMakeLists.txt\"),\n                              \"project(dbus)\",\n                              \"project(dbus)\\ninclude(../../conanbuildinfo.cmake)\\nconan_basic_setup()\")\n        if self.settings.os == \"Windows\":\n            cmake = self._configure_cmake()\n            cmake.build()\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", dst=\"licenses\",\n                  src=self._source_subfolder)\n        if self.settings.os == \"Windows\":\n            cmake = self._configure_cmake()\n            cmake.install()\n        else:\n            autotools = self._configure_autotools()\n            autotools.install()\n\n        tools.rmdir(os.path.join(self.package_folder, \"share\", \"doc\"))\n        for i in [\"var\", \"share\", \"etc\"]:\n            shutil.move(os.path.join(self.package_folder, i), os.path.join(self.package_folder, \"res\", i))\n\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"systemd\"))\n        tools.remove_files_by_mask(self.package_folder, \"*.la\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self._create_cmake_module_alias_targets(\n            os.path.join(self.package_folder, self._module_file_rel_path),\n            {\"dbus-1\": \"dbus-1::dbus-1\"}\n        )\n\n    @staticmethod\n    def _create_cmake_module_alias_targets(module_file, targets):\n        content = \"\"\n        for alias, aliased in targets.items():\n            content += textwrap.dedent(\"\"\"\\\n                if(TARGET {aliased} AND NOT TARGET {alias})\n                    add_library({alias} INTERFACE IMPORTED)\n                    set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})\n                endif()\n            \"\"\".format(alias=alias, aliased=aliased))\n        tools.save(module_file, content)\n\n    @property\n    def _module_file_rel_path(self):\n        return os.path.join(\"lib\", \"cmake\", \"conan-official-{}-targets.cmake\".format(self.name))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"DBus1\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"dbus-1\")\n        self.cpp_info.set_property(\"pkg_config_name\", \"dbus-1\")\n        self.cpp_info.includedirs.extend([\n            os.path.join(\"include\", \"dbus-1.0\"),\n            os.path.join(\"lib\", \"dbus-1.0\", \"include\"),\n        ])\n        self.cpp_info.libs = [\"dbus-1\"]\n\n        # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"DBus1\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"DBus1\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"dbus-1\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"dbus-1\"\n        self.cpp_info.build_modules[\"cmake_find_package\"] = [self._module_file_rel_path]\n        self.cpp_info.build_modules[\"cmake_find_package_multi\"] = [self._module_file_rel_path]\n        self.cpp_info.names[\"pkg_config\"] = \"dbus-1\"\n", "path": "recipes/dbus/1.x.x/conanfile.py"}], "after_files": [{"content": "from conans import AutoToolsBuildEnvironment, ConanFile, tools, CMake\nimport os\nimport shutil\nimport textwrap\n\nrequired_conan_version = \">=1.43.0\"\n\n\nclass DbusConan(ConanFile):\n    name = \"dbus\"\n    license = (\"AFL-2.1\", \"GPL-2.0-or-later\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://www.freedesktop.org/wiki/Software/dbus\"\n    description = \"D-Bus is a simple system for interprocess communication and coordination.\"\n    topics = (\"dbus\")\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"system_socket\": \"ANY\",\n        \"system_pid_file\": \"ANY\",\n        \"with_x11\": [True, False],\n        \"with_glib\": [True, False],\n    }\n    default_options = {\n        \"system_socket\": \"\",\n        \"system_pid_file\": \"\",\n        \"with_x11\": False,\n        \"with_glib\": False,\n    }\n\n    generators = \"pkg_config\", \"cmake\", \"cmake_find_package\"\n    _autotools = None\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _build_subfolder(self):\n        return \"build_subfolder\"\n\n    def config_options(self):\n        if self.settings.os not in (\"Linux\", \"FreeBSD\"):\n            del self.options.with_x11\n\n    def configure(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def requirements(self):\n        self.requires(\"expat/2.4.6\")\n        if self.options.with_glib:\n            self.requires(\"glib/2.70.1\")\n        if self.options.get_safe(\"with_x11\"):\n            self.requires(\"xorg/system\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version], strip_root=True, destination=self._source_subfolder)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self)\n\n            args = []\n            args.append(\"--disable-tests\")\n            args.append(\"--disable-doxygen-docs\")\n            args.append(\"--disable-xml-docs\")\n\n            args.append(\"--with-x=%s\" % (\"yes\" if self.options.get_safe(\"with_x11\", False) else \"no\"))\n            args.append(\"--%s-x11-autolaunch\" % (\"enable\" if self.options.get_safe(\"with_x11\", False) else \"disable\"))\n            args.append(\"--disable-asserts\")\n            args.append(\"--disable-checks\")\n\n            args.append(\"--with-systemdsystemunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"system\"))\n            args.append(\"--with-systemduserunitdir=%s\" % os.path.join(self.package_folder, \"lib\", \"systemd\", \"user\"))\n\n            if str(self.options.system_socket) is not \"\":\n                args.append(\"--with-system-socket=%s\" % self.options.system_socket)\n            if str(self.options.system_pid_file) is not \"\":\n                args.append(\"--with-system-pid-file=%s\" % self.options.system_pid_file)\n\n            args.append(\"--disable-launchd\")\n            args.append(\"--disable-systemd\")\n\n            self._autotools.configure(args=args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n\n            self._cmake.definitions[\"DBUS_BUILD_TESTS\"] = False\n            self._cmake.definitions[\"DBUS_ENABLE_DOXYGEN_DOCS\"] = False\n            self._cmake.definitions[\"DBUS_ENABLE_XML_DOCS\"] = False\n\n            self._cmake.definitions[\"DBUS_BUILD_X11\"] = self.options.get_safe(\"with_x11\", False)\n            self._cmake.definitions[\"DBUS_WITH_GLIB\"] = self.options.with_glib\n            self._cmake.definitions[\"DBUS_DISABLE_ASSERT\"] = False\n            self._cmake.definitions[\"DBUS_DISABLE_CHECKS\"] = False\n\n            path_to_cmake_lists = os.path.join(self._source_subfolder, \"cmake\")\n\n            self._cmake.configure(source_folder=path_to_cmake_lists,\n                                  build_folder=self._build_subfolder)\n        return self._cmake\n\n    def build(self):\n        tools.replace_in_file(os.path.join(self._source_subfolder, \"cmake\", \"CMakeLists.txt\"),\n                              \"project(dbus)\",\n                              \"project(dbus)\\ninclude(../../conanbuildinfo.cmake)\\nconan_basic_setup()\")\n        if self.settings.os == \"Windows\":\n            cmake = self._configure_cmake()\n            cmake.build()\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", dst=\"licenses\",\n                  src=self._source_subfolder)\n        if self.settings.os == \"Windows\":\n            cmake = self._configure_cmake()\n            cmake.install()\n        else:\n            autotools = self._configure_autotools()\n            autotools.install()\n\n        tools.rmdir(os.path.join(self.package_folder, \"share\", \"doc\"))\n        for i in [\"var\", \"share\", \"etc\"]:\n            shutil.move(os.path.join(self.package_folder, i), os.path.join(self.package_folder, \"res\", i))\n\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"systemd\"))\n        tools.remove_files_by_mask(self.package_folder, \"*.la\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self._create_cmake_module_alias_targets(\n            os.path.join(self.package_folder, self._module_file_rel_path),\n            {\"dbus-1\": \"dbus-1::dbus-1\"}\n        )\n\n    @staticmethod\n    def _create_cmake_module_alias_targets(module_file, targets):\n        content = \"\"\n        for alias, aliased in targets.items():\n            content += textwrap.dedent(\"\"\"\\\n                if(TARGET {aliased} AND NOT TARGET {alias})\n                    add_library({alias} INTERFACE IMPORTED)\n                    set_property(TARGET {alias} PROPERTY INTERFACE_LINK_LIBRARIES {aliased})\n                endif()\n            \"\"\".format(alias=alias, aliased=aliased))\n        tools.save(module_file, content)\n\n    @property\n    def _module_file_rel_path(self):\n        return os.path.join(\"lib\", \"cmake\", \"conan-official-{}-targets.cmake\".format(self.name))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"DBus1\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"dbus-1\")\n        self.cpp_info.set_property(\"pkg_config_name\", \"dbus-1\")\n        self.cpp_info.includedirs.extend([\n            os.path.join(\"include\", \"dbus-1.0\"),\n            os.path.join(\"lib\", \"dbus-1.0\", \"include\"),\n        ])\n        self.cpp_info.libs = [\"dbus-1\"]\n\n        # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"DBus1\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"DBus1\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"dbus-1\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"dbus-1\"\n        self.cpp_info.build_modules[\"cmake_find_package\"] = [self._module_file_rel_path]\n        self.cpp_info.build_modules[\"cmake_find_package_multi\"] = [self._module_file_rel_path]\n        self.cpp_info.names[\"pkg_config\"] = \"dbus-1\"\n", "path": "recipes/dbus/1.x.x/conanfile.py"}]}