summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorJohn Lee <john_lee@openmoko.org>2008-02-27 07:50:52 +0000
committerOpenmoko anonymizer key <devel@lists.openmoko.org>2008-02-27 07:50:52 +0000
commitd6f3635f2e2baa680d878461fc8fa9b68c51162b (patch)
treea07627fc6746f21a02a543381681f1cb1320b38d /classes
parentb14906e8fa695a85b9ddf27838c959be1c8a5fad (diff)
parent9d22cb8106117d2d923bf7b2c263bf9e31b5305f (diff)
merge of '8dccbf106093aaa7b62b2a96962945185534c923'
and 'c50825ba187c292f591cf43c91216cebffb5e290'
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass90
-rw-r--r--classes/bootimg.bbclass14
-rw-r--r--classes/debian.bbclass8
-rw-r--r--classes/efl_base.bbclass2
-rw-r--r--classes/image.bbclass14
-rw-r--r--classes/java.bbclass60
-rw-r--r--classes/kernel-arch.bbclass2
-rw-r--r--classes/kernel.bbclass27
-rw-r--r--classes/native.bbclass6
-rw-r--r--classes/nylon-mirrors.bbclass8
-rw-r--r--classes/oplinux-mirrors.bbclass16
-rw-r--r--classes/package.bbclass144
-rw-r--r--classes/package_deb.bbclass34
-rw-r--r--classes/package_ipk.bbclass29
-rw-r--r--classes/package_rpm.bbclass5
-rw-r--r--classes/package_tar.bbclass10
-rw-r--r--classes/packaged-staging.bbclass389
-rw-r--r--classes/packaged-staging2.bbclass229
-rw-r--r--classes/patch.bbclass2
-rw-r--r--classes/qpf.bbclass32
-rw-r--r--classes/rm_work.bbclass20
-rw-r--r--classes/sanity.bbclass66
-rw-r--r--classes/sdl.bbclass2
-rw-r--r--classes/seppuku.bbclass2
-rw-r--r--classes/tinderclient.bbclass2
25 files changed, 543 insertions, 670 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index d48d2a5726..089cd5acd3 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -85,7 +85,7 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data):
def base_dep_prepend(d):
- import bb;
+ import bb
#
# Ideally this will check a flag so we will operate properly in
# the case where host == build == target, for now we don't work in
@@ -128,6 +128,14 @@ def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
else:
return falsevalue
+def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ import bb
+ result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue)
+ if result <= 0:
+ return truevalue
+ else:
+ return falsevalue
+
def base_contains(variable, checkvalues, truevalue, falsevalue, d):
import bb
matches = 0
@@ -404,7 +412,6 @@ python do_listtasks() {
addtask clean
do_clean[dirs] = "${TOPDIR}"
do_clean[nostamp] = "1"
-do_clean[bbdepcmd] = ""
python base_do_clean() {
"""clear the build and temp directories"""
dir = bb.data.expand("${WORKDIR}", d)
@@ -417,27 +424,33 @@ python base_do_clean() {
os.system('rm -f '+ dir)
}
+#Uncomment this for bitbake 1.8.12
+#addtask rebuild after do_${BB_DEFAULT_TASK}
addtask rebuild
do_rebuild[dirs] = "${TOPDIR}"
do_rebuild[nostamp] = "1"
-do_rebuild[bbdepcmd] = ""
python base_do_rebuild() {
"""rebuild a package"""
- bb.build.exec_task('do_clean', d)
- bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d)
+ from bb import __version__
+ try:
+ from distutils.version import LooseVersion
+ except ImportError:
+ def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
+ if (LooseVersion(__version__) < LooseVersion('1.8.11')):
+ bb.build.exec_func('do_clean', d)
+ bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d)
}
addtask mrproper
do_mrproper[dirs] = "${TOPDIR}"
do_mrproper[nostamp] = "1"
-do_mrproper[bbdepcmd] = ""
python base_do_mrproper() {
"""clear downloaded sources, build and temp directories"""
dir = bb.data.expand("${DL_DIR}", d)
if dir == '/': bb.build.FuncFailed("wrong DATADIR")
bb.debug(2, "removing " + dir)
os.system('rm -rf ' + dir)
- bb.build.exec_task('do_clean', d)
+ bb.build.exec_func('do_clean', d)
}
addtask fetch
@@ -658,6 +671,17 @@ python base_eventhandler() {
if pesteruser:
bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+ #
+ # Handle removing stamps for 'rebuild' task
+ #
+ if name.startswith("StampUpdate"):
+ for (fn, task) in e.targets:
+ #print "%s %s" % (task, fn)
+ if task == "do_rebuild":
+ dir = "%s.*" % e.stampPrefix[fn]
+ bb.note("Removing stamps: " + dir)
+ os.system('rm -f '+ dir)
+
if not data in e.__dict__:
return NotHandled
@@ -672,7 +696,6 @@ python base_eventhandler() {
addtask configure after do_unpack do_patch
do_configure[dirs] = "${S} ${B}"
-do_configure[bbdepcmd] = "do_populate_staging"
do_configure[deptask] = "do_populate_staging"
base_do_configure() {
:
@@ -680,7 +703,6 @@ base_do_configure() {
addtask compile after do_configure
do_compile[dirs] = "${S} ${B}"
-do_compile[bbdepcmd] = "do_populate_staging"
base_do_compile() {
if [ -e Makefile -o -e makefile ]; then
oe_runmake || die "make failed"
@@ -774,8 +796,10 @@ def get_subpkgedata_fn(pkg, d):
import bb, os
archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
archs.reverse()
+ pkgdata = bb.data.expand('${STAGING_DIR}/pkgdata/', d)
+ targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
for arch in archs:
- fn = bb.data.expand('${STAGING_DIR}/pkgdata/' + arch + '${TARGET_VENDOR}-${TARGET_OS}/runtime/%s' % pkg, d)
+ fn = pkgdata + arch + targetdir + pkg
if os.path.exists(fn):
return fn
return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
@@ -811,6 +835,20 @@ python read_subpackage_metadata () {
bb.data.setVar(key, sdata[key], d)
}
+# Make sure MACHINE isn't exported
+# (breaks binutils at least)
+MACHINE[unexport] = "1"
+
+# Make sure TARGET_ARCH isn't exported
+# (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
+# in them, undocumented)
+TARGET_ARCH[unexport] = "1"
+
+# Make sure DISTRO isn't exported
+# (breaks sysvinit at least)
+DISTRO[unexport] = "1"
+
+
def base_after_parse(d):
import bb, os, exceptions
@@ -830,8 +868,6 @@ 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
@@ -843,22 +879,6 @@ def base_after_parse(d):
if use_nls != None:
bb.data.setVar('USE_NLS', use_nls, d)
- # Make sure MACHINE isn't exported
- # (breaks binutils at least)
- bb.data.delVarFlag('MACHINE', 'export', d)
- bb.data.setVarFlag('MACHINE', 'unexport', 1, d)
-
- # Make sure TARGET_ARCH isn't exported
- # (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
- # in them, undocumented)
- bb.data.delVarFlag('TARGET_ARCH', 'export', d)
- bb.data.setVarFlag('TARGET_ARCH', 'unexport', 1, d)
-
- # Make sure DISTRO isn't exported
- # (breaks sysvinit at least)
- bb.data.delVarFlag('DISTRO', 'export', d)
- bb.data.setVarFlag('DISTRO', 'unexport', 1, d)
-
# Git packages should DEPEND on git-native
srcuri = bb.data.getVar('SRC_URI', d, 1)
if "git://" in srcuri:
@@ -888,7 +908,7 @@ def base_after_parse(d):
if len(paths) == 0:
return
- for s in bb.data.getVar('SRC_URI', d, 1).split():
+ for s in srcuri.split():
if not s.startswith("file://"):
continue
local = bb.data.expand(bb.fetch.localpath(s, d), d)
@@ -899,7 +919,19 @@ def base_after_parse(d):
return
python () {
+ import bb
+ from bb import __version__
base_after_parse(d)
+
+ # Remove this for bitbake 1.8.12
+ try:
+ from distutils.version import LooseVersion
+ except ImportError:
+ def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
+ if (LooseVersion(__version__) >= LooseVersion('1.8.11')):
+ deps = bb.data.getVarFlag('do_rebuild', 'deps', d) or []
+ deps.append('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1))
+ bb.data.setVarFlag('do_rebuild', 'deps', deps, d)
}
def check_app_exists(app, d):
diff --git a/classes/bootimg.bbclass b/classes/bootimg.bbclass
index 0c96001096..d58cf1f424 100644
--- a/classes/bootimg.bbclass
+++ b/classes/bootimg.bbclass
@@ -13,9 +13,9 @@
# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
do_bootimg[depends] += "dosfstools-native:do_populate_staging \
- syslinux-native:do_populate_staging \
- mtools-native:do_populate_staging \
- cdrtools-native:do_populate_staging"
+ syslinux-native:do_populate_staging \
+ mtools-native:do_populate_staging \
+ cdrtools-native:do_populate_staging"
PACKAGES = " "
@@ -31,6 +31,8 @@ SYSLINUXCFG = "${HDDDIR}/syslinux.cfg"
SYSLINUXMENU = "${HDDDIR}/menu"
inherit syslinux
+
+IMAGE_POSTPROCESS_COMMAND ?= ""
build_boot_bin() {
install -d ${HDDDIR}
@@ -49,13 +51,15 @@ build_boot_bin() {
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
+ install -d ${DEPLOY_DIR_IMAGE}
+
mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
- #Create an ISO if we have an INITRD
+ # Create an ISO if we have an INITRD
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
install -d ${ISODIR}
@@ -78,6 +82,8 @@ build_boot_bin() {
cp ${STAGING_DATADIR_NATIVE}/syslinux/isolinux.bin \
${ISODIR}
+ ${IMAGE_POSTPROCESS_COMMAND}
+
mkisofs -V ${BOOTIMG_VOLUME_ID} \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat -r \
diff --git a/classes/debian.bbclass b/classes/debian.bbclass
index dd0789adae..0afe9fcc39 100644
--- a/classes/debian.bbclass
+++ b/classes/debian.bbclass
@@ -3,6 +3,9 @@
# before building the current package to make the packages runtime
# depends are correct
#
+# Custom library package names can be defined setting
+# DEBIANNAME_ + pkgname to the desired name.
+#
# Better expressed as ensure all RDEPENDS package before we package
# This means we can't have circular RDEPENDS/RRECOMMENDS
do_package_write_ipk[rdeptask] = "do_package"
@@ -88,7 +91,10 @@ python debian_package_name_hook () {
for pkg in packages.split():
if (bb.data.getVar('PKG_' + pkg, d) or bb.data.getVar('DEBIAN_NOAUTONAME_' + pkg, d)):
continue
- if pkg == orig_pkg:
+ debian_pn = bb.data.getVar('DEBIANNAME_' + pkg, d)
+ if debian_pn:
+ newpkg = debian_pn
+ elif pkg == orig_pkg:
newpkg = pkgname
else:
newpkg = pkg.replace(orig_pkg, devname, 1)
diff --git a/classes/efl_base.bbclass b/classes/efl_base.bbclass
index 3865441779..023b2edf74 100644
--- a/classes/efl_base.bbclass
+++ b/classes/efl_base.bbclass
@@ -3,7 +3,7 @@ inherit autotools pkgconfig
SECTION = "e/libs"
HOMEPAGE = "http://www.enlightenment.org"
SRCNAME = "${@bb.data.getVar('PN', d, 1).replace('-native', '')}"
-SRC_URI = "http://download.enlightenment.org/snapshots/2007-07-10/${SRCNAME}-${PV}.tar.gz"
+SRC_URI = "http://download.enlightenment.org/snapshots/2008-01-25/${SRCNAME}-${PV}.tar.gz"
S = "${WORKDIR}/${SRCNAME}-${PV}"
do_stage() {
diff --git a/classes/image.bbclass b/classes/image.bbclass
index ca9c9458e1..67a3a4fa10 100644
--- a/classes/image.bbclass
+++ b/classes/image.bbclass
@@ -35,9 +35,9 @@ python () {
}
#
-# Get a list of files containing device tables to create.
+# Get a list of files containing tables of devices to be created.
# * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
-# * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached
+# * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, searched
# for in the BBPATH
# If neither are specified then the default name of files/device_table-minimal.txt
# is searched for in the BBPATH (same as the old version.)
@@ -90,6 +90,7 @@ fakeroot do_rootfs () {
${IMAGE_PREPROCESS_COMMAND}
export TOPDIR=${TOPDIR}
+ export DISTRO=${USERDISTRO}
export MACHINE=${MACHINE}
for type in ${IMAGE_FSTYPES}; do
@@ -109,6 +110,14 @@ fakeroot do_rootfs () {
${MACHINE_POSTPROCESS_COMMAND}
}
+do_deploy_to[nostamp] = "1"
+do_deploy_to () {
+ # A standalone task to deploy built image to the location specified
+ # by DEPLOY_TO variable (likely passed via environment).
+ # Assumes ${IMAGE_FSTYPES} is a single value!
+ cp "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.${IMAGE_FSTYPES}" ${DEPLOY_TO}
+}
+
insert_feed_uris () {
echo "Building feeds for [${DISTRO}].."
@@ -201,3 +210,4 @@ rootfs_update_timestamp () {
EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs make_zimage_symlink_relative set_image_autologin rootfs_update_timestamp
addtask rootfs before do_build after do_install
+addtask deploy_to after do_rootfs
diff --git a/classes/java.bbclass b/classes/java.bbclass
index 7fa6dc1786..41d52fe425 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -60,3 +60,63 @@ oe_jarinstall() {
shift
done
}
+
+# Creates a simple wrapper script for your Java program.
+# The script is written to ${PN} by default.
+#
+# Parameters are as follows:
+# [options] <output file> <main class> [jar files ...]
+#
+# Options are
+# -o <name> where name is the output file name
+#
+# It can only take jar files from ${datadir_java}!
+oe_java_simple_wrapper() {
+ delimiter=
+ mainclass=
+ classpath=
+ output=${PN}
+
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -o)
+ shift
+ output=$1
+ ;;
+ -*)
+ oefatal "oe_java_simple_wrapper: unknown option: $1"
+ ;;
+ *)
+ if [ $mainclass ]
+ then
+ classpath=$classpath$delimiter${datadir_java}/$1
+ delimiter=":"
+ else
+ mainclass=$1
+ fi
+ ;;
+ esac
+ shift
+ done
+
+ oenote "Creating simple Java wrapper script"
+ oenote "Output File: $output"
+ oenote "Main Class: $mainclass"
+ oenote "Classpath: $classpath"
+
+ echo "#!/bin/sh" > $output
+ echo "# This file is autogenerated by the oe_java_simple_wrapper function of OpenEmbedded" >> $output
+ echo >> $output
+ echo "# You can provide additional VM arguments by setting the VMARGS environment variable." >> $output
+ echo "CLASSPATH_ARG=\"-cp $classpath\"" >> $output
+ echo >> $output
+ echo "MAIN_CLASS=$mainclass" >> $output
+ echo >> $output
+ echo "# Allows overriding the VM by setting the JAVA environment variable." >> $output
+ echo "if [ x\${JAVA} = x ]" >> $output
+ echo "then" >> $output
+ echo " JAVA=java" >> $output
+ echo "fi" >> $output
+ echo >> $output
+ echo "exec \${JAVA} \${VMARGS} \${CLASSPATH_ARG} \${MAIN_CLASS} \${@}" >> $output
+}
diff --git a/classes/kernel-arch.bbclass b/classes/kernel-arch.bbclass
index 9208c3507a..5e5d9a94a8 100644
--- a/classes/kernel-arch.bbclass
+++ b/classes/kernel-arch.bbclass
@@ -5,7 +5,7 @@
#
valid_archs = "alpha cris ia64 \
- x86_64,i386 \
+ x86_64 i386 x86 \
m68knommu m68k ppc powerpc ppc64 \
sparc sparc64 \
arm arm26 \
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 8724ad2cf1..459c553ffe 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -11,6 +11,10 @@ PACKAGES_DYNAMIC += "kernel-image-*"
export OS = "${TARGET_OS}"
export CROSS_COMPILE = "${TARGET_PREFIX}"
KERNEL_IMAGETYPE ?= "zImage"
+# Base filename under which users see built kernel (i.e. deploy name)
+KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}"
+# Symlink basename pointing to the most recently built kernel for a machine
+KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-${MACHINE}"
KERNEL_PRIORITY = "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[-1]}"
@@ -30,6 +34,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}"
KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}"
+# Where built kernel lies in the kernel tree
KERNEL_OUTPUT = "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
KERNEL_IMAGEDEST = "boot"
@@ -60,6 +65,22 @@ kernel_do_compile() {
fi
}
+INITRAMFS_SYMLINK_NAME ?= "initramfs-${MACHINE}"
+INITRAMFS_IMAGE_TARGET ?= "initramfs-image"
+
+do_builtin_initramfs() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_SYMLINK_NAME}" usr/initramfs_data.cpio.gz
+ oe_runmake ${KERNEL_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+ install -d ${DEPLOY_DIR_IMAGE}
+ install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}-initramfs.bin
+ # Make sure to kill injected initramfs, in case someone will do "-c compile -f"
+ rm usr/initramfs_data.cpio.gz
+}
+addtask builtin_initramfs after do_compile
+do_builtin_initramfs[nostamp] = "1"
+do_builtin_initramfs[depends] = "${INITRAMFS_IMAGE_TARGET}:do_rootfs"
+
kernel_do_stage() {
ASMDIR=`readlink include/asm`
@@ -107,6 +128,10 @@ kernel_do_stage() {
if [ -e arch/${ARCH}/Makefile ]; then
install -d ${STAGING_KERNEL_DIR}/arch/${ARCH}
install -m 0644 arch/${ARCH}/Makefile* ${STAGING_KERNEL_DIR}/arch/${ARCH}
+ # Otherwise check arch/x86/Makefile for i386 and x86_64 on kernels >= 2.6.24
+ elif [ -e arch/x86/Makefile ]; then
+ install -d ${STAGING_KERNEL_DIR}/arch/x86
+ install -m 0644 arch/x86/Makefile* ${STAGING_KERNEL_DIR}/arch/x86
fi
cp -fR include/config* ${STAGING_KERNEL_DIR}/include/
install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}
@@ -180,6 +205,8 @@ FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
FILES_kernel-dev = "/boot/System.map* /boot/config*"
FILES_kernel-vmlinux = "/boot/vmlinux*"
RDEPENDS_kernel = "kernel-base"
+RRECOMMENDS_kernel-module-hostap-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
+RRECOMMENDS_kernel-module-orinoco-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
# Allow machines to override this dependency if kernel image files are
# not wanted in images as standard
RDEPENDS_kernel-base ?= "kernel-image"
diff --git a/classes/native.bbclass b/classes/native.bbclass
index d51c675909..934303cc0c 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -49,9 +49,9 @@ export STRIP = "${HOST_PREFIX}strip"
# Path prefixes
-base_prefix = "${exec_prefix}"
-prefix = "${STAGING_DIR}"
-exec_prefix = "${STAGING_DIR}/${BUILD_ARCH}-${BUILD_OS}"
+base_prefix = "${STAGING_DIR}/${BUILD_ARCH}-${BUILD_OS}"
+prefix = "${base_prefix}"
+exec_prefix = "${base_prefix}"
# Base paths
base_bindir = "${base_prefix}/bin"
diff --git a/classes/nylon-mirrors.bbclass b/classes/nylon-mirrors.bbclass
index 25a8b87d9b..02fddc01ba 100644
--- a/classes/nylon-mirrors.bbclass
+++ b/classes/nylon-mirrors.bbclass
@@ -1,6 +1,6 @@
MIRRORS_append () {
-ftp://.*/.*/ http://meshcube.org/nylon/stable/sources/
-https?://.*/.*/ http://meshcube.org/nylon/stable/sources/
-ftp://.*/.*/ http://meshcube.org/nylon/unstable/sources/
-https?://.*/.*/ http://meshcube.org/nylon/unstable/sources/
+ftp://.*/.* http://meshcube.org/nylon/stable/sources/
+https?://.*/.* http://meshcube.org/nylon/stable/sources/
+ftp://.*/.* http://meshcube.org/nylon/unstable/sources/
+https?://.*/.* http://meshcube.org/nylon/unstable/sources/
} \ No newline at end of file
diff --git a/classes/oplinux-mirrors.bbclass b/classes/oplinux-mirrors.bbclass
index c76e822ce3..59c199485c 100644
--- a/classes/oplinux-mirrors.bbclass
+++ b/classes/oplinux-mirrors.bbclass
@@ -2,13 +2,13 @@
# Released under the MIT license (see packages/COPYING)
MIRRORS_append () {
-ftp://.*/.*/ http://digital-opsis.com/oplinux/stable/sources/
-https?://.*/.*/ http://digital-opsis.com/oplinux/stable/sources/
-ftp://.*/.*/ http://digital-opsis.com/oplinux/unstable/sources/
-https?://.*/.*/ http://digital-opsis.com/oplinux/unstable/sources/
+ftp://.*/.* http://digital-opsis.com/oplinux/stable/sources/
+https?://.*/.* http://digital-opsis.com/oplinux/stable/sources/
+ftp://.*/.* http://digital-opsis.com/oplinux/unstable/sources/
+https?://.*/.* http://digital-opsis.com/oplinux/unstable/sources/
-ftp://.*/.*/ http://digital-opsis.com/oplinux-uclibc/stable/sources/
-https?://.*/.*/ http://digital-opsis.com/oplinux-uclibc/stable/sources/
-ftp://.*/.*/ http://digital-opsis.com/oplinux-uclibc/unstable/sources/
-https?://.*/.*/ http://digital-opsis.com/oplinux-uclibc/unstable/sources/
+ftp://.*/.* http://digital-opsis.com/oplinux-uclibc/stable/sources/
+https?://.*/.* http://digital-opsis.com/oplinux-uclibc/stable/sources/
+ftp://.*/.* http://digital-opsis.com/oplinux-uclibc/unstable/sources/
+https?://.*/.* http://digital-opsis.com/oplinux-uclibc/unstable/sources/
}
diff --git a/classes/package.bbclass b/classes/package.bbclass
index ec8c3d97e2..cb4417fc7f 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -291,76 +291,6 @@ python package_do_split_locales() {
#bb.data.setVar('RDEPENDS_%s' % mainpkg, ' '.join(rdep), d)
}
-def copyfile(src,dest,newmtime=None,sstat=None):
- """
- Copies a file from src to dest, preserving all permissions and
- attributes; mtime will be preserved even when moving across
- filesystems. Returns true on success and false on failure.
- """
- import os, stat, shutil, commands
-
- #print "copyfile("+src+","+dest+","+str(newmtime)+","+str(sstat)+")"
- try:
- if not sstat:
- sstat=os.lstat(src)
- except Exception, e:
- print "copyfile: Stating source file failed...", e
- return False
-
- destexists=1
- try:
- dstat=os.lstat(dest)
- except:
- dstat=os.lstat(os.path.dirname(dest))
- destexists=0
-
- if destexists:
- if stat.S_ISLNK(dstat[stat.ST_MODE]):
- try:
- os.unlink(dest)
- destexists=0
- except Exception, e:
- pass
-
- if stat.S_ISLNK(sstat[stat.ST_MODE]):
- try:
- target=os.readlink(src)
- if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
- os.unlink(dest)
- os.symlink(target,dest)
- #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
- return os.lstat(dest)
- except Exception, e:
- print "copyfile: failed to properly create symlink:", dest, "->", target, e
- return False
-
- if stat.S_ISREG(sstat[stat.ST_MODE]):
- try: # For safety copy then move it over.
- shutil.copyfile(src,dest+"#new")
- os.rename(dest+"#new",dest)
- except Exception, e:
- print 'copyfile: copy', src, '->', dest, 'failed.', e
- return False
- else:
- #we don't yet handle special, so we need to fall back to /bin/mv
- a=commands.getstatusoutput("/bin/cp -f "+"'"+src+"' '"+dest+"'")
- if a[0]!=0:
- print "copyfile: Failed to copy special file:" + src + "' to '" + dest + "'", a
- return False # failure
- try:
- os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
- os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
- except Exception, e:
- print "copyfile: Failed to chown/chmod/unlink", dest, e
- return False
-
- if newmtime:
- os.utime(dest,(newmtime,newmtime))
- else:
- os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
- newmtime=sstat[stat.ST_MTIME]
- return newmtime
-
python populate_packages () {
import glob, stat, errno, re
@@ -462,7 +392,7 @@ python populate_packages () {
fpath = os.path.join(root,file)
dpath = os.path.dirname(fpath)
bb.mkdirhier(dpath)
- ret = copyfile(file, fpath)
+ ret = bb.copyfile(file, fpath)
if ret is False or ret == 0:
raise bb.build.FuncFailed("File population failed")
del localdata
@@ -578,16 +508,19 @@ python emit_pkgdata() {
os.chdir(root)
g = glob('*')
if g or allow_empty == "1":
- file(bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d), 'w').close()
+ packagedfile = bb.data.expand('${PKGDATA_DIR}/runtime/%s.packaged' % pkg, d)
+ file(packagedfile, 'w').close()
}
emit_pkgdata[dirs] = "${PKGDATA_DIR}/runtime"
ldconfig_postinst_fragment() {
if [ x"$D" = "x" ]; then
- ldconfig
+ [ -x /sbin/ldconfig ] && /sbin/ldconfig
fi
}
+SHLIBSDIR = "${STAGING_DIR}/${HOST_SYS}/shlibs"
+
python package_do_shlibs() {
import os, re, os.path
@@ -606,25 +539,14 @@ python package_do_shlibs() {
bb.error("WORKDIR not defined")
return
- staging = bb.data.getVar('STAGING_DIR', d, 1)
- if not staging:
- bb.error("STAGING_DIR not defined")
- return
-
ver = bb.data.getVar('PV', d, 1)
if not ver:
bb.error("PV not defined")
return
- target_sys = bb.data.getVar('TARGET_SYS', d, 1)
- if not target_sys:
- bb.error("TARGET_SYS not defined")
- return
-
pkgdest = bb.data.getVar('PKGDEST', d, 1)
- shlibs_dir = os.path.join(staging, target_sys, "shlibs")
- old_shlibs_dir = os.path.join(staging, "shlibs")
+ shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1)
bb.mkdirhier(shlibs_dir)
needed = {}
@@ -681,7 +603,7 @@ python package_do_shlibs() {
shlib_provider = {}
list_re = re.compile('^(.*)\.list$')
- for dir in [old_shlibs_dir, shlibs_dir]:
+ for dir in [shlibs_dir]:
if not os.path.exists(dir):
continue
for file in os.listdir(dir):
@@ -751,20 +673,9 @@ python package_do_pkgconfig () {
bb.error("WORKDIR not defined")
return
- staging = bb.data.getVar('STAGING_DIR', d, 1)
- if not staging:
- bb.error("STAGING_DIR not defined")
- return
-
- target_sys = bb.data.getVar('TARGET_SYS', d, 1)
- if not target_sys:
- bb.error("TARGET_SYS not defined")
- return
-
pkgdest = bb.data.getVar('PKGDEST', d, 1)
- shlibs_dir = os.path.join(staging, target_sys, "shlibs")
- old_shlibs_dir = os.path.join(staging, "shlibs")
+ shlibs_dir = bb.data.getVar('SHLIBSDIR', d, 1)
bb.mkdirhier(shlibs_dir)
pc_re = re.compile('(.*)\.pc$')
@@ -814,7 +725,7 @@ python package_do_pkgconfig () {
f.write('%s\n' % p)
f.close()
- for dir in [old_shlibs_dir, shlibs_dir]:
+ for dir in [shlibs_dir]:
if not os.path.exists(dir):
continue
for file in os.listdir(dir):
@@ -882,14 +793,39 @@ python package_depchains() {
postfixes = (bb.data.getVar('DEPCHAIN_POST', d, 1) or '').split()
prefixes = (bb.data.getVar('DEPCHAIN_PRE', d, 1) or '').split()
+ def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
+
+ #bb.note('depends for %s is %s' % (base, depends))
+ rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
+
+ for depend in depends:
+ if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
+ #bb.note("Skipping %s" % depend)
+ continue
+ if depend.endswith('-dev'):
+ depend = depend.replace('-dev', '')
+ if depend.endswith('-dbg'):
+ depend = depend.replace('-dbg', '')
+ pkgname = getname(depend, suffix)
+ #bb.note("Adding %s for %s" % (pkgname, depend))
+ if not pkgname in rreclist:
+ rreclist.append(pkgname)
+
+ #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+ bb.data.setVar('RRECOMMENDS_%s' % pkg, ' '.join(rreclist), d)
+
def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
- #bb.note('rdepends for %s is %s' % (base, rdepends))
+ #bb.note('rdepends for %s is %s' % (base, rdepends))
rreclist = explode_deps(bb.data.getVar('RRECOMMENDS_' + pkg, d, 1) or bb.data.getVar('RRECOMMENDS', d, 1) or "")
for depend in rdepends:
+ if depend.endswith('-dev'):
+ depend = depend.replace('-dev', '')
+ if depend.endswith('-dbg'):
+ depend = depend.replace('-dbg', '')
pkgname = getname(depend, suffix)
- if not pkgname in rreclist and packaged(pkgname, d):
+ if not pkgname in rreclist:
rreclist.append(pkgname)
#bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
@@ -900,6 +836,10 @@ python package_depchains() {
if dep not in list:
list.append(dep)
+ depends = []
+ for dep in explode_deps(bb.data.getVar('DEPENDS', d, 1) or ""):
+ add_dep(depends, dep)
+
rdepends = []
for dep in explode_deps(bb.data.getVar('RDEPENDS', d, 1) or ""):
add_dep(rdepends, dep)
@@ -932,6 +872,8 @@ python package_depchains() {
for suffix in pkgs:
for pkg in pkgs[suffix]:
(base, func) = pkgs[suffix][pkg]
+ if suffix == "-dev":
+ pkg_adddeprrecs(pkg, base, suffix, func, depends, d)
if len(pkgs[suffix]) == 1:
pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
else:
diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index b85ffe254f..1a3622c3bb 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -54,7 +54,7 @@ python do_package_deb_install () {
# env of the fork+execve'd processs
# Set up environment
- apt_config = os.getenv('APT_CONFIG')
+ apt_config_backup = os.getenv('APT_CONFIG')
os.putenv('APT_CONFIG', os.path.join(stagingdir, 'etc', 'apt', 'apt.conf'))
path = os.getenv('PATH')
os.putenv('PATH', '%s:%s' % (stagingbindir, os.getenv('PATH')))
@@ -64,12 +64,12 @@ python do_package_deb_install () {
commands.getstatusoutput('apt-get install -y %s' % pkgfn)
# revert environment
- os.putenv('APT_CONFIG', apt_config)
+ os.putenv('APT_CONFIG', apt_config_backup)
os.putenv('PATH', path)
}