prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [package] date/2.4.1: header_only option
  Please add a header_only option to 'date' recipe.
  
  </issue>
  <code>
  [start of recipes/date/all/conanfile.py]
  1 import os
  2 from conans import ConanFile, CMake, tools
  3 
  4 
  5 class DateConan(ConanFile):
  6     name = "date"
  7     url = "https://github.com/conan-io/conan-center-index"
  8     homepage = "https://github.com/HowardHinnant/date"
  9     description = "A date and time library based on the C++11/14/17 <chrono> header"
  10     topics = ("date", "datetime", "timezone",
  11               "calendar", "time", "iana-database")
  12     license = "MIT"
  13     exports_sources = ["patches/*", "CMakeLists.txt"]
  14     settings = "os", "arch", "compiler", "build_type"
  15     generators = "cmake",
  16     options = {"shared": [True, False],
  17                "fPIC": [True, False],
  18                "use_system_tz_db": [True, False],
  19                "use_tz_db_in_dot": [True, False]}
  20     default_options = {"shared": False,
  21                        "fPIC": True,
  22                        "use_system_tz_db": False,
  23                        "use_tz_db_in_dot": False}
  24 
  25     _cmake = None
  26 
  27     @property
  28     def _source_subfolder(self):
  29         return "source_subfolder"
  30     @property
  31     def _build_subfolder(self):
  32         return "build_subfolder"
  33 
  34     def _configure_cmake(self):
  35         if self._cmake:
  36             return self._cmake
  37         cmake = CMake(self)
  38         cmake.definitions["ENABLE_DATE_TESTING"] = False
  39         cmake.definitions["USE_SYSTEM_TZ_DB"] = self.options.use_system_tz_db
  40         cmake.definitions["USE_TZ_DB_IN_DOT"] = self.options.use_tz_db_in_dot
  41         cmake.configure()
  42 
  43         self._cmake = cmake
  44         return self._cmake
  45 
  46     def config_options(self):
  47         if self.settings.os == "Windows":
  48             del self.options.fPIC
  49 
  50     def configure(self):
  51         if self.settings.compiler.cppstd:
  52             tools.check_min_cppstd(self, "11")
  53 
  54     def requirements(self):
  55         if not self.options.use_system_tz_db:
  56             self.requires("libcurl/7.69.1")
  57 
  58     def source(self):
  59         tools.get(**self.conan_data["sources"][self.version])
  60         extracted_dir = self.name + "-" + self.version
  61         os.rename(extracted_dir, self._source_subfolder)
  62 
  63     def build(self):
  64         for patch in self.conan_data["patches"][self.version]:
  65             tools.patch(**patch)
  66         cmake = self._configure_cmake()
  67         cmake.build()
  68 
  69     def package(self):
  70         self.copy(pattern="LICENSE.txt", dst="licenses",
  71                   src=self._source_subfolder)
  72         cmake = self._configure_cmake()
  73         cmake.install()
  74         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
  75         tools.rmdir(os.path.join(self.package_folder, "CMake"))
  76 
  77     def package_info(self):
  78         self.cpp_info.libs = tools.collect_libs(self)
  79         if self.settings.os == "Linux":
  80             self.cpp_info.system_libs.append("pthread")
  81 
  82         if self.options.use_system_tz_db and not self.settings.os == "Windows":
  83             use_os_tzdb = 1
  84         else:
  85             use_os_tzdb = 0
  86 
  87         defines = ["USE_OS_TZDB={}".format(use_os_tzdb)]
  88         if self.settings.os == "Windows" and self.options.shared:
  89             defines.append("DATE_USE_DLL=1")
  90 
  91         self.cpp_info.defines.extend(defines)
  92
  [end of recipes/date/all/conanfile.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py
  --- a/recipes/date/all/conanfile.py
  +++ b/recipes/date/all/conanfile.py
  @@ -15,10 +15,12 @@
       generators = "cmake",
       options = {"shared": [True, False],
                  "fPIC": [True, False],
  +               "header_only": [True, False],
                  "use_system_tz_db": [True, False],
                  "use_tz_db_in_dot": [True, False]}
       default_options = {"shared": False,
                          "fPIC": True,
  +                       "header_only": False,
                          "use_system_tz_db": False,
                          "use_tz_db_in_dot": False}
   
  @@ -52,6 +54,8 @@
               tools.check_min_cppstd(self, "11")
   
       def requirements(self):
  +        if self.options.header_only:
  +            return
           if not self.options.use_system_tz_db:
               self.requires("libcurl/7.69.1")
   
  @@ -63,18 +67,34 @@
       def build(self):
           for patch in self.conan_data["patches"][self.version]:
               tools.patch(**patch)
  +        if self.options.header_only:
  +            self.output.info("Header only package, skipping build")
  +            return
           cmake = self._configure_cmake()
           cmake.build()
   
       def package(self):
           self.copy(pattern="LICENSE.txt", dst="licenses",
                     src=self._source_subfolder)
  +        if self.options.header_only:
  +            src = os.path.join(self._source_subfolder, "include", "date")
  +            dst = os.path.join("include", "date")
  +            self.copy(pattern="date.h", dst=dst, src=src)
  +            self.copy(pattern="tz.h", dst=dst, src=src)
  +            self.copy(pattern="iso_week.h", dst=dst, src=src)
  +            self.copy(pattern="julian.h", dst=dst, src=src)
  +            self.copy(pattern="islamic.h", dst=dst, src=src)
  +            return
  +
           cmake = self._configure_cmake()
           cmake.install()
           tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
           tools.rmdir(os.path.join(self.package_folder, "CMake"))
   
       def package_info(self):
  +        if self.options.header_only:
  +            return
  +
           self.cpp_info.libs = tools.collect_libs(self)
           if self.settings.os == "Linux":
               self.cpp_info.system_libs.append("pthread")
  @@ -89,3 +109,7 @@
               defines.append("DATE_USE_DLL=1")
   
           self.cpp_info.defines.extend(defines)
  +
  +    def package_id(self):
  +        if self.options.header_only:
  +            self.info.header_only()
  
verification_info: {"golden_diff": "diff --git a/recipes/date/all/conanfile.py b/recipes/date/all/conanfile.py\n--- a/recipes/date/all/conanfile.py\n+++ b/recipes/date/all/conanfile.py\n@@ -15,10 +15,12 @@\n     generators = \"cmake\",\n     options = {\"shared\": [True, False],\n                \"fPIC\": [True, False],\n+               \"header_only\": [True, False],\n                \"use_system_tz_db\": [True, False],\n                \"use_tz_db_in_dot\": [True, False]}\n     default_options = {\"shared\": False,\n                        \"fPIC\": True,\n+                       \"header_only\": False,\n                        \"use_system_tz_db\": False,\n                        \"use_tz_db_in_dot\": False}\n \n@@ -52,6 +54,8 @@\n             tools.check_min_cppstd(self, \"11\")\n \n     def requirements(self):\n+        if self.options.header_only:\n+            return\n         if not self.options.use_system_tz_db:\n             self.requires(\"libcurl/7.69.1\")\n \n@@ -63,18 +67,34 @@\n     def build(self):\n         for patch in self.conan_data[\"patches\"][self.version]:\n             tools.patch(**patch)\n+        if self.options.header_only:\n+            self.output.info(\"Header only package, skipping build\")\n+            return\n         cmake = self._configure_cmake()\n         cmake.build()\n \n     def package(self):\n         self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\",\n                   src=self._source_subfolder)\n+        if self.options.header_only:\n+            src = os.path.join(self._source_subfolder, \"include\", \"date\")\n+            dst = os.path.join(\"include\", \"date\")\n+            self.copy(pattern=\"date.h\", dst=dst, src=src)\n+            self.copy(pattern=\"tz.h\", dst=dst, src=src)\n+            self.copy(pattern=\"iso_week.h\", dst=dst, src=src)\n+            self.copy(pattern=\"julian.h\", dst=dst, src=src)\n+            self.copy(pattern=\"islamic.h\", dst=dst, src=src)\n+            return\n+\n         cmake = self._configure_cmake()\n         cmake.install()\n         tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n         tools.rmdir(os.path.join(self.package_folder, \"CMake\"))\n \n     def package_info(self):\n+        if self.options.header_only:\n+            return\n+\n         self.cpp_info.libs = tools.collect_libs(self)\n         if self.settings.os == \"Linux\":\n             self.cpp_info.system_libs.append(\"pthread\")\n@@ -89,3 +109,7 @@\n             defines.append(\"DATE_USE_DLL=1\")\n \n         self.cpp_info.defines.extend(defines)\n+\n+    def package_id(self):\n+        if self.options.header_only:\n+            self.info.header_only()\n", "issue": "[package] date/2.4.1: header_only option\nPlease add a header_only option to 'date' recipe.\n", "before_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\n\n\nclass DateConan(ConanFile):\n    name = \"date\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/HowardHinnant/date\"\n    description = \"A date and time library based on the C++11/14/17 <chrono> header\"\n    topics = (\"date\", \"datetime\", \"timezone\",\n              \"calendar\", \"time\", \"iana-database\")\n    license = \"MIT\"\n    exports_sources = [\"patches/*\", \"CMakeLists.txt\"]\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    generators = \"cmake\",\n    options = {\"shared\": [True, False],\n               \"fPIC\": [True, False],\n               \"use_system_tz_db\": [True, False],\n               \"use_tz_db_in_dot\": [True, False]}\n    default_options = {\"shared\": False,\n                       \"fPIC\": True,\n                       \"use_system_tz_db\": False,\n                       \"use_tz_db_in_dot\": False}\n\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n    @property\n    def _build_subfolder(self):\n        return \"build_subfolder\"\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        cmake = CMake(self)\n        cmake.definitions[\"ENABLE_DATE_TESTING\"] = False\n        cmake.definitions[\"USE_SYSTEM_TZ_DB\"] = self.options.use_system_tz_db\n        cmake.definitions[\"USE_TZ_DB_IN_DOT\"] = self.options.use_tz_db_in_dot\n        cmake.configure()\n\n        self._cmake = cmake\n        return self._cmake\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.settings.compiler.cppstd:\n            tools.check_min_cppstd(self, \"11\")\n\n    def requirements(self):\n        if not self.options.use_system_tz_db:\n            self.requires(\"libcurl/7.69.1\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def build(self):\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE.txt\", dst=\"licenses\",\n                  src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"CMake\"))\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.append(\"pthread\")\n\n        if self.options.use_system_tz_db and not self.settings.os == \"Windows\":\n            use_os_tzdb = 1\n        else:\n            use_os_tzdb = 0\n\n        defines = [\"USE_OS_TZDB={}\".format(use_os_tzdb)]\n        if self.settings.os == \"Windows\" and self.options.shared:\n            defines.append(\"DATE_USE_DLL=1\")\n\n        self.cpp_info.defines.extend(defines)\n", "path": "recipes/date/all/conanfile.py"}]}