prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [package] xorg/system: Can you add support for dnf package manager?
  <!-- 
    Please don't forget to update the issue title.
    Include all applicable information to help us reproduce your problem.
  -->
  
  Fedora uses the dnf package manager instead of yum, although yum exists in Fedora too. Also, dnf uses the same package names as yum, so maybe you could change line 42 like this:
  ```python
  elif tools.os_info.with_yum or tools.os_info.with_dnf:
      ...
  ```
  In addition, could you also add support for `FreeBSD pkg`? I think in `pkg` this package name is just `xorg`.
  
  ### Package and Environment Details (include every applicable attribute)
    * Package Name/Version: **xorg/system**
    * Operating System+version: **Fedora 32**
    * Compiler+version: **GCC 10**
    * Conan version: **conan 1.26.0**
    * Python version: **Python 3.8.3**
  
  
  ### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
  ```
  arch=x86_64
  arch_build=x86_64
  build_type=Release
  compiler=gcc
  compiler.libcxx=libstdc++
  compiler.version=10
  os=Linux
  os_build=Linux
  ```
  
  
  ### Steps to reproduce (Include if Applicable)
  When I try to install xorg/system
  `conan install xorg/system@ --build missing`
  
  
  ### Logs (Include/Attach if Applicable)
  <details><summary>Click to expand log</summary>
  
  ```
  Configuration:
  [settings]
  arch=x86_64
  arch_build=x86_64
  build_type=Release
  compiler=gcc
  compiler.libcxx=libstdc++
  compiler.version=10
  os=Linux
  os_build=Linux
  [options]
  [build_requires]
  [env]
  
  Installing package: xorg/system
  Requirements
      xorg/system from 'conan-center' - Cache
  Packages
      xorg/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
  
  Installing (downloading, building) binaries...
  xorg/system: Already installed!
  ERROR: xorg/system: Error in package_info() method, line 57
  	self._fill_cppinfo_from_pkgconfig(name)
  while calling '_fill_cppinfo_from_pkgconfig', line 18
  	if not pkg_config.provides:
  	ConanException: pkg-config command ['pkg-config', '--print-provides', 'sm', '--print-errors'] failed with error: Command 'pkg-config --print-provides sm --print-errors' returned non-zero exit status 1.
  Package sm was not found in the pkg-config search path.
  Perhaps you should add the directory containing `sm.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'sm', required by 'virtual:world', not found
  ```
  
  </details>
  
  
  </issue>
  <code>
  [start of recipes/xorg/all/conanfile.py]
  1 from conans import ConanFile, tools
  2 from conans.errors import ConanException
  3 
  4 
  5 class ConanXOrg(ConanFile):
  6     name = "xorg"
  7     url = "https://github.com/conan-io/conan-center-index"
  8     license = "MIT"
  9     homepage = "https://www.x.org/wiki/"
  10     description = "The X.Org project provides an open source implementation of the X Window System."
  11     settings = {"os": "Linux"}
  12 
  13     def package_id(self):
  14         self.info.header_only()
  15 
  16     def _fill_cppinfo_from_pkgconfig(self, name):
  17         pkg_config = tools.PkgConfig(name)
  18         if not pkg_config.provides:
  19             raise ConanException("OpenGL development files aren't available, give up")
  20         libs = [lib[2:] for lib in pkg_config.libs_only_l]
  21         lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L]
  22         ldflags = [flag for flag in pkg_config.libs_only_other]
  23         include_dirs = [include[2:] for include in pkg_config.cflags_only_I]
  24         cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")]
  25         defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")]
  26 
  27         self.cpp_info.system_libs.extend(libs)
  28         self.cpp_info.libdirs.extend(lib_dirs)
  29         self.cpp_info.sharedlinkflags.extend(ldflags)
  30         self.cpp_info.exelinkflags.extend(ldflags)
  31         self.cpp_info.defines.extend(defines)
  32         self.cpp_info.includedirs.extend(include_dirs)
  33         self.cpp_info.cflags.extend(cflags)
  34         self.cpp_info.cxxflags.extend(cflags)
  35 
  36 
  37     def system_requirements(self):
  38         if tools.os_info.is_linux and self.settings.os == "Linux":
  39             package_tool = tools.SystemPackageTool(conanfile=self, default_mode="verify")
  40             if tools.os_info.with_apt:
  41                 packages = ["xorg-dev", "libx11-xcb-dev", "libxcb-render0-dev", "libxcb-render-util0-dev"]
  42             elif tools.os_info.with_yum:
  43                 packages = ["xorg-x11-server-devel"]
  44             elif tools.os_info.with_pacman:
  45                 packages = ["xorg-server-devel"]
  46             elif tools.os_info.with_zypper:
  47                 packages = ["Xorg-x11-devel"]
  48             else:
  49                 self.output.warn("Do not know how to install 'xorg' for {}.".format(tools.os_info.linux_distro))
  50             for p in packages:
  51                 package_tool.install(update=True, packages=p)
  52 
  53     def package_info(self):
  54         for name in ["x11", "x11-xcb", "dmx", "fontenc", "libfs", "ice", "sm", "xau", "xaw7",
  55                      "xcomposite","xcursor", "xdamage", "xdmcp", "xext", "xfixes", "xft", "xi",
  56                      "xinerama", "xkbfile", "xmu", "xmuu", "xpm", "xrandr", "xrender", "xres",
  57                      "xscrnsaver", "xt", "xtst", "xv", "xvmc", "xxf86dga", "xxf86vm", "xtrans"]:
  58             self._fill_cppinfo_from_pkgconfig(name)
  59
  [end of recipes/xorg/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/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py
  --- a/recipes/xorg/all/conanfile.py
  +++ b/recipes/xorg/all/conanfile.py
  @@ -39,7 +39,7 @@
               package_tool = tools.SystemPackageTool(conanfile=self, default_mode="verify")
               if tools.os_info.with_apt:
                   packages = ["xorg-dev", "libx11-xcb-dev", "libxcb-render0-dev", "libxcb-render-util0-dev"]
  -            elif tools.os_info.with_yum:
  +            elif tools.os_info.with_yum or tools.os_info.with_dnf:
                   packages = ["xorg-x11-server-devel"]
               elif tools.os_info.with_pacman:
                   packages = ["xorg-server-devel"]
  
verification_info: {"golden_diff": "diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py\n--- a/recipes/xorg/all/conanfile.py\n+++ b/recipes/xorg/all/conanfile.py\n@@ -39,7 +39,7 @@\n             package_tool = tools.SystemPackageTool(conanfile=self, default_mode=\"verify\")\n             if tools.os_info.with_apt:\n                 packages = [\"xorg-dev\", \"libx11-xcb-dev\", \"libxcb-render0-dev\", \"libxcb-render-util0-dev\"]\n-            elif tools.os_info.with_yum:\n+            elif tools.os_info.with_yum or tools.os_info.with_dnf:\n                 packages = [\"xorg-x11-server-devel\"]\n             elif tools.os_info.with_pacman:\n                 packages = [\"xorg-server-devel\"]\n", "issue": "[package] xorg/system: Can you add support for dnf package manager?\n<!-- \r\n  Please don't forget to update the issue title.\r\n  Include all applicable information to help us reproduce your problem.\r\n-->\r\n\r\nFedora uses the dnf package manager instead of yum, although yum exists in Fedora too. Also, dnf uses the same package names as yum, so maybe you could change line 42 like this:\r\n```python\r\nelif tools.os_info.with_yum or tools.os_info.with_dnf:\r\n    ...\r\n```\r\nIn addition, could you also add support for `FreeBSD pkg`? I think in `pkg` this package name is just `xorg`.\r\n\r\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **xorg/system**\r\n  * Operating System+version: **Fedora 32**\r\n  * Compiler+version: **GCC 10**\r\n  * Conan version: **conan 1.26.0**\r\n  * Python version: **Python 3.8.3**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\narch=x86_64\r\narch_build=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++\r\ncompiler.version=10\r\nos=Linux\r\nos_build=Linux\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\nWhen I try to install xorg/system\r\n`conan install xorg/system@ --build missing`\r\n\r\n\r\n### Logs (Include/Attach if Applicable)\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nConfiguration:\r\n[settings]\r\narch=x86_64\r\narch_build=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++\r\ncompiler.version=10\r\nos=Linux\r\nos_build=Linux\r\n[options]\r\n[build_requires]\r\n[env]\r\n\r\nInstalling package: xorg/system\r\nRequirements\r\n    xorg/system from 'conan-center' - Cache\r\nPackages\r\n    xorg/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache\r\n\r\nInstalling (downloading, building) binaries...\r\nxorg/system: Already installed!\r\nERROR: xorg/system: Error in package_info() method, line 57\r\n\tself._fill_cppinfo_from_pkgconfig(name)\r\nwhile calling '_fill_cppinfo_from_pkgconfig', line 18\r\n\tif not pkg_config.provides:\r\n\tConanException: pkg-config command ['pkg-config', '--print-provides', 'sm', '--print-errors'] failed with error: Command 'pkg-config --print-provides sm --print-errors' returned non-zero exit status 1.\r\nPackage sm was not found in the pkg-config search path.\r\nPerhaps you should add the directory containing `sm.pc'\r\nto the PKG_CONFIG_PATH environment variable\r\nPackage 'sm', required by 'virtual:world', not found\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conans import ConanFile, tools\nfrom conans.errors import ConanException\n\n\nclass ConanXOrg(ConanFile):\n    name = \"xorg\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"MIT\"\n    homepage = \"https://www.x.org/wiki/\"\n    description = \"The X.Org project provides an open source implementation of the X Window System.\"\n    settings = {\"os\": \"Linux\"}\n\n    def package_id(self):\n        self.info.header_only()\n\n    def _fill_cppinfo_from_pkgconfig(self, name):\n        pkg_config = tools.PkgConfig(name)\n        if not pkg_config.provides:\n            raise ConanException(\"OpenGL development files aren't available, give up\")\n        libs = [lib[2:] for lib in pkg_config.libs_only_l]\n        lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L]\n        ldflags = [flag for flag in pkg_config.libs_only_other]\n        include_dirs = [include[2:] for include in pkg_config.cflags_only_I]\n        cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith(\"-D\")]\n        defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith(\"-D\")]\n\n        self.cpp_info.system_libs.extend(libs)\n        self.cpp_info.libdirs.extend(lib_dirs)\n        self.cpp_info.sharedlinkflags.extend(ldflags)\n        self.cpp_info.exelinkflags.extend(ldflags)\n        self.cpp_info.defines.extend(defines)\n        self.cpp_info.includedirs.extend(include_dirs)\n        self.cpp_info.cflags.extend(cflags)\n        self.cpp_info.cxxflags.extend(cflags)\n\n\n    def system_requirements(self):\n        if tools.os_info.is_linux and self.settings.os == \"Linux\":\n            package_tool = tools.SystemPackageTool(conanfile=self, default_mode=\"verify\")\n            if tools.os_info.with_apt:\n                packages = [\"xorg-dev\", \"libx11-xcb-dev\", \"libxcb-render0-dev\", \"libxcb-render-util0-dev\"]\n            elif tools.os_info.with_yum:\n                packages = [\"xorg-x11-server-devel\"]\n            elif tools.os_info.with_pacman:\n                packages = [\"xorg-server-devel\"]\n            elif tools.os_info.with_zypper:\n                packages = [\"Xorg-x11-devel\"]\n            else:\n                self.output.warn(\"Do not know how to install 'xorg' for {}.\".format(tools.os_info.linux_distro))\n            for p in packages:\n                package_tool.install(update=True, packages=p)\n\n    def package_info(self):\n        for name in [\"x11\", \"x11-xcb\", \"dmx\", \"fontenc\", \"libfs\", \"ice\", \"sm\", \"xau\", \"xaw7\",\n                     \"xcomposite\",\"xcursor\", \"xdamage\", \"xdmcp\", \"xext\", \"xfixes\", \"xft\", \"xi\",\n                     \"xinerama\", \"xkbfile\", \"xmu\", \"xmuu\", \"xpm\", \"xrandr\", \"xrender\", \"xres\",\n                     \"xscrnsaver\", \"xt\", \"xtst\", \"xv\", \"xvmc\", \"xxf86dga\", \"xxf86vm\", \"xtrans\"]:\n            self._fill_cppinfo_from_pkgconfig(name)\n", "path": "recipes/xorg/all/conanfile.py"}]}