On Jan 4, 2013, at 01:41, [email protected] wrote:

> Revision: 101092
>          https://trac.macports.org/changeset/101092
> Author:   [email protected]
> Date:     2013-01-03 23:41:13 -0800 (Thu, 03 Jan 2013)
> Log Message:
> -----------
> added postgresql* variants, kept old non-standard variants for upgrading, 
> updated revision to 1, made postgresql92 variant the default, added pvanek as 
> additional maintainer
> 
> Modified Paths:
> --------------
>    trunk/dports/lang/qore-pgsql-module/Portfile

> @@ -19,35 +20,50 @@
>                     sha1    c250dab4b886158d5a7e063abb7eb242078104ef \
>                     rmd160  631bc3dd26fe56e29fc2fffa8f4a98e5c17b4142
> 
> -variant psql83 conflicts psql84 psql90 psql91 psql92 \
> +variant postgresql83 conflicts psql84 psql90 psql91 psql92 postgresql84 
> postgresql90 postgresql91 postgresql92 \
> description {Enable PostgreSQL Driver version 8.3} {}
> 
> -variant psql84 conflicts psql83 psql90 psql91 psql92 \
> +variant postgresql84 conflicts psql83 psql90 psql91 psql92 postgresql83 
> postgresql90 postgresql91 postgresql92 \
> description {Enable PostgreSQL Driver version 8.4} {}
> 
> -variant psql90 conflicts psql83 psql84 psql91 psql92 \
> -description {Enable PostgreSQL Driver version 9.0 (default if none 
> selected)} {}
> +variant postgresql90 conflicts psql83 psql84 psql91 psql92 postgresql83 
> postgresql84 postgresql91 postgresql92 \
> +description {Enable PostgreSQL Driver version 9.0} {}
> 
> -variant psql91 conflicts psql83 psql84 psql90 psql92 \
> +variant postgresql91 conflicts psql83 psql84 psql90 psql92 postgresql83 
> postgresql84 postgresql90 postgresql92 \
> description {Enable PostgreSQL Driver version 9.1} {}
> 
> -variant psql92 conflicts psql83 psql84 psql90 psql91 \
> -description {Enable PostgreSQL Driver version 9.2} {}
> +variant postgresql92 conflicts psql83 psql84 psql90 psql91 postgresql83 
> postgresql84 postgresql90 postgresql91 \
> +description {Enable PostgreSQL Driver version 9.2 (default if none 
> selected)} {}
> 
> -set psql_version "90"
> -if {[variant_isset psql83]} {
> -    set psql_version "83"
> -} elseif {[variant_isset psql84]} {
> -    set psql_version "84"
> -} elseif {[variant_isset psql90]} {
> -    set psql_version "90"
> -} elseif {[variant_isset psql91]} {
> -    set psql_version "91"
> -} elseif {[variant_isset psql92]} {
> -    set psql_version "92"
> +variant psql83 conflicts psql84 psql90 psql91 psql92 postgresql84 
> postgresql90 postgresql91 postgresql92 \
> +description {backwards-compatible variant with postgresql83 - will be 
> removed: Enable PostgreSQL Driver version 8.3} {}
> +
> +variant psql84 conflicts psql83 psql90 psql91 psql92 postgresql83 
> postgresql90 postgresql91 postgresql92 \
> +description {backwards-compatible variant with postgresql84 - will be 
> removed: Enable PostgreSQL Driver version 8.4} {}
> +
> +variant psql90 conflicts psql83 psql84 psql91 psql92 postgresql83 
> postgresql84 postgresql91 postgresql92 \
> +description {backwards-compatible variant with postgresql90 - will be 
> removed: Enable PostgreSQL Driver version 9.0} {}
> +
> +variant psql91 conflicts psql83 psql84 psql90 psql92 postgresql83 
> postgresql84 postgresql90 postgresql92 \
> +description {backwards-compatible variant with postgresql91 - will be 
> removed: Enable PostgreSQL Driver version 9.1} {}
> +
> +variant psql92 conflicts psql83 psql84 psql90 psql91 postgresql83 
> postgresql84 postgresql90 postgresql91 \
> +description {backwards-compatible variant with postgresql92 - will be 
> removed: Enable PostgreSQL Driver version 9.2} {}
> +
> +set postgresql_version "92"
> +if {[variant_isset postgresql83] || [variant_isset psql83]} {
> +    set postgresql_version "83"
> +} elseif {[variant_isset postgresql84] || [variant_isset psql84]} {
> +    set postgresql_version "84"
> +} elseif {[variant_isset postgresql90] || [variant_isset psql90]} {
> +    set postgresql_version "90"
> +} elseif {[variant_isset postgresql91] || [variant_isset psql91]} {
> +    set postgresql_version "91"
> +} elseif {[variant_isset postgresql92] || [variant_isset psql92]} {
> +    set postgresql_version "92"
> }

In order to actually facilitate an upgrade, the old psql* variants need to 
"require" the corresponding new postgresql* variant, otherwise, once the 
compatibility variants are removed, users will be back to the default version 
of PostgreSQL.

There's no need for the postgresql* variants to reference the psql* variants.

The description of the postgresql92 variant shouldn't include "(default if none 
selected)"; instead, use the default_variants keyword and MacPorts will 
automatically select that variant and indicate it in the output of "port 
variants".

But the most important issue is that the port does not in any way communicate 
to the qore-pgsql-module build system (via configure argument, environment 
variable, patchfile, etc.) which version of PostgreSQL it should use; the build 
system just assumes that it should use the newest PostgreSQL installed in 
/opt/local. This is problematic because MacPorts might be installed in a prefix 
other than /opt/local, and the user might have multiple versions of PostgreSQL 
installed. It looks like the configure script will even check /usr/local, /sw 
and other locations, which could result in qore-pgsql-module linking with a 
non-MacPorts PostgreSQL the user might have installed, which would not be 
desirable.

The configure script has a --with-pgsql option, but it assumes that 
PostgreSQL's include and lib directories are in a common parent directory, 
which is not the case in the MacPorts layout of the PostgreSQL ports, so we 
cannot use this argument. Well, we could: we could make a temporary directory, 
symlink the correct include and lib directories into it, and point --with-pgsql 
at that. That's actually how the +mysql5 variant of the 
php53-mysql/php54-mysql/php55-mysql ports works. But it is weird and causes 
some questions, such as https://trac.macports.org/ticket/14635

Attached is a patch making all these changes, which seems to work and should be 
ready to commit. Since you're the author of the qore-pgsql-module software, 
I'll leave it to you to decide whether this is sufficient or whether you want 
to modify qore-pgsql-module itself to allow more options for specifying where 
PostgreSQL is.


Attachment: qore-pgsql-module-variants.diff
Description: Binary data

_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to