V2: Refactor external-python-tarball
cover V2: Refactor external-python-tarball
V2:
Reuse the populate_sdk_base code to update external-python-tarball.
The following changes since commit 37e025f6f9c410005e0f1dee0767e38eaec01cbd:
bitbake: hob: Hob should display warnings generated during parsing (2013-01-21 19:05:31 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/external-python
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/external-python
Kang Kai (2):
createrepo-native: update dependency
external-python-tarball: code refactoring
meta/recipes-core/meta/external-python-tarball.bb | 69 ++------------------ .../createrepo/createrepo_0.4.11.bb | 4 +- 2 files changed, 8 insertions(+), 65 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/2 createrepo-native: update dependency
"RDEPENDS_${PN}_class-native" doesn't work for native recipe because no -native package will be created. Then the dependencies listed here are not built when bitbake createrepo-native.
Update and use DEPENDS_class-native instead.
--- .../createrepo/createrepo_0.4.11.bb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-support/createrepo/createrepo_0.4.11.bb +2 -2
@@ -4,9 +4,9 @@ HOMEPAGE = "http://createrepo.baseurl.org/" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760" -RDEPENDS_${PN}_class-native += "libxml2-native rpm-native" +DEPENDS_class-native += "libxml2-native rpm-native" -PR = "r8" +PR = "r9" SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \ file://fix-native-install.patch \
Signature · 1 line
1.7.5.4
PATCH 2/2 external-python-tarball: code refactoring
In reply to Kang Kaiexternal-python-tarball only can be built when inherit package_ipk now. Update it to reuse existed populate sdk code that it could be built for rpm and deb too.
[Yocto 3006]
--- meta/recipes-core/meta/external-python-tarball.bb | 69 ++------------------- 1 files changed, 6 insertions(+), 63 deletions(-)
meta/recipes-core/meta/external-python-tarball.bb +6 -63
@@ -3,19 +3,16 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" +DEPENDS = "virtual/fakeroot-native sed-native" -PR = "r1" +PR = "r2" inherit meta +inherit populate_sdk -SDK_DIR = "${WORKDIR}/sdk" -SDK_OUTPUT = "${SDK_DIR}/image" -SDK_DEPLOY = "${TMPDIR}/deploy/sdk" +TOOLCHAIN_TARGET_TASK = "" -IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" - -TOOLCHAIN_HOST_TASK ?= "\ +TOOLCHAIN_HOST_TASK = "\ nativesdk-python-core \ nativesdk-python-textutils \ nativesdk-python-sqlite3 \
@@ -37,62 +34,8 @@ TOOLCHAIN_HOST_TASK ?= "\ nativesdk-chrpath \ " -TOOLCHAIN_OUTPUTNAME ?= "python-nativesdk-standalone-${SDKMACHINE}" +TOOLCHAIN_OUTPUTNAME = "python-nativesdk-standalone-${SDKMACHINE}" RDEPENDS = "${TOOLCHAIN_HOST_TASK}" EXCLUDE_FROM_WORLD = "1" - -do_populate_sdk() { - rm -rf ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ - - rm -f ${IPKGCONF_TARGET} - touch ${IPKGCONF_TARGET} - rm -f ${IPKGCONF_SDK} - touch ${IPKGCONF_SDK} - - package_update_index_ipk - package_generate_ipkg_conf - - for arch in ${PACKAGE_ARCHS}; do - revipkgarchs="$arch $revipkgarchs" - done - - ${IPKG_HOST} update - ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg - mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ - rm -Rf ${SDK_OUTPUT}/var - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} - install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ - - rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la - - # Link the ld.so.cache file into the hosts filesystem - ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache - - # Add version information - versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} - touch $versionfile - echo 'Distro: ${DISTRO}' >> $versionfile - echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile - echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile - echo 'Timestamp: ${DATETIME}' >> $versionfile - - # Package it up - mkdir -p ${SDK_DEPLOY} - cd ${SDK_OUTPUT} - tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . -} - -do_populate_sdk[nostamp] = "1" -do_populate_sdk[recrdeptask] = "do_package_write" -addtask populate_sdk before do_build after do_install - -inherit blacklist - -PNBLACKLIST[external-python-tarball] = "${@base_contains('PACKAGE_CLASSES', 'package_ipk', '', 'This recipe requires \'package_ipk\' support to be enabled in PACKAGE_CLASSES.', d)}"
Signature · 1 line
1.7.5.4
Re: [PATCH 2/2] external-python-tarball: code refactoring
Quoted 41 lines · Kang Kai
external-python-tarball only can be built when inherit
package_ipknow. Update it to reuse existed populate sdk code that it could be built for rpm and deb too.[Yocto 3006]
Signed-off-by Kang Kai <[email protected]>--- meta/recipes-core/meta/external-python-tarball.bb | 69 ++------------------- 1 files changed, 6 insertions(+), 63 deletions(-)meta/recipes-core/meta/external-python-tarball.bb +5
-8@@ -3,19 +3,16 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" -DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native" +DEPENDS = "virtual/fakeroot-native sed-native" -PR = "r1" +PR = "r2" inherit meta +inherit populate_sdk -SDK_DIR = "${WORKDIR}/sdk" -SDK_OUTPUT = "${SDK_DIR}/image" -SDK_DEPLOY = "${TMPDIR}/deploy/sdk" +TOOLCHAIN_TARGET_TASK = "" -IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" - -TOOLCHAIN_HOST_TASK ?= "\ +TOOLCHAIN_HOST_TASK = "\ nativesdk-python-core \ nativesdk-python-textutils \ nativesdk-python-sqlite3 \
meta/recipes-core/meta/external-python-tarball.bb TOOLCHAIN_HOST_TASK ?= "\ · line 38
Quoted 6 lines
meta/recipes-core/meta/external-python-tarball.bb +1
-1@@ -37,62 +34,8 @@ TOOLCHAIN_HOST_TASK ?= "\ nativesdk-chrpath \ " -TOOLCHAIN_OUTPUTNAME ?= "python-nativesdk-standalone-${SDKMACHINE}" +TOOLCHAIN_OUTPUTNAME = "python-nativesdk-standalone-${SDKMACHINE}"
Why are you changing the above two from being overriden to straight assignments? Don't we want these to possibly be overriden with additional TASK info or allow the name to change?
This is not explained in the commit message
Sau!
Quoted 58 lines
meta/recipes-core/meta/external-python-tarball.bb +0
-54RDEPENDS = "${TOOLCHAIN_HOST_TASK}" EXCLUDE_FROM_WORLD = "1" - -do_populate_sdk() { - rm -rf ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ - - rm -f ${IPKGCONF_TARGET} - touch ${IPKGCONF_TARGET} - rm -f ${IPKGCONF_SDK} - touch ${IPKGCONF_SDK} - - package_update_index_ipk - package_generate_ipkg_conf - - for arch in ${PACKAGE_ARCHS}; do - revipkgarchs="$arch $revipkgarchs" - done - - ${IPKG_HOST} update - ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg - mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/ - rm -Rf ${SDK_OUTPUT}/var - - install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir} - install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/ - - rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la - - # Link the ld.so.cache file into the hosts filesystem - ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache - - # Add version information - versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} - touch $versionfile - echo 'Distro: ${DISTRO}' >> $versionfile - echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile - echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile - echo 'Timestamp: ${DATETIME}' >> $versionfile - - # Package it up - mkdir -p ${SDK_DEPLOY} - cd ${SDK_OUTPUT} - tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . -} - -do_populate_sdk[nostamp] = "1" -do_populate_sdk[recrdeptask] = "do_package_write" -addtask populate_sdk before do_build after do_install - -inherit blacklist - -PNBLACKLIST[external-python-tarball] = "${@base_contains('PACKAGE_CLASSES', 'package_ipk', '', 'This recipe requires \'package_ipk\' support to be enabled in PACKAGE_CLASSES.', d)}"
Re: [PATCH 2/2] external-python-tarball: code refactoring
Quoted 47 lines · Saul Wold
Quoted 46 lines · Kang Kai
external-python-tarball only can be built when inherit
package_ipknow. Update it to reuse existed populate sdk code that it could be built for rpm and deb too.[Yocto 3006]
Signed-off-by Kang Kai <[email protected]>---
meta/recipes-core/meta/external-python-tarball.bb | 69
++-------------------1 files changed, 6 insertions(+), 63 deletions(-)meta/recipes-core/meta/external-python-tarball.bb +0
-0@@ -3,19 +3,16 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-DEPENDS = "opkg-native opkg-utils-native virtual/fakeroot-native sed-native"
meta/recipes-core/meta/external-python-tarball.bb +2
-1+DEPENDS = "virtual/fakeroot-native sed-native" -PR = "r1" +PR = "r2"inherit meta
meta/recipes-core/meta/external-python-tarball.bb +3
-6+inherit populate_sdk -SDK_DIR = "${WORKDIR}/sdk" -SDK_OUTPUT = "${SDK_DIR}/image" -SDK_DEPLOY = "${TMPDIR}/deploy/sdk" +TOOLCHAIN_TARGET_TASK = "" -IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}" - -TOOLCHAIN_HOST_TASK ?= "\ +TOOLCHAIN_HOST_TASK = "\nativesdk-python-core \
nativesdk-python-textutils \
nativesdk-python-sqlite3 \meta/recipes-core/meta/external-python-tarball.bb +0
-0@@ -37,62 +34,8 @@ TOOLCHAIN_HOST_TASK ?= "\ nativesdk-chrpath \"
Quoted 4 lines
meta/recipes-core/meta/external-python-tarball.bb TOOLCHAIN_HOST_TASK ?= "\ · line 37
Quoted 3 lines
meta/recipes-core/meta/external-python-tarball.bb +1
-1-TOOLCHAIN_OUTPUTNAME ?= "python-nativesdk-standalone-${SDKMACHINE}" +TOOLCHAIN_OUTPUTNAME = "python-nativesdk-standalone-${SDKMACHINE}"Why are you changing the above two from being overriden to straight assignments? Don't we want these to possibly be overriden with additional TASK info or allow the name to change?
Hi Saul,
Vars TOOLCHAIN_OUTPUTNAME TOOLCHAIN_HOST_TASK and TOOLCHAIN_TARGET_TASK are also defined with ?= in populate_sdk_base.bbclass, so I simply thought to override them in external-python-tarball.bb with '='. Sorry for that, I'll update with inheriting bbclasses at the end of .bb file.
Regards,
Kai
Quoted 70 lines
This is not explained in the commit message
Sau!
Quoted 63 lines
RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
EXCLUDE_FROM_WORLD= "1"meta/recipes-core/meta/external-python-tarball.bb +0
-22- -do_populate_sdk() { - rm -rf ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT} - mkdir -p ${SDK_OUTPUT}${localstatedir}/lib/opkg/ - - rm -f ${IPKGCONF_TARGET} - touch ${IPKGCONF_TARGET} - rm -f ${IPKGCONF_SDK} - touch ${IPKGCONF_SDK} - - package_update_index_ipk - package_generate_ipkg_conf - - for arch in ${PACKAGE_ARCHS}; do - revipkgarchs="$arch $revipkgarchs" - done - - ${IPKG_HOST} update - ${IPKG_HOST} install ${TOOLCHAIN_HOST_TASK} - - install -d${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg
- mv ${SDK_OUTPUT}/var/lib/opkg/* ${SDK_OUTPUT}/${SDKPATHNATIVE}${localstatedir_nativesdk}/lib/opkg/
- rm -Rf ${SDK_OUTPUT}/var
-
- install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}
- install -m 0644 ${IPKGCONF_SDK} ${SDK_OUTPUT}/${SDKPATHNATIVE}/${sysconfdir}/meta/recipes-core/meta/external-python-tarball.bb +0
-28- - rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la - - # Link the ld.so.cache file into the hosts filesystem - ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache - - # Add version information - versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS} - touch $versionfile - echo 'Distro: ${DISTRO}' >> $versionfile - echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile - echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile - echo 'Timestamp: ${DATETIME}' >> $versionfile - - # Package it up - mkdir -p ${SDK_DEPLOY} - cd ${SDK_OUTPUT} - tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 . -} - -do_populate_sdk[nostamp] = "1" -do_populate_sdk[recrdeptask] = "do_package_write" -addtask populate_sdk before do_build after do_install - -inherit blacklist - -PNBLACKLIST[external-python-tarball] ="${@base_contains('PACKAGE_CLASSES', '
package_ipk', '', 'This recipe requires \'package_ipk\' support to be enabled inPACKAGE_CLASSES.', d)}"