aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-02-19 22:39:02 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-21 09:32:00 +0000
commit2ddad52ccca07245eea43d9b844c6c7d4b667ca3 (patch)
treee4659e6a0c3b9e4c11b856529abca1c92004e364 /scripts/lib/recipetool/create.py
parent915dea9f89cd737e5ba167c384e8d314c5c23c49 (diff)
downloadopenembedded-core-contrib-2ddad52ccca07245eea43d9b844c6c7d4b667ca3.tar.gz
recipetool: create: improve CMake package mapping
* Package names are actually case sensitive near as I can tell, so we shouldn't be lowercasing them everywhere. * Look for CMake packages in pkgdata and map those back to recipes, so we aren't dependent on the hardcoded mappings (though those are still preserved). * Avoid duplicates in the unmapped package list Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r--scripts/lib/recipetool/create.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 3e4bab8afe..7560cdf7cc 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -43,6 +43,7 @@ def tinfoil_init(instance):
class RecipeHandler(object):
recipelibmap = {}
recipeheadermap = {}
+ recipecmakefilemap = {}
@staticmethod
def load_libmap(d):
@@ -90,15 +91,18 @@ class RecipeHandler(object):
RecipeHandler.recipelibmap['GLESv2'] = 'virtual/libgles2'
@staticmethod
- def load_headermap(d):
- '''Build up lib headerfile->recipe mapping'''
+ def load_devel_filemap(d):
+ '''Build up development file->recipe mapping'''
if RecipeHandler.recipeheadermap:
return
+ pkgdata_dir = d.getVar('PKGDATA_DIR', True)
includedir = d.getVar('includedir', True)
+ cmakedir = os.path.join(d.getVar('libdir', True), 'cmake')
for pkg in glob.glob(os.path.join(pkgdata_dir, 'runtime', '*-dev')):
with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
pn = None
headers = []
+ cmakefiles = []
for line in f:
if line.startswith('PN:'):
pn = line.split(':', 1)[-1].strip()
@@ -108,9 +112,14 @@ class RecipeHandler(object):
for fullpth in sorted(dictval):
if fullpth.startswith(includedir) and fullpth.endswith('.h'):
headers.append(os.path.relpath(fullpth, includedir))
+ elif fullpth.startswith(cmakedir) and fullpth.endswith('.cmake'):
+ cmakefiles.append(os.path.relpath(fullpth, cmakedir))
if pn and headers:
for header in headers:
RecipeHandler.recipeheadermap[header] = pn
+ if pn and cmakefiles:
+ for fn in cmakefiles:
+ RecipeHandler.recipecmakefilemap[fn] = pn
@staticmethod
def checkfiles(path, speclist, recursive=False):
@@ -172,7 +181,7 @@ class RecipeHandler(object):
deps.append(recipe)
elif recipe is None:
if header:
- RecipeHandler.load_headermap(d)
+ RecipeHandler.load_devel_filemap(d)
recipe = RecipeHandler.recipeheadermap.get(header, None)
if recipe:
deps.append(recipe)