Add new distutils-native-base class so solve PYTHON_DIR problem for native packages
RFC PATCH 1/1 Add new distutils-native-base class so solve PYTHON_DIR problem for native packages
Hi
I bumped into this problem today. I parsed dependencies for libxml2-native and it was pulling all sort of packages which are really meant for target packages e.g. it was pulling in python along with python-native and then this inturn was pulling in other packages.
This is because we inherit from distutils-base class in the native recipes of libxml2 and same is case with rpm-native
The native recipes infact need less than what distutils-base provides, so I divided this class into
distutils-common-base which is inherited by distutils-base class and distutils-native-base class (new)
Now we can use distuitls-native-base class for the native packages who need variables like PYTHON_DIR
I fixed zope-native rpm-native and libxml-native recipes. They needed a bit of restructuring.
Now I get correct build deps for these packages.
OK for .dev ?
Signature · 1 line
Khem Raj
classes/distutils-common-base.bbclass new file +28 -0
@@ -0,0 +1,28 @@ +EXTRA_OEMAKE = "" +RDEPENDS += "python-core" + +export STAGING_INCDIR +export STAGING_LIBDIR + +def python_dir(d): + import os, bb + staging_incdir = bb.data.getVar( "STAGING_INCDIR", d, 1 ) + for majmin in "2.6 2.5 2.4 2.3".split(): + if os.path.exists( "%s/python%s" % ( staging_incdir, majmin ) ): return "python%s" % majmin + raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" + +PYTHON_DIR = "${@python_dir(d)}" + +PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc ${PN}" + +FILES_${PN} = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" + +FILES_${PN}-dev += "\ + ${libdir}/pkgconfig \ + ${libdir}/${PYTHON_DIR}/site-packages/*.la \ +" +FILES_${PN}-dbg = "\ + ${libdir}/${PYTHON_DIR}/site-packages/.debug \ + ${libdir}/${PYTHON_DIR}/site-packages/*/.debug \ + ${libdir}/${PYTHON_DIR}/site-packages/*/*/.debug \ +"
classes/distutils-native-base.bbclass new file +3 -0
@@ -0,0 +1,3 @@ +DEPENDS += "${@["python-native", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" + +inherit distutils-common-base
recipes/rpm/rpm-4.4.2.3.inc new file +97 -0
97 lines not on this page · raw message
recipes/zope/zope-3.3.1.inc new file +47 -0
47 lines not on this page · raw message
classes/distutils-base.bbclass +1 -25
@@ -1,29 +1,5 @@ -EXTRA_OEMAKE = "" DEPENDS += "${@["python-native python", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" RDEPENDS += "python-core" -export STAGING_INCDIR -export STAGING_LIBDIR +inherit distutils-common-base -def python_dir(d): - import os, bb - staging_incdir = bb.data.getVar( "STAGING_INCDIR", d, 1 ) - for majmin in "2.6 2.5 2.4 2.3".split(): - if os.path.exists( "%s/python%s" % ( staging_incdir, majmin ) ): return "python%s" % majmin - raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" - -PYTHON_DIR = "${@python_dir(d)}" - -PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc ${PN}" - -FILES_${PN} = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" - -FILES_${PN}-dev += "\ - ${libdir}/pkgconfig \ - ${libdir}/${PYTHON_DIR}/site-packages/*.la \ -" -FILES_${PN}-dbg = "\ - ${libdir}/${PYTHON_DIR}/site-packages/.debug \ - ${libdir}/${PYTHON_DIR}/site-packages/*/.debug \ - ${libdir}/${PYTHON_DIR}/site-packages/*/*/.debug \ -"
classes/distutils-common-base.bbclass +0 -1
@@ -1,5 +1,4 @@ EXTRA_OEMAKE = "" -RDEPENDS += "python-core" export STAGING_INCDIR export STAGING_LIBDIR
recipes/libxml/libxml2-native.inc +2 -2
@@ -5,10 +5,10 @@ FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/libxml2-${PV}" SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz" S = "${WORKDIR}/libxml2-${PV}" -inherit distutils-base autotools native pkgconfig +inherit autotools native pkgconfig distutils-native-base do_configure_prepend () { - EXTRA_OECONF = "\ + export EXTRA_OECONF="\ --with-python=${PYTHON_DIR} \ --without-debug \ --without-legacy \
recipes/rpm/rpm-4.4.2.3.inc +1 -1
@@ -12,7 +12,7 @@ SRC_URI = "http://www.rpm.org/releases/rpm-4.4.x/rpm-4.4.2.3.tar.gz \ file://missingok.patch;patch=1;pnum=0 \ file://extcond.patch;patch=1;pnum=0" -inherit autotools gettext +#inherit autotools S = "${WORKDIR}/rpm-${PV}"
recipes/rpm/rpm-native_4.4.2.3.bb +3 -2
@@ -1,5 +1,6 @@ -require rpm_${PV}.bb -inherit native +inherit native distutils-native-base + +require rpm-${PV}.inc DEPENDS = "beecrypt-native gettext-native zlib-native file-native popt-native python-native"
recipes/rpm/rpm_4.4.2.3.bb +3 -97
101 lines not on this page · raw message
recipes/zope/zope-3.3.1.inc +0 -2
@@ -1,8 +1,6 @@ DESCRIPTION = "A full fledged pluggable content management system with integrated web server and much more." SECTION = "console/network" PRIORITY = "optional" -DEPENDS = "python" -RDEPENDS = "python-core python-shell" LICENSE = "ZPL" PR = "r9"
recipes/zope/zope-native_3.3.1.bb +2 -5
@@ -1,9 +1,6 @@ -require zope_${PV}.bb -inherit native +inherit native distutils-native-base -DEPENDS = "python-native" - -inherit distutils-base +require zope-${PV}.inc export BUILD_SYS export HOST_SYS
recipes/zope/zope_3.3.1.bb +2 -46
51 lines not on this page · raw message