2007-05-30 09:32:36 +00:00
|
|
|
#
|
|
|
|
# cpan-base providers various perl related information needed for building
|
|
|
|
# cpan modules
|
|
|
|
#
|
2010-12-30 20:27:54 +00:00
|
|
|
FILES_${PN} += "${libdir}/perl ${datadir}/perl"
|
2007-05-30 09:32:36 +00:00
|
|
|
|
2007-11-30 14:04:04 +00:00
|
|
|
DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
|
|
|
|
RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
|
2007-05-30 09:32:36 +00:00
|
|
|
|
2011-05-31 07:16:29 +00:00
|
|
|
PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
|
|
|
|
|
2007-05-30 09:32:36 +00:00
|
|
|
# Determine the staged version of perl from the perl configuration file
|
|
|
|
def get_perl_version(d):
|
2009-11-08 22:32:43 +00:00
|
|
|
import re
|
2011-05-31 07:16:29 +00:00
|
|
|
cfg = bb.data.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh', d)
|
2007-05-30 09:32:36 +00:00
|
|
|
try:
|
|
|
|
f = open(cfg, 'r')
|
|
|
|
except IOError:
|
|
|
|
return None
|
|
|
|
l = f.readlines();
|
|
|
|
f.close();
|
2010-07-15 15:03:17 +00:00
|
|
|
r = re.compile("^version='(\d*\.\d*\.\d*)'")
|
2007-05-30 09:32:36 +00:00
|
|
|
for s in l:
|
|
|
|
m = r.match(s)
|
|
|
|
if m:
|
|
|
|
return m.group(1)
|
|
|
|
return None
|
|
|
|
|
|
|
|
# Determine where the library directories are
|
|
|
|
def perl_get_libdirs(d):
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
libdir = d.getVar('libdir', 1)
|
2011-05-31 07:16:29 +00:00
|
|
|
if is_target(d) == "no":
|
|
|
|
libdir += '/perl-native'
|
|
|
|
libdir += '/perl'
|
|
|
|
return libdir
|
2007-05-30 09:32:36 +00:00
|
|
|
|
|
|
|
def is_target(d):
|
|
|
|
if not bb.data.inherits_class('native', d):
|
|
|
|
return "yes"
|
|
|
|
return "no"
|
|
|
|
|
|
|
|
PERLLIBDIRS = "${@perl_get_libdirs(d)}"
|
|
|
|
|
|
|
|
FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
|
|
|
|
${PERLLIBDIRS}/auto/*/*/.debug \
|
|
|
|
${PERLLIBDIRS}/auto/*/*/*/.debug"
|