From Newsgroup: muc.lists.freebsd.ports
On Thu 08 Jan 19:45, Dan Langille wrote:
re: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292266
I'm looking at adding mysql and mariadb flavors to net-mgmt/librenms
Getting @mysql working is fine:
+.if ${FLAVOR:U} == mysql
+USES+= mysql:client
+.endif
The problem seems to be specifying mariadb. I've been basing it on:
+.if ${FLAVOR:U} == mariadb
+USES+= mysql:client MYSQL_FLAVOUR= mariadb
+.endif
That's no good. That just gives: Unknown USES=MYSQL_FLAVOUR=mariadb
The USES docs[1] mentions "The m and p suffixes are for the MariaDB and Percona variants of MySQL" - yet that requires me to know and select a version,
something I'd prefer to leave up to the ports tree / user. That's also what MySQL
does.
Reading Mk/Uses/mysql.mk[2], it sets `MYSQL_FLAVOUR= mariadb` only if that version
mentioned above is specified.
I've grep'd for examples, found none.
When I get to blocks like this, I figure I'm doing it wrong.
Am I?
1 - https://docs.freebsd.org/en/books/porters-handbook/uses/#uses-mysql mentions
2 - https://cgit.freebsd.org/ports/tree/Mk/Uses/mysql.mk#n108
--
Please do not had flavors for something like this is a step in the wrong direction
I already pointed for years what should be done instead to people can decide
at runtime which mysql implementation they want by default, we should entirely rework the mysql port (and the postgresql port while we are here) to avoid adding flavors for this. This kind of use case is clearly an abuse of the flavor
framework.
What should be done instead:
All mysql clients and servers installs themselves in a non conflicting way
They do not expose their public libraries. the cli in the path is renamed to make sure they do not conflict.
We have a single default mysql client which is always the latest and greatest available this is where we can play with the default version framework, to maybe
allow to chose a another implementation by default if really this is needed. (they are for now at least all compatible).
All ports depends only on this default client and not on a specific implementation everyone can install the version they want, have qualified are done with it.
Best regards,
Bapt
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to
news-admin@muc.de
--- Synchronet 3.21a-Linux NewsLink 1.2