summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/psplash/psplash_git.bb
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core/psplash/psplash_git.bb
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/psplash/psplash_git.bb')
-rw-r--r--meta/recipes-core/psplash/psplash_git.bb111
1 files changed, 111 insertions, 0 deletions
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 0000000000..628ced4d49
--- /dev/null
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,111 @@
1SUMMARY = "Userspace framebuffer boot logo based on usplash"
2DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information."
3HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
4SECTION = "base"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6"
7
8SRCREV = "afd4e228c606a9998feae44a3fed4474803240b7"
9PV = "0.1+git${SRCPV}"
10PR = "r15"
11
12SRC_URI = "git://git.yoctoproject.org/${BPN} \
13 file://psplash-init \
14 ${SPLASH_IMAGES}"
15
16SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
17
18python __anonymous() {
19 oldpkgs = d.getVar("PACKAGES", True).split()
20 splashfiles = d.getVar('SPLASH_IMAGES', True).split()
21 pkgs = []
22 localpaths = []
23 haspng = False
24 for uri in splashfiles:
25 fetcher = bb.fetch2.Fetch([uri], d)
26 flocal = os.path.basename(fetcher.localpath(uri))
27 fbase = os.path.splitext(flocal)[0]
28 outsuffix = fetcher.ud[uri].parm.get("outsuffix")
29 if not outsuffix:
30 if fbase.startswith("psplash-"):
31 outsuffix = fbase[8:]
32 else:
33 outsuffix = fbase
34 if outsuffix.endswith('-img'):
35 outsuffix = outsuffix[:-4]
36 outname = "psplash-%s" % outsuffix
37 if outname == '' or outname in oldpkgs:
38 bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
39 else:
40 pkgs.append(outname)
41 if flocal.endswith(".png"):
42 haspng = True
43 localpaths.append(flocal)
44
45 # Set these so that we have less work to do in do_compile and do_install_append
46 d.setVar("SPLASH_INSTALL", " ".join(pkgs))
47 d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths))
48
49 if haspng:
50 d.appendVar("DEPENDS", " gdk-pixbuf-native")
51
52 d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
53 mlprefix = d.getVar('MLPREFIX', True) or ''
54 pn = d.getVar('PN', True) or ''
55 for p in pkgs:
56 ep = '%s%s' % (mlprefix, p)
57 epsplash = '%s%s' % (mlprefix, 'psplash')
58 d.setVar("FILES_%s" % ep, "${bindir}/%s" % p)
59 d.setVar("ALTERNATIVE_%s" % ep, 'psplash')
60 d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p)
61 d.appendVar("RDEPENDS_%s" % ep, " %s" % pn)
62 if p == "psplash-default":
63 d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep)
64}
65
66S = "${WORKDIR}/git"
67
68inherit autotools pkgconfig update-rc.d update-alternatives
69
70ALTERNATIVE_PRIORITY = "100"
71ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash"
72
73python do_compile () {
74 import shutil
75
76 # Build a separate executable for each splash image
77 workdir = d.getVar('WORKDIR', True)
78 convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
79 destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
80 localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
81 outputfiles = d.getVar('SPLASH_INSTALL', True).split()
82 for localfile, outputfile in zip(localfiles, outputfiles):
83 if localfile.endswith(".png"):
84 outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
85 print(outp[1])
86 fbase = os.path.splitext(localfile)[0]
87 shutil.copyfile("%s-img.h" % fbase, destfile)
88 else:
89 shutil.copyfile(os.path.join(workdir, localfile), destfile)
90 # For some reason just updating the header is not enough, we have to touch the .c
91 # file in order to get it to rebuild
92 os.utime("%s/psplash.c" % d.getVar('S', True), None)
93 bb.build.exec_func("oe_runmake", d)
94 shutil.copyfile("psplash", outputfile)
95}
96
97do_install_append() {
98 install -d ${D}/mnt/.psplash/
99 install -d ${D}${sysconfdir}/init.d/
100 install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
101 install -d ${D}${bindir}
102 for i in ${SPLASH_INSTALL} ; do
103 install -m 0755 $i ${D}${bindir}/$i
104 done
105 rm -f ${D}${bindir}/psplash
106}
107
108FILES_${PN} += "/mnt/.psplash"
109
110INITSCRIPT_NAME = "psplash.sh"
111INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."