2010-09-27 14:44:05 +00:00
SUMMARY = " Userspace framebuffer boot logo based on usplash. "
DESCRIPTION = " 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. "
2011-08-25 18:20:21 +00:00
HOMEPAGE = " http://git.yoctoproject.org/cgit/cgit.cgi/psplash "
2006-09-28 14:20:06 +00:00
SECTION = " base "
2010-06-10 07:20:49 +00:00
LICENSE = " GPLv2+ "
2012-07-09 15:27:44 +00:00
LIC_FILES_CHKSUM = " file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6 "
2010-06-10 07:20:49 +00:00
2013-03-12 14:54:11 +00:00
SRCREV = " afd4e228c606a9998feae44a3fed4474803240b7 "
2011-08-25 18:20:21 +00:00
PV = " 0.1+git${SRCPV} "
2013-03-12 14:54:11 +00:00
PR = " r7 "
2006-09-28 14:20:06 +00:00
2011-08-25 18:20:21 +00:00
SRC_URI = " git://git.yoctoproject.org/${BPN};protocol=git \
2011-01-16 13:34:05 +00:00
file : / / psplash - init \
2012-02-23 19:30:32 +00:00
$ { SPLASH_IMAGES } "
SPLASH_IMAGES = " file://psplash-poky-img.h;outsuffix=default "
python _ _ anonymous ( ) {
oldpkgs = d . getVar ( " PACKAGES " , True ) .split ( )
splashfiles = d . getVar ( ' SPLASH_IMAGES ' , True ) .split ( )
pkgs = [ ]
localpaths = [ ]
haspng = False
for uri in splashfiles :
fetcher = bb . fetch2 .Fetch ( [ uri ] , d )
flocal = fetcher . localpath ( uri )
fbase = os . path .splitext ( os . path .basename ( flocal ) ) [ 0 ]
outsuffix = fetcher . ud [ uri ] .parm .get ( " outsuffix " )
if not outsuffix :
if fbase . startswith ( " psplash- " ) :
outsuffix = fbase [ 8 : ]
else :
outsuffix = fbase
if outsuffix . endswith ( ' - img ' ) :
outsuffix = outsuffix [ : - 4 ]
outname = " psplash-%s " % outsuffix
if outname = = ' ' or outname in oldpkgs :
bb . fatal ( " The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter " % ( outname , uri ) )
else :
pkgs . append ( outname )
if flocal . endswith ( " .png " ) :
haspng = True
localpaths . append ( flocal )
# Set these so that we have less work to do in do_compile and do_install_append
d . setVar ( " SPLASH_INSTALL " , " " .join ( pkgs ) )
d . setVar ( " SPLASH_LOCALPATHS " , " " .join ( localpaths ) )
if haspng :
d . appendVar ( " DEPENDS " , " gdk-pixbuf-native " )
d . prependVar ( " PACKAGES " , " %s " % ( " " .join ( pkgs ) ) )
2012-12-14 16:20:04 +00:00
mlprefix = d . getVar ( ' MLPREFIX ' , True ) or ' '
pn = d . getVar ( ' PN ' , True ) or ' '
2012-02-23 19:30:32 +00:00
for p in pkgs :
2012-12-14 16:20:04 +00:00
ep = ' % s % s ' % ( mlprefix , p )
epsplash = ' % s % s ' % ( mlprefix , ' psplash ' )
d . setVar ( " FILES_%s " % ep , " ${bindir}/%s " % p )
d . setVar ( " ALTERNATIVE_%s " % ep , epsplash )
d . setVarFlag ( " ALTERNATIVE_TARGET_%s " % ep , epsplash , ' $ { bindir } / % s ' % p )
d . appendVar ( " RDEPENDS_%s " % ep , " %s " % pn )
2012-02-23 19:30:32 +00:00
if p = = " psplash-default " :
2012-12-14 16:20:04 +00:00
d . appendVar ( " RRECOMMENDS_%s " % pn , " %s " % ep )
2012-02-23 19:30:32 +00:00
}
2006-09-28 14:20:06 +00:00
2011-08-25 18:20:21 +00:00
S = " ${WORKDIR}/git "
2006-09-28 14:20:06 +00:00
2012-05-15 23:35:15 +00:00
inherit autotools pkgconfig update - rc . d update - alternatives
ALTERNATIVE_PRIORITY = " 100 "
ALTERNATIVE_LINK_NAME [ psplash ] = " ${bindir}/psplash "
2006-09-28 14:20:06 +00:00
2012-02-23 19:30:32 +00:00
python do_compile ( ) {
psplash: Add mising commands module import.
Python commands module is used in the recipe, but never imported.
This leads to build errors like:
NameError: global name 'commands' is not defined
ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "do_compile", line 24, in <module>
ERROR:
ERROR: File "do_compile", line 11, in do_compile
ERROR:
ERROR: The code that was being executed was:
ERROR: 0020: bb.build.exec_func("oe_runmake", d)
ERROR: 0021: shutil.copyfile("psplash", outputfile)
ERROR: 0022:
ERROR: 0023:
ERROR: *** 0024:do_compile(d)
ERROR: 0025:
ERROR: (file: 'do_compile', lineno: 24, function: <module>)
ERROR: 0007: localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
ERROR: 0008: outputfiles = d.getVar('SPLASH_INSTALL', True).split()
ERROR: 0009: for localfile, outputfile in zip(localfiles, outputfiles):
ERROR: 0010: if localfile.endswith(".png"):
ERROR: *** 0011: outp = commands.getstatusoutput('./make-image-header.sh %s POKY' % localfile)
ERROR: 0012: print(outp[1])
ERROR: 0013: fbase = os.path.splitext(os.path.basename(localfile))[0]
ERROR: 0014: shutil.copyfile("%s-img.h" % fbase, destfile)
ERROR: 0015: else:
(From OE-Core rev: 34bdb9a459208377210454e54635afb9404ee126)
Signed-off-by: Peter Tworek <tworaz666@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-06 17:03:13 +00:00
import shutil , commands
2006-09-28 14:20:06 +00:00
2012-02-23 19:30:32 +00:00
# Build a separate executable for each splash image
destfile = " %s/psplash-poky-img.h " % d . getVar ( ' S ' , True )
localfiles = d . getVar ( ' SPLASH_LOCALPATHS ' , True ) .split ( )
outputfiles = d . getVar ( ' SPLASH_INSTALL ' , True ) .split ( )
for localfile , outputfile in zip ( localfiles , outputfiles ) :
if localfile . endswith ( " .png " ) :
outp = commands . getstatusoutput ( ' . / make - image - header . sh % s POKY ' % localfile )
print ( outp [ 1 ] )
fbase = os . path .splitext ( os . path .basename ( localfile ) ) [ 0 ]
shutil . copyfile ( " %s-img.h " % fbase , destfile )
else :
shutil . copyfile ( localfile , destfile )
# For some reason just updating the header is not enough , we have to touch the . c
# file in order to get it to rebuild
2013-03-18 01:32:16 +00:00
os . utime ( " %s/psplash.c " % d . getVar ( ' S ' , True ) , None )
2012-02-23 19:30:32 +00:00
bb . build .exec_func ( " oe_runmake " , d )
shutil . copyfile ( " psplash " , outputfile )
2011-01-16 13:34:05 +00:00
}
2012-02-23 19:30:32 +00:00
do_install_append ( ) {
2006-09-28 14:20:06 +00:00
install - d $ { D } / mnt / .psplash /
install - d $ { D } $ { sysconfdir } / init . d /
2008-08-19 21:42:36 +00:00
install - m 0755 $ { WORKDIR } / psplash - init $ { D } $ { sysconfdir } / init . d / psplash . sh
2012-02-23 19:30:32 +00:00
install - d $ { D } $ { bindir }
for i in $ { SPLASH_INSTALL } ; do
install - m 0755 $ i $ { D } $ { bindir } / $ i
done
rm - f $ { D } $ { bindir } / psplash
2006-09-28 14:20:06 +00:00
}
2012-02-23 19:30:32 +00:00
FILES_ $ { PN } + = " /mnt/.psplash "
2008-08-19 21:42:36 +00:00
INITSCRIPT_NAME = " psplash.sh "
2006-09-28 14:20:06 +00:00
INITSCRIPT_PARAMS = " start 0 S . stop 20 0 1 6 . "