dependancys optional plugings
hank at blackhole.com
Sat Apr 16 16:17:26 PDT 2005
I'm working on a port for krecipes
http://sourceforge.net/projects/krecipes/ the first draft is already
in ports/79038, but it isn't acceptable in the current format,
because any/all of 3 databases could be chosen, while I only deal
with one. Actually it might be acceptable, I think the objection
stated does not apply. Anyway, I'm in the process of cleaning it up,
and wondering how to deal with the options.
I originally placed sqlite as the default database (probably the
best), but MySQL or Postgresql could be used instead by installing
databases/qt-mysql-plug-in or databases/qt-pgsql-plug-in
(respectively). No changes are required to the port.
I can check for the WITH_MYSQL and WITH_POSTGRESQL variables easily
enough. Adding a WITHOUT_SQLITE variable is also easy. However I'm
not sure what to do about all the special cases that come up by
One user is limited to one database backend. You can import recipes
from one database to the other if you want to switch, but there is no
provision for using two backends at the same time.
The options as I seem them follows. Which is the preferred way of
Easiest is to install all the backends all the time, but that is
clearly wrong. It wastes disk space if nothing else, but it also
installs clients, which might conflict with a different version the
user has installed.
Next easiest is to do what I did: make sqlite the database. Users
who want MySQL or Postgresql just need to install the plug-in
manually. I have verified that if the plug-in is installed after
krecipes it is useable without any other effort. A trivial
modification is to look for the WITH_ variable and require the
plugins. The only downside is a plug-in could be installed and used
latter, and that would not be reflected in the dependency lists,
meaning cutleaves or similar would suggest removing it even though it
is a dependency.
There are configure arguments to disable any database. If
WITH_MYSQL is not specified I could disable looking for the MySQL
plug-in. (same for postgresql) This solves the dependency issue, but
at the cost of requiring a rebuild to add backends.
As a last question, is there any reason to make a different backend
default? MySQL is perhaps the most stable as the others were added
latter. Sqlite has no administration costs though.
More information about the freebsd-ports