On Tue, May 4, 2021 at 11:07 AM Dan Čermák <dan.cermak(a)cgc-instruments.com>
wrote:
Fabio Valentini <decathorpe(a)gmail.com> writes:
> On Mon, May 3, 2021 at 11:48 PM Dan Čermák
> <dan.cermak(a)cgc-instruments.com> wrote:
>
> An RPM macro to indicate the major clang version would be a much
> cleaner solution.
Agreed here.
You could also try to use the symlink in %{_libdir}/clang/$MAJOR_VERSION
[1]
to require the major version of clang at build time, but not sure if
that's what you want either.
Oh, that part's actually easy, as I've since noticed that recent clang
builds include a Provides for "clang(major) = 12" (or 11, etc...), which
means if I *have* the major version number, I can make the package depend
on that major version. It's just getting the number that's the trick. The
"clang(major)" provides does not, near as I can figure, do me any good on
that front.
Querying RPM counts as a clever answer to my first question, though, for
sure. Not quite as *convenient* as a /usr/lib/rpm/macros.d/clang.macros
file that exports a %{clang_major_version} RPM variable, but workable
enough when I'm not being lazy, and certainly "good enough" *until*
there's
an rpm-macros-clang package, at least. Thanks!