import os from bento.commands.hooks \ import \ pre_build @pre_build() def build(context): bld = context.waf_context old_path = bld.path bld.path = old_path.find_dir(context.local_node.path_from(context.top_node)) assert bld.path.__class__ == old_path.__class__ # FIXME: there has to be a better way to refer to numpy/core include includes = [ os.path.join(bld.srcnode.path_from(bld.path), "numpy/core"), os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include"), os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include/numpy"), os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/src/private")] def build(bld, extension): bld(features="c cshlib pyext", target=extension.name, source=extension.sources, includes=includes) context.register_builder("fftpack_lite", build) bld.path = old_path