Enlightenment-x11 meta for building.
[vuplus_openembedded] / classes / base.oeclass
index b2a134c..2d4a21c 100644 (file)
@@ -27,17 +27,25 @@ def base_read_file(filename):
 
 DEPENDS_prepend="${@base_dep_prepend(d)} "
 
-def base_set_filespath(d):
+def base_set_filespath(path, d):
        import os, oe
        filespath = []
-       for p in [ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ]:
+       for p in path:
                overrides = oe.data.getVar("OVERRIDES", d, 1) or ""
                overrides = overrides + ":"
                for o in overrides.split(":"):
                        filespath.append(os.path.join(p, o))
        oe.data.setVar("FILESPATH", ":".join(filespath), d)
 
-FILESPATH = "${@base_set_filespath(d)}"
+FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
+
+def oe_filter(f, str, d):
+       from re import match
+       return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+
+def oe_filter_out(f, str, d):
+       from re import match
+       return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
 
 die() {
        oefatal "$*"
@@ -313,12 +321,15 @@ python base_do_patch() {
                        efile = local
                efile = oe.data.expand(efile, d)
                patches_dir = oe.data.expand(oe.data.getVar('PATCHES_DIR', d), d)
-               oe.mkdirhier(patches_dir)
+               oe.mkdirhier(patches_dir + "/.patches")
                os.chdir(patches_dir)
                cmd = "PATH=\"%s\" patcher" % oe.data.getVar("PATH", d, 1)
                if "pnum" in parm:
                        cmd += " -p %s" % parm["pnum"]
-               cmd += " -n \"%s\" -i %s" % (os.path.basename(efile), efile)
+               # Getting rid of // at the front helps the Cygwin-Users of OE
+               if efile.startswith('//'):
+                       efile = efile[1:]
+               cmd += " -R -n \"%s\" -i %s" % (os.path.basename(efile), efile)
                ret = os.system(cmd)
                if ret != 0:
                        raise oe.build.FuncFailed("'patcher' execution failed")
@@ -393,7 +404,7 @@ python base_do_unpack() {
                        cmd = 'bzip2 -dc %s > %s' % (local, efile)
                elif local.endswith('.zip'):
                        loc = local.rfind('.')
-                       cmd = 'unzip %s' % local
+                       cmd = 'unzip -q %s' % local
                elif os.path.isdir(local):
                        filesdir = os.path.realpath(oe.data.getVar("FILESDIR", localdata, 1))
                        destdir = "."
@@ -413,6 +424,7 @@ python base_do_unpack() {
                                cmd = 'cp %s %s/%s/' % (local, os.getcwd(), destdir)
                if not cmd:
                        continue
+               cmd = "PATH=\"%s\" %s" % (oe.data.getVar('PATH', d, 1), cmd)
                oe.note("Unpacking %s to %s/" % (local, os.getcwd()))
                ret = os.system(cmd)
                if ret != 0:
@@ -576,7 +588,7 @@ def explode_deps(s):
 python read_shlibdeps () {
        packages = (oe.data.getVar('PACKAGES', d, 1) or "").split()
        for pkg in packages:
-               rdepends = explode_deps(oe.data.getVar('RDEPENDS_' + pkg, d, 1) or oe.data.getVar('RDEPENDS', d, 1) or "")
+               rdepends = explode_deps(oe.data.getVar('RDEPENDS_' + pkg, d, 0) or oe.data.getVar('RDEPENDS', d, 0) or "")
                shlibsfile = oe.data.expand("${WORKDIR}/install/" + pkg + ".shlibdeps", d)
                if os.access(shlibsfile, os.R_OK):
                        fd = file(shlibsfile)
@@ -624,7 +636,7 @@ python __anonymous () {
        
        pn = oe.data.getVar('PN', d, 1)
        cvsdate = oe.data.getVar('CVSDATE_%s' % pn, d, 1)
-       if cvsdate:
+       if cvsdate != None:
                oe.data.setVar('CVSDATE', cvsdate, d)
 
        try: