Automatically add build dependency on pkgconfig 23/28823/1
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 10 Oct 2014 13:21:39 +0000 (15:21 +0200)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 10 Oct 2014 13:25:59 +0000 (15:25 +0200)
If a spec file contains a build dependecy with the form
'pkgconfig(<pkg-name>)', automatically add a build dependency on
pkgconfig.

Change-Id: If6b3876658658859d4a5576b9678fb6fdf255d04
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
tools/spec2yocto.py

index 0313dcc..16497fa 100755 (executable)
@@ -1375,9 +1375,14 @@ Group: devel
         '''
         package_replacement = SPEC2YOCTO_CONFIG.get_substitute()
         build_requires_res = []
+        pkgconfig = 0
         for line in lines:
             build_requires = re.findall( RePattern.buildRequiresPackage, line )
             for tmp_res in build_requires:
+                # If a dependency uses pkgconfig, explicitely add pkgconfig as a dependency.
+                if pkgconfig == 0 and 'pkgconfig' in tmp_res:
+                    build_requires_res.append(['pkgconfig', '', ''])
+                    pkgconfig = 1
                 for tmp_clean in self.__clean_package_line( tmp_res ):
                     if len( tmp_clean ) >= 1:
                         if tmp_clean[0] in package_replacement.keys():