mirror of
https://git.yoctoproject.org/poky
synced 2026-06-04 02:00:04 +00:00
recipetool: create: improve extraction of pkg-config / lib deps
* The regexes for PKG_CHECK_MODULES / AC_CHECK_LIB were a bit too strict and thus we were skipping some macros. * Add support for PKG_CHECK_EXISTS * Avoid duplicates in warning on missing pkg-config dependencies * Ignore dependency on musl (since this may come up if it's the selected C library) (From OE-Core rev: c58669fb0977f7f0cb79f252484d5c5ef0dfb7e4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e7bedb91a7
commit
dbe91a3d6a
@@ -383,7 +383,7 @@ class RecipetoolTests(RecipetoolBase):
|
|||||||
@testcase(1194)
|
@testcase(1194)
|
||||||
def test_recipetool_create_git(self):
|
def test_recipetool_create_git(self):
|
||||||
# Ensure we have the right data in shlibs/pkgdata
|
# Ensure we have the right data in shlibs/pkgdata
|
||||||
bitbake('libpng pango libx11 libxext jpeg')
|
bitbake('libpng pango libx11 libxext jpeg libxsettings-client libcheck')
|
||||||
# Try adding a recipe
|
# Try adding a recipe
|
||||||
tempsrc = os.path.join(self.tempdir, 'srctree')
|
tempsrc = os.path.join(self.tempdir, 'srctree')
|
||||||
os.makedirs(tempsrc)
|
os.makedirs(tempsrc)
|
||||||
@@ -397,7 +397,7 @@ class RecipetoolTests(RecipetoolBase):
|
|||||||
checkvars['S'] = '${WORKDIR}/git'
|
checkvars['S'] = '${WORKDIR}/git'
|
||||||
checkvars['PV'] = '1.11+git${SRCPV}'
|
checkvars['PV'] = '1.11+git${SRCPV}'
|
||||||
checkvars['SRC_URI'] = srcuri
|
checkvars['SRC_URI'] = srcuri
|
||||||
checkvars['DEPENDS'] = set(['libjpeg-turbo', 'libpng', 'libx11', 'libxext', 'pango'])
|
checkvars['DEPENDS'] = set(['libcheck', 'libjpeg-turbo', 'libpng', 'libx11', 'libxsettings-client', 'libxext', 'pango'])
|
||||||
inherits = ['autotools', 'pkgconfig']
|
inherits = ['autotools', 'pkgconfig']
|
||||||
self._test_recipe_contents(recipefile, checkvars, inherits)
|
self._test_recipe_contents(recipefile, checkvars, inherits)
|
||||||
|
|
||||||
|
|||||||
@@ -157,12 +157,13 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
|||||||
progclassmap = {'gconftool-2': 'gconf',
|
progclassmap = {'gconftool-2': 'gconf',
|
||||||
'pkg-config': 'pkgconfig'}
|
'pkg-config': 'pkgconfig'}
|
||||||
|
|
||||||
ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'tar-native', 'binutils-native']
|
ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'musl', 'tar-native', 'binutils-native']
|
||||||
ignorelibs = ['socket']
|
ignorelibs = ['socket']
|
||||||
|
|
||||||
pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)[),].*')
|
pkg_re = re.compile('PKG_CHECK_MODULES\(\[?[a-zA-Z0-9_]*\]?, *\[?([^,\]]*)\]?[),].*')
|
||||||
lib_re = re.compile('AC_CHECK_LIB\(\[?([a-zA-Z0-9]*)\]?, .*')
|
pkgce_re = re.compile('PKG_CHECK_EXISTS\(\[?([^,\]]*)\]?[),].*')
|
||||||
progs_re = re.compile('_PROGS?\(\[?[a-zA-Z0-9]*\]?, \[?([^,\]]*)\]?[),].*')
|
lib_re = re.compile('AC_CHECK_LIB\(\[?([^,\]]*)\]?,.*')
|
||||||
|
progs_re = re.compile('_PROGS?\(\[?[a-zA-Z0-9_]*\]?, \[?([^,\]]*)\]?[),].*')
|
||||||
dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?')
|
dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?')
|
||||||
ac_init_re = re.compile('AC_INIT\(([^,]+), *([^,]+)[,)].*')
|
ac_init_re = re.compile('AC_INIT\(([^,]+), *([^,]+)[,)].*')
|
||||||
am_init_re = re.compile('AM_INIT_AUTOMAKE\(([^,]+), *([^,]+)[,)].*')
|
am_init_re = re.compile('AM_INIT_AUTOMAKE\(([^,]+), *([^,]+)[,)].*')
|
||||||
@@ -249,6 +250,13 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
|||||||
if res:
|
if res:
|
||||||
pcdeps.extend([x[0] for x in res])
|
pcdeps.extend([x[0] for x in res])
|
||||||
inherits.append('pkgconfig')
|
inherits.append('pkgconfig')
|
||||||
|
elif keyword == 'PKG_CHECK_EXISTS':
|
||||||
|
res = pkgce_re.search(value)
|
||||||
|
if res:
|
||||||
|
res = dep_re.findall(res.group(1))
|
||||||
|
if res:
|
||||||
|
pcdeps.extend([x[0] for x in res])
|
||||||
|
inherits.append('pkgconfig')
|
||||||
elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
|
elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
|
||||||
inherits.append('gettext')
|
inherits.append('gettext')
|
||||||
elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
|
elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
|
||||||
@@ -313,6 +321,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
|||||||
defines[key] = value
|
defines[key] = value
|
||||||
|
|
||||||
keywords = ['PKG_CHECK_MODULES',
|
keywords = ['PKG_CHECK_MODULES',
|
||||||
|
'PKG_CHECK_EXISTS',
|
||||||
'AM_GNU_GETTEXT',
|
'AM_GNU_GETTEXT',
|
||||||
'AM_GLIB_GNU_GETTEXT',
|
'AM_GLIB_GNU_GETTEXT',
|
||||||
'GETTEXT_PACKAGE',
|
'GETTEXT_PACKAGE',
|
||||||
@@ -375,6 +384,7 @@ class AutotoolsRecipeHandler(RecipeHandler):
|
|||||||
|
|
||||||
recipemap = read_pkgconfig_provides(tinfoil.config_data)
|
recipemap = read_pkgconfig_provides(tinfoil.config_data)
|
||||||
unmapped = []
|
unmapped = []
|
||||||
|
pcdeps = list(set(pcdeps))
|
||||||
for pcdep in pcdeps:
|
for pcdep in pcdeps:
|
||||||
recipe = recipemap.get(pcdep, None)
|
recipe = recipemap.get(pcdep, None)
|
||||||
if recipe:
|
if recipe:
|
||||||
|
|||||||
Reference in New Issue
Block a user