def METHOD_NAME(self):
    """Patch setup.py to provide library and include directories
    for dependencies."""
    if self.spec.satisfies("@:7.1.0"):
        self.VARIANTS_IN_SETUP_CFG.remove("xcb")
    library_dirs = []
    include_dirs = []
    for dep in self.spec.dependencies(deptype="link"):
        query = self.spec[dep.name]
        library_dirs.extend(query.libs.directories)
        include_dirs.extend(query.headers.directories)
    setup = FileFilter("setup.py")
    setup.filter("library_dirs = []", "library_dirs = {0}".format(library_dirs), string=True)
    setup.filter("include_dirs = []", "include_dirs = {0}".format(include_dirs), string=True)
    def variant_to_cfg(variant):
        able = "enable" if "+" + variant in self.spec else "disable"
        return "{0}_{1}=1\n".format(able, variant)
    with open("setup.cfg", "a") as setup:
        setup.write("[build_ext]\n")
        for variant in self.VARIANTS_IN_SETUP_CFG:
            setup.write(variant_to_cfg(variant))
        setup.write("rpath={0}\n".format(":".join(self.rpath)))
        setup.write("[install]\n")