Patchwork [v2,2/8] clutter.bbclass: helper class for clutter and friends

login
register
mail settings
Submitter Tomas Frydrych
Date May 20, 2013, 3:05 p.m.
Message ID <1369062325-30335-3-git-send-email-tf+lists.yocto@r-finger.com>
Download mbox | patch
Permalink /patch/50147/
State New
Headers show

Comments

Tomas Frydrych - May 20, 2013, 3:05 p.m.
From: Tomas Frydrych <tomas@sleepfive.com>


Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
---
 meta/classes/clutter.bbclass |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 meta/classes/clutter.bbclass
Ross Burton - May 21, 2013, 9:52 a.m.
Hi Tomas,

On Monday, 20 May 2013, Tomas Frydrych wrote:

> +def get_minor_dir(v):
> +    import re
> +    m = re.match("^([0-9]+)\.([0-9]+)", v)
> +    return "%s.%s" % (m.group(1), m.group(2))
>
>
Just an observation not a critic, but I'd love to see these centralised,
we've got the same logic duplicated all over the place now.

+def get_fpu_setting(bb, d):
> +    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
> +        return "--without-fpu"
> +    return ""
>
> This option isn't used by Clutter or cogl anymore, so you can drop this
function.

Ross

Patch

diff --git a/meta/classes/clutter.bbclass b/meta/classes/clutter.bbclass
new file mode 100644
index 0000000..184fb44
--- /dev/null
+++ b/meta/classes/clutter.bbclass
@@ -0,0 +1,28 @@ 
+
+def get_minor_dir(v):
+    import re
+    m = re.match("^([0-9]+)\.([0-9]+)", v)
+    return "%s.%s" % (m.group(1), m.group(2))
+
+def get_real_name(n):
+    import re
+    m = re.match("^([a-z]+(-[a-z]+)?)(-[0-9]+\.[0-9]+)?", n)
+    return "%s" % (m.group(1))
+
+VERMINOR = "${@get_minor_dir("${PV}")}"
+REALNAME = "${@get_real_name("${BPN}")}"
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${REALNAME}-${PV}", "${FILE_DIRNAME}/${REALNAME}-${VERMINOR}", "${FILE_DIRNAME}/${REALNAME}", "${FILE_DIRNAME}/files"], d)}"
+
+def get_fpu_setting(bb, d):
+    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+        return "--without-fpu"
+    return ""
+
+CLUTTER_SRC_FTP = "${GNOME_MIRROR}/${REALNAME}/${VERMINOR}/${REALNAME}-${PV}.tar.xz;name=archive"
+
+CLUTTER_SRC_GIT = "git://git.gnome.org/${REALNAME};protocol=git"
+
+SRC_URI = "${CLUTTER_SRC_FTP}"
+S = "${WORKDIR}/${REALNAME}-${PV}"
+
+inherit autotools pkgconfig gtk-doc gettext