#1019 Document CMake automatic provides
Opened 3 years ago by alebastr. Modified 2 years ago

It was pointed to me in a recent package review that the documentation for CMake automatic provides generator and cmake(...) build dependencies cannot be found in the packaging guidelines.
Indeed, the only documentation for the feature I was able to find is a blog post from the author: https://www.dvratil.cz/2015/03/fedora-rpm-automatic-provides-for-cmake-projects-packages/.

Would it be possible to add that information to the guidelines, either as a part of CMake policy page or as a separate section similar to PkgConfigBuildRequires?

I also was under impression that BuildRequires: cmake(...) usage is encouraged on the same level as BuildRequires: pkgconfig(...). Even if it's not true (especially if it's not true), this deserves clarification in the guidelines.


In general it's not necessary to document in the packaging guidelines every single dependency generator that exists. That would be rather pointless. It is enough to document that automatic dependency generators exist and that the packager should be aware of them and, if necessary, should filter them to prevent issues. This documentation already exists in the guidelines.

If there is something specific about cmake-related automatic dependencies that deserves mention in the guidelines then certainly let us know what those might be. I'm not aware of any specific requirements surrounding them but I'm not the best-informed person. The cmake guidelines in general might be out of date at this point in any case.

The ticket is about provides generator though.

Similar to BuildRequires: pkgconfig(...), it is preferred to use BuildRequires: cmake(...) in Fedora, as it's the closest translation of the upstream's find_package(...) dependency declaration in CMakeLists.txt. But the preference is rather informal and there's not a single word about it in the various packager documents.

IIRC, I created the issue after I was asked what cmake() macros does and why am I using it.

rg 'BuildRequires:\s*cmake\(.*\)' rpm-specs |wc -l
2938

The ticket is about provides generator though.

Sure, I understand that. There are all sorts of provides generators. What I'm trying to understand is if there is anything special about those that needs to be formalized in the guidelines.

Similar to BuildRequires: pkgconfig(...), it is preferred to use BuildRequires: cmake(...) in Fedora,

Is it? I've not heard that before. Certainly there are things that you can depend upon if you wish, but this is the only mention I've seen anywhere about there being any preference for using them. If that's the case then someone who actually knows what use of them implies (which would not be me) could submit a pull request against the cmake portion of the guidelines. (I just reformatted that portion of the guidelines so let me merge that PR first, though I also have some formatting fixes to merge as well.)

Login to comment on this ticket.

Metadata