[Distutils] buildout: build options for dependencies of recipes
Leonardo Rochael Almeida
leorochael at gmail.com
Thu Jul 29 00:44:10 CEST 2010
Hi all
The zc.recipe.egg:custom recipe allows the specification of build
options for a custom egg. But what do we do if we want to specify
custom build options for an egg that is a dependency of a recipe (or
perhaps the recipe itself)?
Case in point
We have a recipe, erp5.recipe.mysqldatabase, that uses the
MySQL-python. However, since we have a non-distribution installation
of MySQL (we need to patch it with the Senna full text index), we need
to pass compilation instructions to MySQL-python so that it actually
finds the correct MySQL include and lib directories, which we do
through zc.recipe.egg:custom.
This works for buildout parts with recipes based on zc.recipe.egg
(e.g. collective.recipe.zope2instance), even if some of the eggs
mentioned depend on MySQL-python, as long as the zc.recipe.egg:custom
part for MySQL-python runs first.
But if the recipe itself depends on MySQL-python, we don't get the
opportunity to pass custom build options to MySQL-python, since
buildout will try to satisfy the recipe dependencies of all parts even
before installing the zc.recipe.egg:custom part.
zc.buildout has APIs [1] [2] for passing custom build options for
eggs, but appart from zc.recipe.egg:custom, I couldn't find any way to
use these APIs for dependencies of recipes.
[1] http://pypi.python.org/pypi/zc.buildout#handling-custom-build-options-for-extensions-provided-in-source-distributions
[2] http://pypi.python.org/pypi/zc.buildout#handling-custom-build-options-for-extensions-in-develop-eggs
Since we can specify versions for eggs by specifying a section with
version information, I was hoping that we could also specify build
options somehow. Since there are many pieces of information (including
environment variables). I think that we'd need a whole section for
each egg. Something on the lines of:
[buildout]
build-options-sufix = -options
...
[MySQL-python-options]
# options like the ones for the zc.recipe.egg:custom recipe
Is there something like this available, and I just missed it?
Can something like this be implemented as a buildout extension?
Cheers,
Leo
PS: Conversely, it would also be nice to be able to specify different
"versions" sections per zc.recipe.egg part instead of a single global
one, exactly so that we can compare different version combinations
with a single buildout.
More information about the Distutils-SIG
mailing list