Repository: conan-io/conan-center-index

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>



Discussion:
> In addition, could you also add support for FreeBSD pkg? I think in pkg this package name is just xorg.

I don't have FreeBSD to check it, but there is no problem adding, we just need to be sure about the name.

About dnf and yum. The System package tools will prioritize dnf first. 

Resolving patch:
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 @@ def system_requirements(self):
             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"]


Test patch: