We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] cgal/all: review options applied
Comming from https://github.com/conan-io/conan-center-index/pull/965#issuecomment-590802910

Seems that the recipe might require some work regarding the options and flags

--- 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/cgal/all/conanfile.py`
Content:
```
1 import os
2 from conans import ConanFile, CMake, tools
3 
4 
5 class CgalConan(ConanFile):
6     name = "cgal"
7     license = "LGPL-3.0-or-later"
8     url = "https://github.com/conan-io/conan-center-index"
9     homepage = "https://github.com/CGAL/cgal"
10     description = "C++ library that aims to provide easy access to efficient and reliable algorithms"\
11                   "in computational geometry."
12     topics = ("geometry", "algorithms")
13     settings = "os", "compiler", "build_type", "arch"
14     requires = "mpir/3.0.0", "mpfr/4.0.2", "boost/1.72.0", "eigen/3.3.7"
15     generators = "cmake"
16 
17     _source_subfolder = "source_subfolder"
18     _cmake = None
19 
20     options = {
21         "with_cgal_core": [True, False],
22         "with_cgal_qt5": [True, False],
23         "with_cgal_imageio": [True, False]
24     }
25 
26     default_options = {
27         "with_cgal_core": True,
28         "with_cgal_qt5": False,
29         "with_cgal_imageio": True
30     }
31 
32     def _configure_cmake(self):
33         if not self._cmake:
34             self._cmake = CMake(self)
35             self._cmake.definitions["WITH_CGAL_Core"] = self.options.with_cgal_core
36             self._cmake.definitions["WITH_CGAL_Qt5"] = self.options.with_cgal_qt5
37             self._cmake.definitions["WITH_CGAL_ImageIO"] = self.options.with_cgal_imageio
38             self._cmake.configure(source_folder=self._source_subfolder)
39         return self._cmake
40 
41     def _patch_sources(self):
42         tools.replace_in_file(
43             os.path.join(self._source_subfolder, "CMakeLists.txt"),
44             "project(CGAL CXX C)", '''project(CGAL CXX C)
45 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
46 conan_basic_setup()''')
47 
48     def source(self):
49         tools.get(**self.conan_data["sources"][self.version])
50         extracted_dir = "CGAL-{}".format(self.version)
51         os.rename(extracted_dir, self._source_subfolder)
52 
53     def build(self):
54         self._patch_sources()
55         cmake = self._configure_cmake()
56         cmake.build()
57 
58     def package(self):
59         self.copy("LICENSE*", dst="licenses", src=self._source_subfolder)
60         cmake = self._configure_cmake()
61         cmake.install()
62         tools.rmdir(os.path.join(self.package_folder, "share"))
63         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
64         tools.rmdir(os.path.join(self.package_folder, "bin"))
65 
66     def package_info(self):
67         self.cpp_info.names["cmake_find_package"] = "CGAL"
68         self.cpp_info.names["cmake_find_package_multi"] = "CGAL"
69 
70     def package_id(self):
71         self.info.header_only()
72
```
--- 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/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py
--- a/recipes/cgal/all/conanfile.py
+++ b/recipes/cgal/all/conanfile.py
@@ -1,5 +1,6 @@
 import os
 from conans import ConanFile, CMake, tools
+from conans.errors import ConanInvalidConfiguration
 
 
 class CgalConan(ConanFile):
@@ -13,20 +14,26 @@
     settings = "os", "compiler", "build_type", "arch"
     requires = "mpir/3.0.0", "mpfr/4.0.2", "boost/1.72.0", "eigen/3.3.7"
     generators = "cmake"
+    exports_sources = "CMakeLists.txt"
 
     _source_subfolder = "source_subfolder"
+    _build_subfolder = "build_subfolder"
     _cmake = None
 
     options = {
         "with_cgal_core": [True, False],
         "with_cgal_qt5": [True, False],
-        "with_cgal_imageio": [True, False]
+        "with_cgal_imageio": [True, False],
+        "shared": [True, False],
+        "header_only": [True, False]
     }
 
     default_options = {
         "with_cgal_core": True,
         "with_cgal_qt5": False,
-        "with_cgal_imageio": True
+        "with_cgal_imageio": True,
+        "shared": False,
+        "header_only": True
     }
 
     def _configure_cmake(self):
@@ -35,15 +42,19 @@
             self._cmake.definitions["WITH_CGAL_Core"] = self.options.with_cgal_core
             self._cmake.definitions["WITH_CGAL_Qt5"] = self.options.with_cgal_qt5
             self._cmake.definitions["WITH_CGAL_ImageIO"] = self.options.with_cgal_imageio
-            self._cmake.configure(source_folder=self._source_subfolder)
+            self._cmake.definitions["CGAL_HEADER_ONLY"] = self.options.header_only
+            self._cmake.configure(build_folder=self._build_subfolder)
         return self._cmake
 
     def _patch_sources(self):
-        tools.replace_in_file(
-            os.path.join(self._source_subfolder, "CMakeLists.txt"),
-            "project(CGAL CXX C)", '''project(CGAL CXX C)
-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-conan_basic_setup()''')
+        tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"),
+                              "CMAKE_SOURCE_DIR", "CMAKE_CURRENT_SOURCE_DIR")
+
+    def configure(self):
+        if self.options.with_cgal_qt5:
+            raise ConanInvalidConfiguration("Qt Conan package is not available yet.")
+        if self.options.header_only:
+            del self.options.shared
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
@@ -61,11 +72,20 @@
         cmake.install()
         tools.rmdir(os.path.join(self.package_folder, "share"))
         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
-        tools.rmdir(os.path.join(self.package_folder, "bin"))
+        if self.options.get_safe("shared"):
+            for root, _, filenames in os.walk(os.path.join(self.package_folder, "bin")):
+                for filename in filenames:
+                    if not filename.endswith(".dll"):
+                        os.unlink(os.path.join(root, filename))
+        else:
+            tools.rmdir(os.path.join(self.package_folder, "bin"))
 
     def package_info(self):
+        if not self.options.header_only:
+            self.cpp_info.libs = tools.collect_libs(self)
         self.cpp_info.names["cmake_find_package"] = "CGAL"
         self.cpp_info.names["cmake_find_package_multi"] = "CGAL"
 
     def package_id(self):
-        self.info.header_only()
+        if self.options.header_only:
+            self.info.header_only()

{"golden_diff": "diff --git a/recipes/cgal/all/conanfile.py b/recipes/cgal/all/conanfile.py\n--- a/recipes/cgal/all/conanfile.py\n+++ b/recipes/cgal/all/conanfile.py\n@@ -1,5 +1,6 @@\n import os\n from conans import ConanFile, CMake, tools\n+from conans.errors import ConanInvalidConfiguration\n \n \n class CgalConan(ConanFile):\n@@ -13,20 +14,26 @@\n     settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n     requires = \"mpir/3.0.0\", \"mpfr/4.0.2\", \"boost/1.72.0\", \"eigen/3.3.7\"\n     generators = \"cmake\"\n+    exports_sources = \"CMakeLists.txt\"\n \n     _source_subfolder = \"source_subfolder\"\n+    _build_subfolder = \"build_subfolder\"\n     _cmake = None\n \n     options = {\n         \"with_cgal_core\": [True, False],\n         \"with_cgal_qt5\": [True, False],\n-        \"with_cgal_imageio\": [True, False]\n+        \"with_cgal_imageio\": [True, False],\n+        \"shared\": [True, False],\n+        \"header_only\": [True, False]\n     }\n \n     default_options = {\n         \"with_cgal_core\": True,\n         \"with_cgal_qt5\": False,\n-        \"with_cgal_imageio\": True\n+        \"with_cgal_imageio\": True,\n+        \"shared\": False,\n+        \"header_only\": True\n     }\n \n     def _configure_cmake(self):\n@@ -35,15 +42,19 @@\n             self._cmake.definitions[\"WITH_CGAL_Core\"] = self.options.with_cgal_core\n             self._cmake.definitions[\"WITH_CGAL_Qt5\"] = self.options.with_cgal_qt5\n             self._cmake.definitions[\"WITH_CGAL_ImageIO\"] = self.options.with_cgal_imageio\n-            self._cmake.configure(source_folder=self._source_subfolder)\n+            self._cmake.definitions[\"CGAL_HEADER_ONLY\"] = self.options.header_only\n+            self._cmake.configure(build_folder=self._build_subfolder)\n         return self._cmake\n \n     def _patch_sources(self):\n-        tools.replace_in_file(\n-            os.path.join(self._source_subfolder, \"CMakeLists.txt\"),\n-            \"project(CGAL CXX C)\", '''project(CGAL CXX C)\n-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\n-conan_basic_setup()''')\n+        tools.replace_in_file(os.path.join(self._source_subfolder, \"CMakeLists.txt\"),\n+                              \"CMAKE_SOURCE_DIR\", \"CMAKE_CURRENT_SOURCE_DIR\")\n+\n+    def configure(self):\n+        if self.options.with_cgal_qt5:\n+            raise ConanInvalidConfiguration(\"Qt Conan package is not available yet.\")\n+        if self.options.header_only:\n+            del self.options.shared\n \n     def source(self):\n         tools.get(**self.conan_data[\"sources\"][self.version])\n@@ -61,11 +72,20 @@\n         cmake.install()\n         tools.rmdir(os.path.join(self.package_folder, \"share\"))\n         tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n-        tools.rmdir(os.path.join(self.package_folder, \"bin\"))\n+        if self.options.get_safe(\"shared\"):\n+            for root, _, filenames in os.walk(os.path.join(self.package_folder, \"bin\")):\n+                for filename in filenames:\n+                    if not filename.endswith(\".dll\"):\n+                        os.unlink(os.path.join(root, filename))\n+        else:\n+            tools.rmdir(os.path.join(self.package_folder, \"bin\"))\n \n     def package_info(self):\n+        if not self.options.header_only:\n+            self.cpp_info.libs = tools.collect_libs(self)\n         self.cpp_info.names[\"cmake_find_package\"] = \"CGAL\"\n         self.cpp_info.names[\"cmake_find_package_multi\"] = \"CGAL\"\n \n     def package_id(self):\n-        self.info.header_only()\n+        if self.options.header_only:\n+            self.info.header_only()\n", "issue": "[package] cgal/all: review options applied\nComming from https://github.com/conan-io/conan-center-index/pull/965#issuecomment-590802910\r\n\r\nSeems that the recipe might require some work regarding the options and flags\n", "before_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\n\n\nclass CgalConan(ConanFile):\n    name = \"cgal\"\n    license = \"LGPL-3.0-or-later\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/CGAL/cgal\"\n    description = \"C++ library that aims to provide easy access to efficient and reliable algorithms\"\\\n                  \"in computational geometry.\"\n    topics = (\"geometry\", \"algorithms\")\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    requires = \"mpir/3.0.0\", \"mpfr/4.0.2\", \"boost/1.72.0\", \"eigen/3.3.7\"\n    generators = \"cmake\"\n\n    _source_subfolder = \"source_subfolder\"\n    _cmake = None\n\n    options = {\n        \"with_cgal_core\": [True, False],\n        \"with_cgal_qt5\": [True, False],\n        \"with_cgal_imageio\": [True, False]\n    }\n\n    default_options = {\n        \"with_cgal_core\": True,\n        \"with_cgal_qt5\": False,\n        \"with_cgal_imageio\": True\n    }\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n            self._cmake.definitions[\"WITH_CGAL_Core\"] = self.options.with_cgal_core\n            self._cmake.definitions[\"WITH_CGAL_Qt5\"] = self.options.with_cgal_qt5\n            self._cmake.definitions[\"WITH_CGAL_ImageIO\"] = self.options.with_cgal_imageio\n            self._cmake.configure(source_folder=self._source_subfolder)\n        return self._cmake\n\n    def _patch_sources(self):\n        tools.replace_in_file(\n            os.path.join(self._source_subfolder, \"CMakeLists.txt\"),\n            \"project(CGAL CXX C)\", '''project(CGAL CXX C)\ninclude(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)\nconan_basic_setup()''')\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"CGAL-{}\".format(self.version)\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def build(self):\n        self._patch_sources()\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(\"LICENSE*\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"bin\"))\n\n    def package_info(self):\n        self.cpp_info.names[\"cmake_find_package\"] = \"CGAL\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"CGAL\"\n\n    def package_id(self):\n        self.info.header_only()\n", "path": "recipes/cgal/all/conanfile.py"}], "after_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\nfrom conans.errors import ConanInvalidConfiguration\n\n\nclass CgalConan(ConanFile):\n    name = \"cgal\"\n    license = \"LGPL-3.0-or-later\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/CGAL/cgal\"\n    description = \"C++ library that aims to provide easy access to efficient and reliable algorithms\"\\\n                  \"in computational geometry.\"\n    topics = (\"geometry\", \"algorithms\")\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    requires = \"mpir/3.0.0\", \"mpfr/4.0.2\", \"boost/1.72.0\", \"eigen/3.3.7\"\n    generators = \"cmake\"\n    exports_sources = \"CMakeLists.txt\"\n\n    _source_subfolder = \"source_subfolder\"\n    _build_subfolder = \"build_subfolder\"\n    _cmake = None\n\n    options = {\n        \"with_cgal_core\": [True, False],\n        \"with_cgal_qt5\": [True, False],\n        \"with_cgal_imageio\": [True, False],\n        \"shared\": [True, False],\n        \"header_only\": [True, False]\n    }\n\n    default_options = {\n        \"with_cgal_core\": True,\n        \"with_cgal_qt5\": False,\n        \"with_cgal_imageio\": True,\n        \"shared\": False,\n        \"header_only\": True\n    }\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n            self._cmake.definitions[\"WITH_CGAL_Core\"] = self.options.with_cgal_core\n            self._cmake.definitions[\"WITH_CGAL_Qt5\"] = self.options.with_cgal_qt5\n            self._cmake.definitions[\"WITH_CGAL_ImageIO\"] = self.options.with_cgal_imageio\n            self._cmake.definitions[\"CGAL_HEADER_ONLY\"] = self.options.header_only\n            self._cmake.configure(build_folder=self._build_subfolder)\n        return self._cmake\n\n    def _patch_sources(self):\n        tools.replace_in_file(os.path.join(self._source_subfolder, \"CMakeLists.txt\"),\n                              \"CMAKE_SOURCE_DIR\", \"CMAKE_CURRENT_SOURCE_DIR\")\n\n    def configure(self):\n        if self.options.with_cgal_qt5:\n            raise ConanInvalidConfiguration(\"Qt Conan package is not available yet.\")\n        if self.options.header_only:\n            del self.options.shared\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"CGAL-{}\".format(self.version)\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def build(self):\n        self._patch_sources()\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(\"LICENSE*\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"share\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        if self.options.get_safe(\"shared\"):\n            for root, _, filenames in os.walk(os.path.join(self.package_folder, \"bin\")):\n                for filename in filenames:\n                    if not filename.endswith(\".dll\"):\n                        os.unlink(os.path.join(root, filename))\n        else:\n            tools.rmdir(os.path.join(self.package_folder, \"bin\"))\n\n    def package_info(self):\n        if not self.options.header_only:\n            self.cpp_info.libs = tools.collect_libs(self)\n        self.cpp_info.names[\"cmake_find_package\"] = \"CGAL\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"CGAL\"\n\n    def package_id(self):\n        if self.options.header_only:\n            self.info.header_only()\n", "path": "recipes/cgal/all/conanfile.py"}]}