'Make task generators to unpack, patch and build
Parameters
bctx : build context
Returns
build_name : str
name of build task, for other tasks to depend on if necessary
dir_node : :class:`Node` instance
node pointing to directory containing unpacked and built sources'

def unpack_patch_build(self, bctx):

    (task_name, dir_node) = self._unpack(bctx)
    if (not (self.patcher is None)):
        if hasattr(self.patcher, '__call__'):
            rule = self.patcher
        else:
            patch_node = bctx.srcnode.find_node(self.patcher)
            if (patch_node is None):
                bctx.fatal('Patch    file    {0}    does    not    exist'.format(self.patcher))
            rule = ('cd    ${SRC}    &&    patch    -p1    <    ' + patch_node.abspath())
        task_name = (self.name + '.patch')
        bctx(rule=rule, source=dir_node, name=task_name)
    build_name = (self.name + '.build')
    bctx(rule=self.build_cmd, source=([dir_node] + self.depends), after=([task_name] + self.after), name=build_name)
    return (build_name, dir_node)
