[87295] trunk/dports/databases
Ryan Schmidt
ryandesign at macports.org
Wed Nov 16 12:09:59 PST 2011
On Nov 16, 2011, at 12:23, jwa at macports.org wrote:
> Revision: 87295
> http://trac.macports.org/changeset/87295
> Author: jwa at macports.org
> Date: 2011-11-16 10:23:45 -0800 (Wed, 16 Nov 2011)
> Log Message:
> -----------
> new port, at 5.0.1
Remember to begin your commit message with the port name.
> Added Paths:
> -----------
> trunk/dports/databases/libgda5/
> trunk/dports/databases/libgda5/Portfile
> +if (![variant_isset without_bdb]) {
> + if !([file exists ${prefix}/include/db46/db.h]) {
> + depends_lib-append port:db47
> + } elseif ([file exists ${prefix}/include/db47/db.h]) {
> + depends_lib-append port:db47
> + } else {
> + depends_lib-append port:db46
> + }
> +}
I'm surprised this works syntactically; I've never seen parentheses used in Tcl in "if" statements. Everywhere else, we use curly braces.
I'm also not sure it's a good idea to vary the port's behavior based on what's already installed on the user's system; that's something we usually avoid. It's not like BerkeleyDB is a huge dependency that would take a long time to build or take a lot of disk space. Why not just unconditionally depend on the latest version that will work? The latest we have in MacPorts is db52.
> +variant with_mysql5 \
> + description {support for current MySQL 5.x} {
> + depends_lib-append path:bin/mysql_config5:mysql5
> + configure.env-append \
> + MYSQL_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
> + configure.args-delete --without-mysql
> + configure.args-append --with-mysql=${prefix}/lib/mysql5
> + configure.cppflags-append "-I${prefix}/include/mysql5/mysql"
> +}
> +
> +variant with_postgresql83 conflicts with_postgresql84 with_postgresql90 \
> + description {support for PostgreSQL 8.3.x} {
> + configure.cppflags-append "-I${prefix}/include/postgresql83"
> + depends_lib-append port:postgresql83
> + configure.args-delete --without-postgres
> + configure.args-append --with-postgres=${prefix}/lib/postgresql83
> +}
> +
> +variant with_postgresql84 conflicts with_postgresql83 with_postgresql90 \
> + description {support for PostgreSQL 8.4.x} {
> + configure.cppflags-append "-I${prefix}/include/postgresql84"
> + depends_lib-append port:postgresql84
> + configure.args-delete --without-postgres
> + configure.args-append --with-postgres=${prefix}/lib/postgresql84
> +}
> +
> +variant with_postgresql90 conflicts with_postgresql83 with_postgresql84 \
> + description {support for PostgreSQL 9.0.x} {
> + configure.cppflags-append "-I${prefix}/include/postgresql90"
> + depends_lib-append port:postgresql90
> + configure.args-delete --without-postgres
> + configure.args-append --with-postgres=${prefix}/lib/postgresql90
> +}
> +
> +variant without_bdb \
> + description {remove support for Berkeley DB} {
> + configure.args-delete --with-bdb=${prefix}
> + configure.args-append --without-bdb
> +}
We no longer want variant names starting with "with_", "without_", "no_", etc. These variants should be called "mysql5", "postgresql83", "postgresql84", "postgresql90" and "bdb", respectively. The bdb variant's functionality would be the reverse of what you currently have in the without_bdb variant. And you'd then make bdb a default variant with:
default_variants +bdb
And to keep everything related to bdb together, the "if" statement stuff from above that sets the bdb dependency should be inside the new bdb variant.
> +post-activate {
> + system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
> +}
If it's important to update the icon cache after activation, is it also important to do so after deactivation? (I'm not sure, just asking.)
More information about the macports-dev
mailing list