This is certainly functional, but I think that the version strings spit out don't make sense for libflashrom. They include letters and are not monotonically increasing, even at tagged releases. So I think some sed magic is going to be needed to make it useful.
Here was what I got out of a test run in pkg-config: "Version: v1.1-rc1-85-ge094fb4"
Quoting https://people.freedesktop.org/~dbn/pkg-config-guide.html:
> The Name, Description and URL fields are purely informational and should be easy to fill in.
> The Version field is a bit trickier to ensure that it is usable by consumers of the data.
> pkg-config uses the algorithm from RPM for version comparisons. This works best with a
> dotted decimal number such as 1.2.3 since letters can cause unexpected results. The number
> should be monotonically increasing and be as specific as possible in describing the library. > Usually it's sufficient to use the package's version number here since it's easy for
> consumers to track.
To view, visit change 35561. To unsubscribe, or for help writing mail filters, visit settings.