diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/cmake.bbclass | 7 | ||||
-rw-r--r-- | classes/concatenated-image.bbclass | 38 | ||||
-rw-r--r-- | classes/insane.bbclass | 5 | ||||
-rw-r--r-- | classes/java-library.bbclass | 37 | ||||
-rw-r--r-- | classes/java.bbclass | 62 | ||||
-rw-r--r-- | classes/module-base.bbclass | 4 | ||||
-rw-r--r-- | classes/module.bbclass | 3 | ||||
-rw-r--r-- | classes/sanity.bbclass | 3 | ||||
-rw-r--r-- | classes/sdl.bbclass | 36 |
9 files changed, 170 insertions, 25 deletions
diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass new file mode 100644 index 0000000000..cec74349dc --- /dev/null +++ b/classes/cmake.bbclass @@ -0,0 +1,7 @@ +inherit autotools + +cmake_do_configure() { + cmake . -DCMAKE_INSTALL_PREFIX:PATH=${prefix} +} + +EXPORT_FUNCTIONS do_configure diff --git a/classes/concatenated-image.bbclass b/classes/concatenated-image.bbclass new file mode 100644 index 0000000000..5cf8d33c05 --- /dev/null +++ b/classes/concatenated-image.bbclass @@ -0,0 +1,38 @@ + +# +# define the FLASH_KERNEL_SIZE and FLASH_ROOT_SIZE in your machine.conf, +# and this class builds a simple, padded concatenated image of +# <kernel><padding><rootfs> and performs error checking that either +# kernel or rootfs isn't too large to fit. +# +concat_pack_image() { + # find latest kernel - is there a more general way to do this? + KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}* | tail -n 1` + if [ -z "$KERNEL" ]; then + oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Was expecting a ${KERNEL_IMAGETYPE}\* file." + exit 1 + fi + ROOTFS=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 + OUTPUT=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flash.img + PADFILE=${DEPLOY_DIR_IMAGE}/padfile.zzz + KERNEL_SIZE_MAX_DEC=`echo ${FLASH_KERNEL_SIZE} | awk --non-decimal-data '{printf "%d\n", $1}' ` + ROOT_SIZE_MAX_DEC=`echo ${FLASH_ROOT_SIZE} | awk --non-decimal-data '{printf "%d\n", $1}' ` + KERNEL_SIZE=`ls -l $KERNEL | awk '{print $5}'` + if [ $KERNEL_SIZE -gt $KERNEL_SIZE_MAX_DEC ]; then + oefatal "Kernel too large at $KERNEL_SIZE bytes. Max is $KERNEL_SIZE_MAX_DEC." + exit 1 + fi + ROOT_SIZE=`ls -l $ROOTFS | awk '{print $5}'` + if [ $ROOT_SIZE -gt $ROOT_SIZE_MAX_DEC ]; then + oefatal "Rootfs is too large at $ROOT_SIZE bytes. Max is $ROOT_SIZE_MAX_DEC." + exit 1 + fi + PAD_SIZE=`echo "$KERNEL_SIZE_MAX_DEC - $KERNEL_SIZE" | bc ` + dd if=/dev/zero of=$PADFILE bs=$PAD_SIZE count=1 2>>/dev/null + cat $KERNEL $PADFILE $ROOTFS > $OUTPUT + rm -f $PADFILE + ls -l $OUTPUT +} + +IMAGE_POSTPROCESS_COMMAND += "concat_pack_image; " + diff --git a/classes/insane.bbclass b/classes/insane.bbclass index 840ebf6eff..97cf036dd9 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -464,7 +464,6 @@ python do_qa_configure() { os.path.join(root,"config.log") if "config.log" in files: if os.system(statement) == 0: - bb.fatal("This autoconf log indicates errors, it looked at \ - host includes. Rerun configure task after fixing this. \ - Path was '%s'" % root) + bb.fatal("""This autoconf log indicates errors, it looked at host includes. +Rerun configure task after fixing this. The path was '%s'""" % root) } diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass new file mode 100644 index 0000000000..8aecfef1b9 --- /dev/null +++ b/classes/java-library.bbclass @@ -0,0 +1,37 @@ +# Inherit this bbclass for each java recipe that builds a Java library (jar file[s]). +# +# It automatically adds important build dependencies, defines JPN (Java Package Name) +# a package named ${JPN} whose contents are those of ${datadir}/java (the jar location). +# +# The JPN is basically lib${PN}-java but takes care of the fact that ${PN} already +# starts with "lib" and/or ends with "-java". In case the "lib" prefix is part of +# your package's normal name (e.g. liberator) the guessing is wrong and you have +# to set JPN manually! + +inherit java + +def java_package_name(d): + import bb; + + pre="" + post="" + + pn = bb.data.getVar('PN', d, 1) + if not pn.startswith("lib"): + pre='lib' + + if not pn.endswith("-java"): + post='-java' + + return pre + pn + post + +JPN ?= "${@java_package_name(d)}" + +DEPENDS_prepend = "virtual/javac-native fastjar-native " + +PACKAGES = "${JPN}" + +PACKAGE_ARCH_${JPN} = "all" + +FILES_${JPN} = "${datadir_java}" + diff --git a/classes/java.bbclass b/classes/java.bbclass new file mode 100644 index 0000000000..7fa6dc1786 --- /dev/null +++ b/classes/java.bbclass @@ -0,0 +1,62 @@ +# Defines the commonly used target directories and provides a convenience +# function to install jar files. + +# Jar location on target +datadir_java ?= ${datadir}/java + +# JNI library location on target +libdir_jni ?= ${libdir}/jni + +STAGING_DATADIR_JAVA ?= ${STAGING_DATADIR}/java +STAGING_LIBDIR_JNI ?= ${STAGING_LIBDIR}/jni + +oe_jarinstall() { + # Purpose: Install a jar file and create all the given symlinks to it. + # Example: + # oe_jarinstall foo-1.3.jar foo.jar + # Installs foo-1.3.jar and creates symlink foo.jar. + # + # oe_jarinstall -s foo-1.3.jar foo.jar + # Installs foo-1.3.jar to staging and creates symlink foo.jar. + # + # oe_jarinstall -r foo-1.3.jar foo_1_3.jar foo.jar + # Installs foo_1_3.jar as foo-1.3.jar and creates a symlink to this. + # + dir=${D}${datadir_java} + destname="" + while [ "$#" -gt 0 ]; do + case "$1" in + -s) + dir=${STAGING_DATADIR_JAVA} + ;; + -r) + shift + destname=$1 + ;; + -*) + oefatal "oe_jarinstall: unknown option: $1" + ;; + *) + break; + ;; + esac + shift + done + + jarname=$1 + destname=${destname:-`basename $jarname`} + shift + + install -d $dir + install -m 0644 $jarname $dir/$destname + + # Creates symlinks out of the remaining arguments. + while [ "$#" -gt 0 ]; do + if [ -e $dir/$1 ]; then + oewarn "file was in the way. removing:" $dir/$1 + rm $dir/$1 + fi + ln -s $destname $dir/$1 + shift + done +} diff --git a/classes/module-base.bbclass b/classes/module-base.bbclass index da5bd01dae..c98baceeab 100644 --- a/classes/module-base.bbclass +++ b/classes/module-base.bbclass @@ -10,6 +10,7 @@ export KERNEL_SOURCE = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-source') KERNEL_OBJECT_SUFFIX = "${@[".o", ".ko"][base_read_file('${STAGING_KERNEL_DIR}/kernel-abiversion') > "2.6.0"]}" KERNEL_CCSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ccsuffix')}" KERNEL_LDSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-ldsuffix')}" +KERNEL_ARSUFFIX = "${@base_read_file('${STAGING_KERNEL_DIR}/kernel-arsuffix')}" # Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture # specific options necessary for building the kernel and modules. @@ -17,9 +18,12 @@ TARGET_CC_KERNEL_ARCH ?= "" HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}" TARGET_LD_KERNEL_ARCH ?= "" HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}" +TARGET_AR_KERNEL_ARCH ?= "" +HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}" KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc${KERNEL_CCSUFFIX} ${HOST_CC_KERNEL_ARCH}" KERNEL_LD = "${LD}${KERNEL_LDSUFFIX} ${HOST_LD_KERNEL_ARCH}" +KERNEL_AR = "${AR}${KERNEL_ARSUFFIX} ${HOST_AR_KERNEL_ARCH}" # kernel modules are generally machine specific PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/classes/module.bbclass b/classes/module.bbclass index 7083076b5f..1d0f1dd4f8 100644 --- a/classes/module.bbclass +++ b/classes/module.bbclass @@ -9,7 +9,8 @@ module_do_compile() { KERNEL_SRC=${STAGING_KERNEL_DIR} \ KERNEL_VERSION=${KERNEL_VERSION} \ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ - ${MAKE_TARGETS} + AR="${KERNEL_AR}" \ + ${MAKE_TARGETS} } module_do_install() { diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index bbc06d9697..9994febf0d 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -83,9 +83,6 @@ def check_sanity(e): if not check_app_exists('${BUILD_PREFIX}g++', e.data): missing = missing + "C++ Compiler (${BUILD_PREFIX}g++)," - if not check_app_exists('${BUILD_PREFIX}gfortran', e.data): - missing = missing + "GNU Fortran Compiler" - required_utilities = "patch help2man diffstat texi2html makeinfo cvs svn bzip2 tar gzip gawk md5sum" for util in required_utilities.split(): diff --git a/classes/sdl.bbclass b/classes/sdl.bbclass index d478d97f18..23cbf10919 100644 --- a/classes/sdl.bbclass +++ b/classes/sdl.bbclass @@ -4,41 +4,41 @@ DEPENDS += "virtual/libsdl libsdl-mixer libsdl-image" -APPDESKTOP ?= "${PN}.desktop" +APPDESKTOP ?= "${WORKDIR}/${PN}.desktop" APPNAME ?= "${PN}" -APPIMAGE ?= "${PN}.png" +APPIMAGE ?= "${WORKDIR}/${PN}.png" sdl_do_sdl_install() { - install -d ${D}${palmtopdir}/bin - install -d ${D}${palmtopdir}/pics - install -d ${D}${palmtopdir}/apps/Games - ln -sf ${bindir}/${APPNAME} ${D}${palmtopdir}/bin/${APPNAME} - install -m 0644 ${APPIMAGE} ${D}${palmtopdir}/pics/${PN}.png + install -d ${D}${datadir}/applications + install -d ${D}${datadir}/pixmaps + + install -m 0644 ${APPIMAGE} ${D}${datadir}/pixmaps/${PN}.png if [ -e "${APPDESKTOP}" ] then - echo ${APPDESKTOP} present, installing to palmtopdir... - install -m 0644 ${APPDESKTOP} ${D}${palmtopdir}/apps/Games/${PN}.desktop + echo ${APPDESKTOP} present, using it... + install -m 0644 ${APPDESKTOP} ${D}${datadir}/applications/ else echo ${APPDESKTOP} not present, creating one on-the-fly... - cat >${D}${palmtopdir}/apps/Games/${PN}.desktop <<EOF + cat >${D}${datadir}/applications/${PN}.desktop <<EOF [Desktop Entry] -Note=Auto Generated... this may be not what you want +Name=${PN} Comment=${DESCRIPTION} +Note=Auto Generated by OE SDL bbclass Exec=${APPNAME} Icon=${PN}.png Type=Application -Name=${PN} +Categories=Games EOF fi } EXPORT_FUNCTIONS do_sdl_install -addtask sdl_install after do_compile before do_populate_staging +addtask sdl_install after do_install before do_package -SECTION = "x11/games" -SECTION_${PN}-opie = "opie/games" +#SECTION = "x11/games" +#SECTION_${PN}-opie = "opie/games" -PACKAGES += "${PN}-opie" -RDEPENDS_${PN}-opie += "${PN}" -FILES_${PN}-opie = "${palmtopdir}" +#PACKAGES += "${PN}-opie" +#RDEPENDS_${PN}-opie += "${PN}" +#FILES_${PN}-opie = "${palmtopdir}" |