diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/base.bbclass | 8 | ||||
-rw-r--r-- | classes/cpan.bbclass | 94 | ||||
-rw-r--r-- | classes/gconf.bbclass | 2 | ||||
-rw-r--r-- | classes/insane.bbclass | 26 | ||||
-rw-r--r-- | classes/siteinfo.bbclass | 6 |
5 files changed, 104 insertions, 32 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 1dd3a488b3..9752a1116c 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -804,7 +804,13 @@ def base_after_parse(d): if this_machine and not re.match(need_machine, this_machine): raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) + + pn = bb.data.getVar('PN', d, 1) + # OBSOLETE in bitbake 1.7.4 + srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) + if srcdate != None: + bb.data.setVar('SRCDATE', srcdate, d) use_nls = bb.data.getVar('USE_NLS_%s' % pn, d, 1) if use_nls != None: @@ -874,7 +880,7 @@ def base_oldbitbake_workarounds(d): if bb.data.inherits_class('package_deb', d): depends = "dpkg-native " + depends if bb.data.inherits_class('package', d): - depends = "${PACKAGE_DEPENDS} fakeroot-native" + depends + depends = "${PACKAGE_DEPENDS} fakeroot-native " + depends bb.data.setVar('DEPENDS', depends, d) diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass index a566f0fa42..687dbcd1cb 100644 --- a/classes/cpan.bbclass +++ b/classes/cpan.bbclass @@ -1,38 +1,94 @@ # # This is for perl modules that use the old Makefile.PL build system # -FILES_${PN} += '${libdir}/perl5' -EXTRA_CPANFLAGS = "" +FILES_${PN} += '${libdir}/perl5 ${datadir}/perl5' +EXTRA_CPANFLAGS ?= "" DEPENDS += "perl-native" RDEPENDS += "perl" +# Determine the staged version of perl from the perl configuration file +def get_perl_version(d): + import os, bb, re + cfg = bb.data.expand('${STAGING_DIR}/${HOST_SYS}/perl/config.sh', d) + try: + f = open(cfg, 'r') + except IOError: + return None + l = f.readlines(); + f.close(); + r = re.compile("version='(\d\.\d\.\d)'") + for s in l: + m = r.match(s) + if m: + return m.group(1) + return None + +# Only 5.8.7 and 5.8.4 existed at the time we moved to the new layout +def is_new_perl(d): + ver = get_perl_version(d) + if ver == "5.8.4" or ver == "5.8.7": + return "no" + return "yes" + +# Determine where the library directories are +def perl_get_libdirs(d): + import bb + libdir = bb.data.getVar('libdir', d, 1) + if is_new_perl(d) == "yes": + libdirs = libdir + '/perl5' + else: + libdirs = libdir + '/*/*/perl5' + return libdirs + +def is_target(d): + import bb + if not bb.data.inherits_class('native', d): + return "yes" + return "no" + +IS_NEW_PERL = "${@is_new_perl(d)}" +PERLLIBDIRS = "${@perl_get_libdirs(d)}" + +# Env var which tells perl if it should use host (no) or target (yes) settings +export PERLCONFIGTARGET = "${@is_target(d)}" + cpan_do_configure () { perl Makefile.PL ${EXTRA_CPANFLAGS} if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then . ${STAGING_DIR}/${TARGET_SYS}/perl/config.sh - sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ - -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ - -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ - -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ - -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \ - Makefile + if [ "${IS_NEW_PERL}" = "yes" ]; then + sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ + -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ + -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${datadir}/perl5:" \ + -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5:" \ + -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \ + Makefile + else + sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \ + -e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \ + -e "s:\(INSTALLVENDORLIB = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ + -e "s:\(INSTALLVENDORARCH = \).*:\1${D}${libdir}/perl5/site_perl/${version}:" \ + -e "s:\(LDDLFLAGS.*\)${STAGING_DIR}/${BUILD_SYS}/lib:\1${STAGING_LIBDIR}:" \ + Makefile + fi fi } cpan_do_compile () { - # You must use gcc to link on sh - OPTIONS="" - if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then - OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" - fi - - if test ${TARGET_ARCH} = "powerpc" ; then - OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" + if [ "${IS_NEW_PERL}" = "yes" ]; then + oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" LD="${CCLD}" + else + # You must use gcc to link on sh + OPTIONS="" + if test ${TARGET_ARCH} = "sh3" -o ${TARGET_ARCH} = "sh4"; then + OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" + fi + if test ${TARGET_ARCH} = "powerpc" ; then + OPTIONS="LD=${TARGET_ARCH}-${TARGET_OS}-gcc" + fi + oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS fi - - - oe_runmake PASTHRU_INC="${CFLAGS}" CCFLAGS="${CFLAGS}" $OPTIONS } cpan_do_install () { diff --git a/classes/gconf.bbclass b/classes/gconf.bbclass index 686f8e6596..99f33e433a 100644 --- a/classes/gconf.bbclass +++ b/classes/gconf.bbclass @@ -1,4 +1,4 @@ -DEPENDS += "gconf" +DEPENDS += "gconf gconf-native" gconf_postinst() { if [ "$1" = configure ]; then diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 8ef4858aa4..30b164b734 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -22,6 +22,7 @@ # We play a special package function inherit package PACKAGE_DEPENDS += "pax-utils-native" +#PACKAGE_DEPENDS += chrpath-native" PACKAGEFUNCS += " do_package_qa " @@ -202,19 +203,28 @@ def package_qa_check_rpath(file,name,d): """ import bb, os scanelf = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'scanelf') + #chrpath = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'chrpath') bad_dir = bb.data.getVar('TMPDIR', d, True) + "/work" + bad_dir_test = bb.data.getVar('TMPDIR', d, True) if not os.path.exists(scanelf): - bb.fatal("Can not check RPATH scanelf not found") + bb.fatal("Can not check RPATH, scanelf (part of pax-utils-native) not found") + #if not os.path.exists(chrpath): + # bb.fatal("Can not fix RPATH, chrpath (part of chrpath-native) not found") if not bad_dir in bb.data.getVar('WORKDIR', d, True): bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check") - output = os.popen("%s -Byr %s" % (scanelf,file)) + #bb.note("%s -B -F%%r#F %s" % (scanelf,file)) + output = os.popen("%s -B -F%%r#F %s" % (scanelf,file)) txt = output.readline().split() - if bad_dir in txt: - package_qa_write_error( 1, name, file, d) - bb.error("QA Issue package %s contains bad RPATH %s in file %s" % (name, txt, file)) - return False - + #bb.note("???%s???" % bad_dir_test) + for line in txt: + #bb.note("===%s===" % line) + if bad_dir_test in line: + package_qa_write_error( 1, name, file, d) + bb.error("QA Issue package %s contains bad RPATH %s in file %s" % (name, line, file)) + #bb.note("Fixing RPATH for you in %s" % file) + #os.popen("%s -r /lib %s" % (chrpath,file)) + return False return True def package_qa_check_devdbg(path, name,d): @@ -405,7 +415,7 @@ python do_package_qa () { rdepends_sane = False if not walk_sane or not rdepends_sane: - bb.fatal("QA ran found fatal errors. Please consider fixing them") + bb.fatal("QA run found fatal errors. Please consider fixing them.") bb.note("DONE with PACKAGE QA") } diff --git a/classes/siteinfo.bbclass b/classes/siteinfo.bbclass index 80e6e32af7..6868750d2d 100644 --- a/classes/siteinfo.bbclass +++ b/classes/siteinfo.bbclass @@ -40,9 +40,9 @@ def get_siteinfo_list(d): "mipsel-linux": "endian-little bit-32 common-glibc",\ "mipsel-linux-uclibc": "endian-little bit-32 common-uclibc",\ "powerpc-darwin": "endian-big bit-32 common-darwin",\ - "ppc-linux": "endian-big bit-32 common-glibc",\ - "powerpc-linux": "endian-big bit-32 common-glibc",\ - "powerpc-linux-uclibc": "endian-big bit-32 common-uclibc",\ + "ppc-linux": "endian-big bit-32 common-glibc powerpc-common",\ + "powerpc-linux": "endian-big bit-32 common-glibc powerpc-common",\ + "powerpc-linux-uclibc": "endian-big bit-32 common-uclibc powerpc-common",\ "sh3-linux": "endian-little bit-32 common-glibc sh-common",\ "sh4-linux": "endian-little bit-32 common-glibc sh-common",\ "sh4-linux-uclibc": "endian-little bit-32 common-uclibc sh-common",\ |