Personal tools
You are here: Home Documentation Tutorials Introduction to zc.buildout Building custom eggs

Building custom eggs

Custom egg builds such as a distribution with compiled files
Jim Fulton's tutorial for using buildout, originally given at DZUG 2007
Page 11 of 17.

Custom egg building

[buildout]
parts = spreadmodule

[spreadtoolkit]
recipe = zc.recipe.cmmi
url = http://yum.zope.com/buildout/spread-src-3.17.1.tar.gz

[spreadmodule]
recipe = zc.recipe.egg:custom
egg = SpreadModule ==1.4
find-links = http://www.python.org/other/spread/
include-dirs = ${spreadtoolkit:location}/include
library-dirs = ${spreadtoolkit:location}/lib
rpath = ${spreadtoolkit:location}/lib
handout

Sometimes a distribution has extension modules that need to be compiled with special options, such as the location of include files and libraries, The custom recipe supports this. The resulting eggs are placed in the develop-eggs directory because the eggs are buildout specific.

This example illustrates use of the zc.recipe.cmmi recipe with supports installation of software that uses configure, make, make install. Here, we used the recipe to install the spread toolkit, which is installed in the parts directory.

Part dependencies

  • Parts can read configuration from other parts
  • The parts read become dependencies of the reading parts
    • Dependencies are added to parts list, if necessary
    • Dependencies are installed first
handout
In the previous example, we used the spread toolkit location in the spreadmodule part definition. This reference was sufficient to make the spreadtoolkit part a dependency of the spreadmodule part and cause it to be installed first.

Custom develop eggs

[buildout]
parts = zodb

[zodb]
recipe = zc.recipe.egg:develop
setup = zodb
define = ZODB_64BIT_INTS
handout
We can also specify custom build options for develop eggs. Here we used a develop egg just to make sure our custom build of ZODB took precedence over normal ZODB eggs in our shared eggs directory.