We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[request] libusb/1.0.25
### Package Details
  * Package Name/Version: **libusb/1.0.25**
  * Changelog: **https://github.com/libusb/libusb/blob/master/ChangeLog**


2022-01-31: v1.0.25
* Linux: Fix regression with some particular devices
* Linux: Fix regression with libusb_handle_events_timeout_completed()
* Linux: Fix regression with cpu usage in libusb_bulk_transfer
* Darwin (macOS): Add support for detaching kernel drivers with authorization.
* Darwin (macOS): Do not drop partial data on timeout.
* Darwin (macOS): Silence pipe error in set_interface_alt_setting().
* Windows: Fix HID backend missing byte
* Windows: Fix segfault with libusbk driver
* Windows: Fix regression when using libusb0 driver
* Windows: Support LIBUSB_TRANSFER_ADD_ZERO_PACKET on winusb
* New NO_DEVICE_DISCOVERY option replaces WEAK_AUTHORITY option
* Various other bug fixes and improvements

PR follows

--- 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/libusb/all/conanfile.py`
Content:
```
1 from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 import re
5 
6 required_conan_version = ">=1.33.0"
7 
8 
9 class LibUSBConan(ConanFile):
10     name = "libusb"
11     description = "A cross-platform library to access USB devices"
12     license = "LGPL-2.1"
13     homepage = "https://github.com/libusb/libusb"
14     url = "https://github.com/conan-io/conan-center-index"
15     topics = ("conan", "libusb", "usb", "device")
16     settings = "os", "compiler", "build_type", "arch"
17     options = {
18         "shared": [True, False],
19         "fPIC": [True, False],
20         "enable_udev": [True, False],
21     }
22     default_options = {
23         "shared": False,
24         "fPIC": True,
25         "enable_udev": True,
26     }
27     _autotools = None
28 
29     @property
30     def _source_subfolder(self):
31         return "source_subfolder"
32 
33     @property
34     def _is_mingw(self):
35         return self.settings.os == "Windows" and self.settings.compiler == "gcc"
36 
37     @property
38     def _is_msvc(self):
39         return self.settings.os == "Windows" and self.settings.compiler == "Visual Studio"
40 
41     @property
42     def _settings_build(self):
43         return self.settings_build if hasattr(self, "settings_build") else self.settings
44 
45     def config_options(self):
46         if self.settings.os == "Windows":
47             del self.options.fPIC
48         if self.settings.os not in ["Linux", "Android"]:
49             del self.options.enable_udev
50         # FIXME: enable_udev should be True for Android, but libudev recipe is missing
51         if self.settings.os == "Android":
52             self.options.enable_udev = False
53 
54     def configure(self):
55         if self.options.shared:
56             del self.options.fPIC
57         del self.settings.compiler.libcxx
58         del self.settings.compiler.cppstd
59 
60     def build_requirements(self):
61         if self._settings_build.os == "Windows" and not self._is_msvc and not tools.get_env("CONAN_BASH_PATH"):
62             self.build_requires("msys2/cci.latest")
63 
64     def requirements(self):
65         if self.settings.os == "Linux":
66             if self.options.enable_udev:
67                 self.requires("libudev/system")
68 
69     def source(self):
70         tools.get(**self.conan_data["sources"][self.version],
71                   destination=self._source_subfolder, strip_root=True)
72 
73     def _build_visual_studio(self):
74         with tools.chdir(self._source_subfolder):
75             # Assume we're using the latest Visual Studio and default to libusb_2019.sln
76             # (or libusb_2017.sln for libusb < 1.0.24).
77             # If we're not using the latest Visual Studio, select an appropriate solution file.
78             solution_msvc_year = 2019 if tools.Version(self.version) >= "1.0.24" else 2017
79 
80             solution_msvc_year = {
81                 "11": 2012,
82                 "12": 2013,
83                 "14": 2015,
84                 "15": 2017
85             }.get(str(self.settings.compiler.version), solution_msvc_year)
86 
87             solution_file = os.path.join("msvc", "libusb_{}.sln".format(solution_msvc_year))
88             platforms = {"x86":"Win32"}
89             properties = {
90                 # Enable LTO when CFLAGS contains -GL
91                 "WholeProgramOptimization": "true" if any(re.finditer("(^| )[/-]GL($| )", tools.get_env("CFLAGS", ""))) else "false",
92             }
93             msbuild = MSBuild(self)
94             build_type = "Debug" if self.settings.build_type == "Debug" else "Release"
95             msbuild.build(solution_file, platforms=platforms, upgrade_project=False, properties=properties, build_type=build_type)
96 
97     def _configure_autotools(self):
98         if not self._autotools:
99             self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
100             configure_args = ["--enable-shared" if self.options.shared else "--disable-shared"]
101             configure_args.append("--enable-static" if not self.options.shared else "--disable-static")
102             if self.settings.os in ["Linux", "Android"]:
103                 configure_args.append("--enable-udev" if self.options.enable_udev else "--disable-udev")
104             elif self._is_mingw:
105                 if self.settings.arch == "x86_64":
106                     configure_args.append("--host=x86_64-w64-mingw32")
107                 elif self.settings.arch == "x86":
108                     configure_args.append("--build=i686-w64-mingw32")
109                     configure_args.append("--host=i686-w64-mingw32")
110             self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)
111         return self._autotools
112 
113     def build(self):
114         if self._is_msvc:
115             if tools.Version(self.version) < "1.0.24":
116                 for vcxproj in ["fxload_2017", "getopt_2017", "hotplugtest_2017", "libusb_dll_2017",
117                                 "libusb_static_2017", "listdevs_2017", "stress_2017", "testlibusb_2017", "xusb_2017"]:
118                     vcxproj_path = os.path.join(self._source_subfolder, "msvc", "%s.vcxproj" % vcxproj)
119                     tools.replace_in_file(vcxproj_path, "<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>", "")
120             self._build_visual_studio()
121         else:
122             autotools = self._configure_autotools()
123             autotools.make()
124 
125     def _package_visual_studio(self):
126         self.copy(pattern="libusb.h", dst=os.path.join("include", "libusb-1.0"), src=os.path.join(self._source_subfolder, "libusb"), keep_path=False)
127         arch = "x64" if self.settings.arch == "x86_64" else "Win32"
128         source_dir = os.path.join(self._source_subfolder, arch, str(self.settings.build_type), "dll" if self.options.shared else "lib")
129         if self.options.shared:
130             self.copy(pattern="libusb-1.0.dll", dst="bin", src=source_dir, keep_path=False)
131             self.copy(pattern="libusb-1.0.lib", dst="lib", src=source_dir, keep_path=False)
132             self.copy(pattern="libusb-usbdk-1.0.dll", dst="bin", src=source_dir, keep_path=False)
133             self.copy(pattern="libusb-usbdk-1.0.lib", dst="lib", src=source_dir, keep_path=False)
134         else:
135             self.copy(pattern="libusb-1.0.lib", dst="lib", src=source_dir, keep_path=False)
136             self.copy(pattern="libusb-usbdk-1.0.lib", dst="lib", src=source_dir, keep_path=False)
137 
138     def package(self):
139         self.copy("COPYING", src=self._source_subfolder, dst="licenses", keep_path=False)
140         if self._is_msvc:
141             self._package_visual_studio()
142         else:
143             autotools = self._configure_autotools()
144             autotools.install()
145             tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
146             tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.la")
147 
148     def package_info(self):
149         self.cpp_info.names["pkg_config"] = "libusb-1.0"
150         self.cpp_info.libs = tools.collect_libs(self)
151         self.cpp_info.includedirs.append(os.path.join("include", "libusb-1.0"))
152         if self.settings.os in ["Linux", "FreeBSD"]:
153             self.cpp_info.system_libs.append("pthread")
154         elif self.settings.os == "Macos":
155             self.cpp_info.system_libs = ["objc"]
156             self.cpp_info.frameworks = ["IOKit", "CoreFoundation"]
157         elif self.settings.os == "Windows":
158             self.cpp_info.system_libs = ["advapi32"]
159
```
--- 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/libusb/all/conanfile.py b/recipes/libusb/all/conanfile.py
--- a/recipes/libusb/all/conanfile.py
+++ b/recipes/libusb/all/conanfile.py
@@ -1,5 +1,4 @@
 from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
-from conans.errors import ConanInvalidConfiguration
 import os
 import re
 
@@ -153,6 +152,6 @@
             self.cpp_info.system_libs.append("pthread")
         elif self.settings.os == "Macos":
             self.cpp_info.system_libs = ["objc"]
-            self.cpp_info.frameworks = ["IOKit", "CoreFoundation"]
+            self.cpp_info.frameworks = ["IOKit", "CoreFoundation", "Security"]
         elif self.settings.os == "Windows":
             self.cpp_info.system_libs = ["advapi32"]

{"golden_diff": "diff --git a/recipes/libusb/all/conanfile.py b/recipes/libusb/all/conanfile.py\n--- a/recipes/libusb/all/conanfile.py\n+++ b/recipes/libusb/all/conanfile.py\n@@ -1,5 +1,4 @@\n from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools\n-from conans.errors import ConanInvalidConfiguration\n import os\n import re\n \n@@ -153,6 +152,6 @@\n             self.cpp_info.system_libs.append(\"pthread\")\n         elif self.settings.os == \"Macos\":\n             self.cpp_info.system_libs = [\"objc\"]\n-            self.cpp_info.frameworks = [\"IOKit\", \"CoreFoundation\"]\n+            self.cpp_info.frameworks = [\"IOKit\", \"CoreFoundation\", \"Security\"]\n         elif self.settings.os == \"Windows\":\n             self.cpp_info.system_libs = [\"advapi32\"]\n", "issue": "[request] libusb/1.0.25\n### Package Details\r\n  * Package Name/Version: **libusb/1.0.25**\r\n  * Changelog: **https://github.com/libusb/libusb/blob/master/ChangeLog**\r\n\r\n\r\n2022-01-31: v1.0.25\r\n* Linux: Fix regression with some particular devices\r\n* Linux: Fix regression with libusb_handle_events_timeout_completed()\r\n* Linux: Fix regression with cpu usage in libusb_bulk_transfer\r\n* Darwin (macOS): Add support for detaching kernel drivers with authorization.\r\n* Darwin (macOS): Do not drop partial data on timeout.\r\n* Darwin (macOS): Silence pipe error in set_interface_alt_setting().\r\n* Windows: Fix HID backend missing byte\r\n* Windows: Fix segfault with libusbk driver\r\n* Windows: Fix regression when using libusb0 driver\r\n* Windows: Support LIBUSB_TRANSFER_ADD_ZERO_PACKET on winusb\r\n* New NO_DEVICE_DISCOVERY option replaces WEAK_AUTHORITY option\r\n* Various other bug fixes and improvements\r\n\r\nPR follows\n", "before_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport re\n\nrequired_conan_version = \">=1.33.0\"\n\n\nclass LibUSBConan(ConanFile):\n    name = \"libusb\"\n    description = \"A cross-platform library to access USB devices\"\n    license = \"LGPL-2.1\"\n    homepage = \"https://github.com/libusb/libusb\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    topics = (\"conan\", \"libusb\", \"usb\", \"device\")\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_udev\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_udev\": True,\n    }\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _is_mingw(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\"\n\n    @property\n    def _is_msvc(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\"\n\n    @property\n    def _settings_build(self):\n        return self.settings_build if hasattr(self, \"settings_build\") else self.settings\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        if self.settings.os not in [\"Linux\", \"Android\"]:\n            del self.options.enable_udev\n        # FIXME: enable_udev should be True for Android, but libudev recipe is missing\n        if self.settings.os == \"Android\":\n            self.options.enable_udev = False\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\" and not self._is_msvc and not tools.get_env(\"CONAN_BASH_PATH\"):\n            self.build_requires(\"msys2/cci.latest\")\n\n    def requirements(self):\n        if self.settings.os == \"Linux\":\n            if self.options.enable_udev:\n                self.requires(\"libudev/system\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    def _build_visual_studio(self):\n        with tools.chdir(self._source_subfolder):\n            # Assume we're using the latest Visual Studio and default to libusb_2019.sln\n            # (or libusb_2017.sln for libusb < 1.0.24).\n            # If we're not using the latest Visual Studio, select an appropriate solution file.\n            solution_msvc_year = 2019 if tools.Version(self.version) >= \"1.0.24\" else 2017\n\n            solution_msvc_year = {\n                \"11\": 2012,\n                \"12\": 2013,\n                \"14\": 2015,\n                \"15\": 2017\n            }.get(str(self.settings.compiler.version), solution_msvc_year)\n\n            solution_file = os.path.join(\"msvc\", \"libusb_{}.sln\".format(solution_msvc_year))\n            platforms = {\"x86\":\"Win32\"}\n            properties = {\n                # Enable LTO when CFLAGS contains -GL\n                \"WholeProgramOptimization\": \"true\" if any(re.finditer(\"(^| )[/-]GL($| )\", tools.get_env(\"CFLAGS\", \"\"))) else \"false\",\n            }\n            msbuild = MSBuild(self)\n            build_type = \"Debug\" if self.settings.build_type == \"Debug\" else \"Release\"\n            msbuild.build(solution_file, platforms=platforms, upgrade_project=False, properties=properties, build_type=build_type)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n            configure_args = [\"--enable-shared\" if self.options.shared else \"--disable-shared\"]\n            configure_args.append(\"--enable-static\" if not self.options.shared else \"--disable-static\")\n            if self.settings.os in [\"Linux\", \"Android\"]:\n                configure_args.append(\"--enable-udev\" if self.options.enable_udev else \"--disable-udev\")\n            elif self._is_mingw:\n                if self.settings.arch == \"x86_64\":\n                    configure_args.append(\"--host=x86_64-w64-mingw32\")\n                elif self.settings.arch == \"x86\":\n                    configure_args.append(\"--build=i686-w64-mingw32\")\n                    configure_args.append(\"--host=i686-w64-mingw32\")\n            self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    def build(self):\n        if self._is_msvc:\n            if tools.Version(self.version) < \"1.0.24\":\n                for vcxproj in [\"fxload_2017\", \"getopt_2017\", \"hotplugtest_2017\", \"libusb_dll_2017\",\n                                \"libusb_static_2017\", \"listdevs_2017\", \"stress_2017\", \"testlibusb_2017\", \"xusb_2017\"]:\n                    vcxproj_path = os.path.join(self._source_subfolder, \"msvc\", \"%s.vcxproj\" % vcxproj)\n                    tools.replace_in_file(vcxproj_path, \"<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\", \"\")\n            self._build_visual_studio()\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    def _package_visual_studio(self):\n        self.copy(pattern=\"libusb.h\", dst=os.path.join(\"include\", \"libusb-1.0\"), src=os.path.join(self._source_subfolder, \"libusb\"), keep_path=False)\n        arch = \"x64\" if self.settings.arch == \"x86_64\" else \"Win32\"\n        source_dir = os.path.join(self._source_subfolder, arch, str(self.settings.build_type), \"dll\" if self.options.shared else \"lib\")\n        if self.options.shared:\n            self.copy(pattern=\"libusb-1.0.dll\", dst=\"bin\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.dll\", dst=\"bin\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n        else:\n            self.copy(pattern=\"libusb-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\", keep_path=False)\n        if self._is_msvc:\n            self._package_visual_studio()\n        else:\n            autotools = self._configure_autotools()\n            autotools.install()\n            tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n            tools.remove_files_by_mask(os.path.join(self.package_folder, \"lib\"), \"*.la\")\n\n    def package_info(self):\n        self.cpp_info.names[\"pkg_config\"] = \"libusb-1.0\"\n        self.cpp_info.libs = tools.collect_libs(self)\n        self.cpp_info.includedirs.append(os.path.join(\"include\", \"libusb-1.0\"))\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.system_libs.append(\"pthread\")\n        elif self.settings.os == \"Macos\":\n            self.cpp_info.system_libs = [\"objc\"]\n            self.cpp_info.frameworks = [\"IOKit\", \"CoreFoundation\"]\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.system_libs = [\"advapi32\"]\n", "path": "recipes/libusb/all/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools\nimport os\nimport re\n\nrequired_conan_version = \">=1.33.0\"\n\n\nclass LibUSBConan(ConanFile):\n    name = \"libusb\"\n    description = \"A cross-platform library to access USB devices\"\n    license = \"LGPL-2.1\"\n    homepage = \"https://github.com/libusb/libusb\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    topics = (\"conan\", \"libusb\", \"usb\", \"device\")\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_udev\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_udev\": True,\n    }\n    _autotools = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _is_mingw(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\"\n\n    @property\n    def _is_msvc(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\"\n\n    @property\n    def _settings_build(self):\n        return self.settings_build if hasattr(self, \"settings_build\") else self.settings\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n        if self.settings.os not in [\"Linux\", \"Android\"]:\n            del self.options.enable_udev\n        # FIXME: enable_udev should be True for Android, but libudev recipe is missing\n        if self.settings.os == \"Android\":\n            self.options.enable_udev = False\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\" and not self._is_msvc and not tools.get_env(\"CONAN_BASH_PATH\"):\n            self.build_requires(\"msys2/cci.latest\")\n\n    def requirements(self):\n        if self.settings.os == \"Linux\":\n            if self.options.enable_udev:\n                self.requires(\"libudev/system\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    def _build_visual_studio(self):\n        with tools.chdir(self._source_subfolder):\n            # Assume we're using the latest Visual Studio and default to libusb_2019.sln\n            # (or libusb_2017.sln for libusb < 1.0.24).\n            # If we're not using the latest Visual Studio, select an appropriate solution file.\n            solution_msvc_year = 2019 if tools.Version(self.version) >= \"1.0.24\" else 2017\n\n            solution_msvc_year = {\n                \"11\": 2012,\n                \"12\": 2013,\n                \"14\": 2015,\n                \"15\": 2017\n            }.get(str(self.settings.compiler.version), solution_msvc_year)\n\n            solution_file = os.path.join(\"msvc\", \"libusb_{}.sln\".format(solution_msvc_year))\n            platforms = {\"x86\":\"Win32\"}\n            properties = {\n                # Enable LTO when CFLAGS contains -GL\n                \"WholeProgramOptimization\": \"true\" if any(re.finditer(\"(^| )[/-]GL($| )\", tools.get_env(\"CFLAGS\", \"\"))) else \"false\",\n            }\n            msbuild = MSBuild(self)\n            build_type = \"Debug\" if self.settings.build_type == \"Debug\" else \"Release\"\n            msbuild.build(solution_file, platforms=platforms, upgrade_project=False, properties=properties, build_type=build_type)\n\n    def _configure_autotools(self):\n        if not self._autotools:\n            self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n            configure_args = [\"--enable-shared\" if self.options.shared else \"--disable-shared\"]\n            configure_args.append(\"--enable-static\" if not self.options.shared else \"--disable-static\")\n            if self.settings.os in [\"Linux\", \"Android\"]:\n                configure_args.append(\"--enable-udev\" if self.options.enable_udev else \"--disable-udev\")\n            elif self._is_mingw:\n                if self.settings.arch == \"x86_64\":\n                    configure_args.append(\"--host=x86_64-w64-mingw32\")\n                elif self.settings.arch == \"x86\":\n                    configure_args.append(\"--build=i686-w64-mingw32\")\n                    configure_args.append(\"--host=i686-w64-mingw32\")\n            self._autotools.configure(args=configure_args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    def build(self):\n        if self._is_msvc:\n            if tools.Version(self.version) < \"1.0.24\":\n                for vcxproj in [\"fxload_2017\", \"getopt_2017\", \"hotplugtest_2017\", \"libusb_dll_2017\",\n                                \"libusb_static_2017\", \"listdevs_2017\", \"stress_2017\", \"testlibusb_2017\", \"xusb_2017\"]:\n                    vcxproj_path = os.path.join(self._source_subfolder, \"msvc\", \"%s.vcxproj\" % vcxproj)\n                    tools.replace_in_file(vcxproj_path, \"<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\", \"\")\n            self._build_visual_studio()\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    def _package_visual_studio(self):\n        self.copy(pattern=\"libusb.h\", dst=os.path.join(\"include\", \"libusb-1.0\"), src=os.path.join(self._source_subfolder, \"libusb\"), keep_path=False)\n        arch = \"x64\" if self.settings.arch == \"x86_64\" else \"Win32\"\n        source_dir = os.path.join(self._source_subfolder, arch, str(self.settings.build_type), \"dll\" if self.options.shared else \"lib\")\n        if self.options.shared:\n            self.copy(pattern=\"libusb-1.0.dll\", dst=\"bin\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.dll\", dst=\"bin\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n        else:\n            self.copy(pattern=\"libusb-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n            self.copy(pattern=\"libusb-usbdk-1.0.lib\", dst=\"lib\", src=source_dir, keep_path=False)\n\n    def package(self):\n        self.copy(\"COPYING\", src=self._source_subfolder, dst=\"licenses\", keep_path=False)\n        if self._is_msvc:\n            self._package_visual_studio()\n        else:\n            autotools = self._configure_autotools()\n            autotools.install()\n            tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n            tools.remove_files_by_mask(os.path.join(self.package_folder, \"lib\"), \"*.la\")\n\n    def package_info(self):\n        self.cpp_info.names[\"pkg_config\"] = \"libusb-1.0\"\n        self.cpp_info.libs = tools.collect_libs(self)\n        self.cpp_info.includedirs.append(os.path.join(\"include\", \"libusb-1.0\"))\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.system_libs.append(\"pthread\")\n        elif self.settings.os == \"Macos\":\n            self.cpp_info.system_libs = [\"objc\"]\n            self.cpp_info.frameworks = [\"IOKit\", \"CoreFoundation\", \"Security\"]\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.system_libs = [\"advapi32\"]\n", "path": "recipes/libusb/all/conanfile.py"}]}