Opened 11 years ago

Last modified 11 years ago

#40255 new defect

mapserver: configure fails when dependencies have not yet been installed

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeabraham
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc:
Port: mapserver

Description

mapserver fails to build on the buildbots, because:

checking if PostGIS support requested... configure: error: '/bin/pg_config' is not an executable.  Make sure you use --with-postgis=/path/to/pg_config

The mapserver portfile does a number of wrong things, such as building itself differently depending on the version of postgresql the user has installed:

if {[variant_isset postgis]} {
    # check for most recent version of postgresql installed
    set HAVE_PGCONFIG [llength [glob -nocomplain -d ${prefix}/lib postgresql*/bin/pg_config]]
    # if not found, intall the postgresql port
    if {$HAVE_PGCONFIG == 0} {
        depends_lib-append  port:postgresql90
    }
}

and assuming that dependencies have been installed before that is actually guaranteed to be the case:

variant postgis description {Add support for postgis sources} {
    set PGSQL_DIR [lindex [lsort -dec [glob -nocomplain -d ${prefix}/lib postgresql*]] 0]
    configure.args-append   "--with-postgis=${PGSQL_DIR}/bin/pg_config"
}

Change History (4)

comment:1 Changed 11 years ago by jeabraham

We should fix this, but I do not know how.

In particular, mapserver does not require a particular version of PostGIS (I'm still using PostGIS1.5). But now it seems to be requiring PostGIS 2.0, even though I'm not ready to upgrade to PostGIS 2.0. Is there a recommended approach to compiling Mapserver against an installed version of PostGIS? Should the user specify the PostGIS (and PostgreSQL) versions they want to use, and then MacPorts can go and install those only if they aren't already installed?

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Add variants for postgis and postgis2, conflicting with one another, with one of them being the default. Let the user choose which one they want.

comment:3 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

However I'm not sure what to do about the postgresql dependency. The postgis and postgis2 ports already have variants to let the user choose the postgresql version. Does mapserver need to know what version of postgresql postgis or postgis2 were built with? If so, that's going to get complicated.

comment:4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

John replied by email saying:

I don't think mapserver is going to care much about the PostgreSQL version. But I could be wrong.

But if that's so, then why does the mapserver portfile say:

variant postgis description {Add support for postgis sources} {
    set PGSQL_DIR [lindex [lsort -dec [glob -nocomplain -d ${prefix}/lib postgresql*]] 0]
    configure.args-append   "--with-postgis=${PGSQL_DIR}/bin/pg_config"
}

Either mapserver needs to know the path to a particular postgresql's pg_config file, or it doesn't...

Note: See TracTickets for help on using tickets.