add gtk-binver parsing gtk_binary_version out of .pc file. close #1455
authorMichael Lauer <mickey@vanille-media.de>
Mon, 16 Oct 2006 14:34:44 +0000 (14:34 +0000)
committerMichael Lauer <mickey@vanille-media.de>
Mon, 16 Oct 2006 14:34:44 +0000 (14:34 +0000)
NOTE1: patch based on work of XorA
NOTE2: we might want to make this more generic (i.e. get-pkgconfig-entry) eventually
NOTE3: please adapt this to other gtk-engine versions as suitable

classes/gtk-binver.bbclass [new file with mode: 0644]
packages/gtk-engines/gtk-engines_2.7.4.bb

diff --git a/classes/gtk-binver.bbclass b/classes/gtk-binver.bbclass
new file mode 100644 (file)
index 0000000..d59145e
--- /dev/null
@@ -0,0 +1,9 @@
+def gtkbinver_find(d):
+    import bb
+    try:
+        for line in file( "%s/pkgconfig/gtk+-2.0.pc" % bb.data.getVar('STAGING_DATADIR', d, 1) ).readlines():
+            if line.startswith( "gtk_binary_version" ):
+                # bb.note( "gtk_binary_version = '%s'" % line.split("=")[1].strip() )
+                return line.split("=")[1].strip()
+    except OSError:
+        return "0.0.0"
index 29c20e1..7ad1acc 100644 (file)
@@ -14,14 +14,16 @@ RDEPENDS_gtk-theme-clearlooks = "gtk-engine-clearlooks"
 
 SRC_URI = "${GNOME_MIRROR}/${PN}/2.7/${P}.tar.bz2"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig gtk-binver
 
 PACKAGES_DYNAMIC = "gtk-engine-* gtk-theme-*"
 
 python populate_packages_prepend() {
        import os.path
 
-       engines_root = os.path.join(bb.data.getVar('libdir', d, 1), "gtk-2.0/2.4.0/engines")
+       engines_ver = ['gtk-2.0/', gtkbinver_find(d), '/engines']
+
+       engines_root = os.path.join(bb.data.getVar('libdir', d, 1), ''.join(engines_ver))
        themes_root = os.path.join(bb.data.getVar('datadir', d, 1), "themes")
 
        do_split_packages(d, engines_root, '^lib(.*)\.so$', 'gtk-engine-%s', 'GTK %s theme engine', extra_depends='')