To build C++ or other compiled packages, use the unix_package class. This class works for packages that are built on some variation of the traditional Unix

./configure --prefix <install_dir>
make
make install

The minimal build class for a Unix package abc is:

class abc_package(unix_package):
    def init(self):
        super(abc_package, self).init()

There are two basic ways of customizing a Unix package build class: setting properties, and defining helper methods.

Customizing the build by changing unix_package properties

The first is to set one of the following properties (shown with default values) to something different in the init method:

self.configure_command = './configure --prefix=%s' % self.absolute_install_dir
self.configure_options = ''

self.make_command = 'make'
self.make_options = ''

self.install_command = 'make install'
self.install_options = ''
  • If you need to add to the configure command, set self.configure_options to contain the additional options.
  • If you need to change the configure command to something else, or prepend a string (such as the setting of an environment variable), then modify or replace self.configure_command.
  • If you want to skip the configure step, set self.configure_command to None.
  • The same rules apply to self.make_command and self.install_command.

Customizing the build by overriding unix_package methods

If you need to perform actions in the build before or after the three steps defined above, then you can override the following methods. By default these methods are defined to do nothing.

    def after_extract(self):
        pass

    def before_configure(self):
        pass

    def after_configure(self):
        pass
     def before_make(self):
        pass

    def after_make(self):
        pass

    def before_install(self):
        pass

    def after_install(self):
        pass
  • No labels