[geos-devel] [GEOS] #1015: Update geos-config tool for consistency

Regina Obe lr at pcorp.us
Tue Feb 18 11:58:51 PST 2020


> Paul Ramsey <pramsey at cleverelephant.ca> writes:
> 
> > Pkg config is wonderous but still far from universal
> 
> Greg Troxel  writes:
> Interesting.  As a packager, I see a vast number of things using it, and thus a
> system where it isn't available as a build dependency would seem very
> difficult to deal with in general.  I would not have suggested it if I thought
> anyplace would have trouble with that (except that I don't pay attention to
> Windows at all).
> 
> On my desktop there are 557 .pc files installed from pkgsrc, 9 from the base
> system, and 127 from pkgsrc.  Geo-examples include proj, gdal and spatialite.
> 

I think on visual studio pkg is kinda supported but not out of the box.  Someone who uses VS can confirm that.
Can CMake always use pkg or is it even relevant since CMake we have a separate chain?  For Windows build, we require CMake now anyway -- so it would then be a "If CMake supports it on windows we can do it"?

On mingw/msys2 which I use for windows building -  pkg-config is well supported. So fine with me.

That said even if we did go down the path of pkgsrc I think we need to support geos-config for a couple of minor versions to give libraries that depend on GEOS time to change.
For example PostGIS expects a geos-config file.  So we'd have to change all supported versions to allow .pc for geos.

Or am I missing something here?

Speaking of reverting the last change that started this whole discussion -- does anyone have thoughts on alternative to printf for sh?
I would like to keep the intent if possible without causing backward compatibility issues.

I assume these are the sections that would need reverting.

https://git.osgeo.org/gitea/geos/geos/pulls/99.diff  - in the tools/geos-config.cmake #!/bin/sh

index 24a5725..abef1e3 100644
--- a/tools/geos-config.cmake
+++ b/tools/geos-config.cmake
@@ -1,12 +1,12 @@
-#!/bin/sh
+#!/bin/bash -e
 
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
-libdir=@CMAKE_INSTALL_PREFIX@/lib
+# escape path
+prefix=$(printf %q "@CMAKE_INSTALL_PREFIX@")
+libdir=${prefix}/lib

and tools/geos-config.in

--- a/tools/geos-config.in
+++ b/tools/geos-config.in
@@ -1,11 +1,12 @@
-#!/bin/sh
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
+#!/bin/bash -e
+
+# escape paths
+prefix=$(printf %q "@prefix@")
+libdir=$(printf %q "@libdir@")


Thanks,
Regina








More information about the geos-devel mailing list