def evaluate_path(self, path, include_bundle=True): p = re.compile("^\${prefix}") path = p.sub(self.get_prefix(), path) p = re.compile("^\${prefix:(.*?)}") m = p.match(path) if m: path = p.sub(self.get_prefix(m.group(1)), path) p = re.compile("^\${project}") path = p.sub(self.project_dir, path) try: p = re.compile("\${name}") path = p.sub(self.name, path) except AttributeError: pass # can be used before name path is set if include_bundle: try: p = re.compile("^\${bundle}") path = p.sub(self.get_bundle_path(), path) except AttributeError: pass # can be used before bundle path is set path = utils.evaluate_environment_variables(path) path = utils.evaluate_pkgconfig_variables(path) return os.path.normpath(path)
def __init__(self, node): self.prefixes = {} prefixes = utils.node_get_elements_by_tag_name(node, "prefix") for child in prefixes: name = child.getAttribute("name") if len(name) == 0: name = "default" value = utils.evaluate_environment_variables( utils.node_get_string(child)) self.prefixes[name] = value child = utils.node_get_element_by_tag_name(node, "image") if child: pass # FIXME: implement child = utils.node_get_element_by_tag_name(node, "run-install-name-tool") if child: self.run_install_name_tool = True else: self.run_install_name_tool = False child = utils.node_get_element_by_tag_name(node, "destination") self.overwrite = utils.node_get_property_boolean( child, "overwrite", False) self.dest = utils.node_get_string(child, "${project}")
def __init__(self, node): self.prefixes = {} prefixes = utils.node_get_elements_by_tag_name(node, "prefix") for child in prefixes: name = child.getAttribute("name") if len(name) == 0: name = "default" value = utils.evaluate_environment_variables(utils.node_get_string(child)) self.prefixes[name] = value child = utils.node_get_element_by_tag_name(node, "image") if child: pass # FIXME: implement child = utils.node_get_element_by_tag_name(node, "run-install-name-tool") if child: self.run_install_name_tool = True else: self.run_install_name_tool = False child = utils.node_get_element_by_tag_name(node, "destination") self.overwrite = utils.node_get_property_boolean(child, "overwrite", False) self.dest = utils.node_get_string(child, "${project}") child = utils.node_get_element_by_tag_name(node, "gtk") if child: self.gtk = utils.node_get_string(child) else: self.gtk = "gtk+-2.0"