#39961: Replace port:mysql5 dependencies with file:/lib: ones --------------------------+-------------------------------- Reporter: mp@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by ryandesign@…): Replying to [comment:3 mp@…]:
I was under the impression that variants add unnecessary complexity in case of packages (f. e. php5-mysql) where you just need the libmysqlclient*whatever and don't want to juggle/build so many variants because in fact you don't care about the version.
But if I get you right, this won't work anyway because of the different install locations of mysql51 et al.
Variants are indeed an increase in complexity and should be avoided when possible, however when the goal is to offer the user a choice of library version to link with, variants are the only viable method. php5-mysql is deprecated; use php53-mysql, php54-mysql, or php55-mysql; these have variants to let you choose the mysql version to use (although in this specific case, it is not necessary to use any mysql version, because the PHP team have written a replacement driver called mysqlnd which does the same thing, and that's the default variant for these ports).
Does that mean that for those packages, the base variant should depend on mysql5 and the version-specific variants replace that with a specific one?
I'm not sure I understand your terminology. Port that use mysql should offer variants to let the user select which mysql to use. The variants should have the same names as the ports they depend on, so there would not be a variant called "mysql"; there would be variants "mysql5", "mysql51", etc. If a port currently has a "mysql" variant it would be deprecated and changed into a legacy compatibility variant for one year to help users transition to the new variant names. At this time, the default variant should be mysql5. Later, when all such ports have been updated to offer all these variants, we'll switch the default to the latest stable version, which is currently mysql56, and deprecate the old mysql5 variant. The method by which a port indicates its default variant(s) is via the `default_variants` keyword. See the neko portfile for a fairly simple example of how all this works.
Does that also imply that while it is possible to have f.e. mysql-51 and mysql-55 installed at the same time, depending-upon packages must be switched/deactivated because only one variant can be active
Yes. The ports mysql51, mysql55, mysql56, mariadb and percona can all be installed simultaneously, and it was deliberate decision (and a considerable effort on the maintainer's part) to make that possible. But only one variant of a port can be active at a time.
and the different mysql5{1,5,6} probably need to conflict because we cannot link against more than one version a time?
Yes, the mysql variants of a port need to conflict with one another. -- Ticket URL: <https://trac.macports.org/ticket/39961#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X