pkg-config

Greg Troxel gdt at lexort.com
Mon Nov 20 16:52:59 PST 2023


"Regina Obe" <lr at pcorp.us> writes:

>> The big question is: do correct installs of all supported geos
>> versions install pkg-config?  My pkgsrc install of geos certainly
>> does but I'm on the latest release.  If you can tell someone with
>> geos and without a .pc that their packaging/install is broken and
>> they should fix it, and feel ok about that, then yes this is good.
>
> I presume you mean current?

Well, I didn't really think about that, but I mean that rule for any
branch to which this change is made.

> For PostGIS 3.5+, we dropped support for all GEOS < 3.8 
> Sadly it looks like GEOS 3.8 (or at least my setup) does not install a
> pkgconfig, but GEOS 3.9 on does.

ok, so one more drop.

I do not understand the need for new postgis to support old geos.
People are either drinking the LTS koolaid and should be happy with old
everything, or they should be relatively up-to-date.  My personal rule
is that when Foo N is released on date D, it should be happy with any
version of any dependency, as long as that version is at least the
version that was generally recommended for all uses on D - 2years.

> However, we just EOL'd GEOS 3.8 https://libgeos.org/usage/download/  so in
> theory we can have another
> motion to drop GEOS 3.8 as well in PostGIS 3.5.  That would I think clear up
> some extra baggage we have left for 3.8.

Indeed makes sense.

>> If there are non-broken geos installs that are missing a .pc, then I think
> you need
>> 
>> >   if (pkg-config found) AND pkg-config --modversion geos
>> >     use pkg-config
>> >   elseif (geos-config on path)
>> >     use geos-config
>> >   else
>> >     error cannot find geos
>
> Greg is that pseudo code or you can pass that --modversion geos to pkg and
> it will detect if your pkg has it?
> That will deal with my concern, of having missed putting GEOS in my pkg
> path.

That is not pseudocode; it's real.  It is -modversion instead of
-version because you want to probe geos and its version, not find out
the version of pkg-config.  An example of really running it, and with a
bad package name that is not found.

  $ pkg-config --modversion geos
  3.12.1
  $ pkg-config --modversion geoos
  Package geoos was not found in the pkg-config search path.
  Perhaps you should add the directory containing `geoos.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'geoos', required by 'virtual:world', not found


More information about the postgis-devel mailing list