+inherit base
+
+DEPENDS_prepend = "pkgconfig-native "
+
+def get_pkgconfig_mangle(d):
+ import oe.data
+ s = "-e ''"
+ if not oe.data.inherits_class('native', d):
+ s += " -e 's:${libdir}:${STAGING_LIBDIR}:;'"
+ s += " -e 's:${includedir}:${STAGING_INCDIR}:;'"
+ s += " -e 's:${datadir}:${STAGING_DATADIR}:'"
+ s += " -e 's:${prefix}:${STAGING_LIBDIR}/..:'"
+ s += " -e 's:${exec_prefix}:${STAGING_LIBDIR}/..:'"
+ return s
+
+do_stage_append () {
+ for pc in `find ${S} -name '*.pc'`; do
+ pcname=`basename $pc`
+ install -d ${PKG_CONFIG_PATH}
+ cat $pc | sed ${@get_pkgconfig_mangle(d)} > ${PKG_CONFIG_PATH}/$pcname
+ done
+}