prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [request] zstd/1.4.5
  ### Package Details
    * Package Name/Version: **zstd/1.4.5**
    * Changelog: **https://github.com/facebook/zstd/releases/tag/v1.4.5**
  
  
  The above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.
  
  
  </issue>
  <code>
  [start of recipes/zstd/all/conanfile.py]
  1 import os
  2 from conans import ConanFile, CMake, tools
  3 
  4 
  5 class ZstdConan(ConanFile):
  6     name = "zstd"
  7     url = "https://github.com/conan-io/conan-center-index"
  8     homepage = "https://github.com/facebook/zstd"
  9     description = "Zstandard - Fast real-time compression algorithm"
  10     topics = ("conan", "zstd", "compression", "algorithm", "decoder")
  11     license = "BSD-3-Clause"
  12     exports_sources = ['CMakeLists.txt']
  13     generators = 'cmake'
  14     settings = "os", "arch", "compiler", "build_type"
  15     options = {"shared": [True, False], "fPIC": [True, False]}
  16     default_options = {"shared": False, "fPIC": True}
  17 
  18     @property
  19     def _source_subfolder(self):
  20         return "source_subfolder"
  21 
  22     def source(self):
  23         tools.get(**self.conan_data["sources"][self.version])
  24         extracted_dir = self.name + "-" + self.version
  25         os.rename(extracted_dir, self._source_subfolder)
  26 
  27     def config_options(self):
  28         if self.settings.os == "Windows":
  29             del self.options.fPIC
  30 
  31     def configure(self):
  32         del self.settings.compiler.libcxx
  33         del self.settings.compiler.cppstd
  34 
  35     def _configure_cmake(self):
  36         cmake = CMake(self)
  37         cmake.definitions["ZSTD_BUILD_PROGRAMS"] = False
  38         cmake.definitions["ZSTD_BUILD_STATIC"] = not self.options.shared
  39         cmake.definitions["ZSTD_BUILD_SHARED"] = self.options.shared
  40         cmake.configure()
  41         return cmake
  42 
  43     def build(self):
  44         cmake = self._configure_cmake()
  45         cmake.build()
  46 
  47     def package(self):
  48         self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
  49         cmake = self._configure_cmake()
  50         cmake.install()
  51         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
  52 
  53     def package_info(self):
  54         self.cpp_info.libs = tools.collect_libs(self)
  55         if self.settings.os == "Linux":
  56             self.cpp_info.system_libs.append("pthread")
  57
  [end of recipes/zstd/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/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py
  --- a/recipes/zstd/all/conanfile.py
  +++ b/recipes/zstd/all/conanfile.py
  @@ -9,7 +9,7 @@
       description = "Zstandard - Fast real-time compression algorithm"
       topics = ("conan", "zstd", "compression", "algorithm", "decoder")
       license = "BSD-3-Clause"
  -    exports_sources = ['CMakeLists.txt']
  +    exports_sources = ['CMakeLists.txt', "patches/**"]
       generators = 'cmake'
       settings = "os", "arch", "compiler", "build_type"
       options = {"shared": [True, False], "fPIC": [True, False]}
  @@ -40,7 +40,12 @@
           cmake.configure()
           return cmake
   
  +    def _patch_sources(self):
  +        for patch in self.conan_data.get("patches", {}).get(self.version, []):
  +            tools.patch(**patch)
  +
       def build(self):
  +        self._patch_sources()
           cmake = self._configure_cmake()
           cmake.build()
   
  @@ -48,6 +53,7 @@
           self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
           cmake = self._configure_cmake()
           cmake.install()
  +        tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
           tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
   
       def package_info(self):
  
verification_info: {"golden_diff": "diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py\n--- a/recipes/zstd/all/conanfile.py\n+++ b/recipes/zstd/all/conanfile.py\n@@ -9,7 +9,7 @@\n     description = \"Zstandard - Fast real-time compression algorithm\"\n     topics = (\"conan\", \"zstd\", \"compression\", \"algorithm\", \"decoder\")\n     license = \"BSD-3-Clause\"\n-    exports_sources = ['CMakeLists.txt']\n+    exports_sources = ['CMakeLists.txt', \"patches/**\"]\n     generators = 'cmake'\n     settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n     options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n@@ -40,7 +40,12 @@\n         cmake.configure()\n         return cmake\n \n+    def _patch_sources(self):\n+        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n+            tools.patch(**patch)\n+\n     def build(self):\n+        self._patch_sources()\n         cmake = self._configure_cmake()\n         cmake.build()\n \n@@ -48,6 +53,7 @@\n         self.copy(pattern=\"LICENSE\", dst=\"licenses\", 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, \"lib\", \"pkgconfig\"))\n \n     def package_info(self):\n", "issue": "[request] zstd/1.4.5\n### Package Details\r\n  * Package Name/Version: **zstd/1.4.5**\r\n  * Changelog: **https://github.com/facebook/zstd/releases/tag/v1.4.5**\r\n\r\n\r\nThe above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.\r\n\n", "before_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\n\n\nclass ZstdConan(ConanFile):\n    name = \"zstd\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/facebook/zstd\"\n    description = \"Zstandard - Fast real-time compression algorithm\"\n    topics = (\"conan\", \"zstd\", \"compression\", \"algorithm\", \"decoder\")\n    license = \"BSD-3-Clause\"\n    exports_sources = ['CMakeLists.txt']\n    generators = 'cmake'\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True}\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\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 config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def _configure_cmake(self):\n        cmake = CMake(self)\n        cmake.definitions[\"ZSTD_BUILD_PROGRAMS\"] = False\n        cmake.definitions[\"ZSTD_BUILD_STATIC\"] = not self.options.shared\n        cmake.definitions[\"ZSTD_BUILD_SHARED\"] = self.options.shared\n        cmake.configure()\n        return cmake\n\n    def build(self):\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\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", "path": "recipes/zstd/all/conanfile.py"}]}