From e6bfae88be85a1fd0e25f7acfa02b7a033c36953 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 15 Dec 2013 00:03:21 +0200 Subject: [PATCH] python: hacks for the old tree --- classes/python-dir.bbclass | 2 +- classes/pythonnative.bbclass | 2 +- recipes/python/python-native_2.7.3.bb | 38 +++---- recipes/python/python-pycairo_1.8.0.bb | 2 +- recipes/python/python-pygobject_2.20.0.bb | 2 +- recipes/python/python-pygtk_2.16.0.bb | 2 +- .../01-fix-have-long-long-format.patch | 0 recipes/python/python_2.7.3.bb | 106 +++++++++++------- 8 files changed, 87 insertions(+), 67 deletions(-) rename recipes/python/{python-2.7.1 => python}/01-fix-have-long-long-format.patch (100%) diff --git a/classes/python-dir.bbclass b/classes/python-dir.bbclass index d631a5c3ff..f4908441e0 100644 --- a/classes/python-dir.bbclass +++ b/classes/python-dir.bbclass @@ -1,7 +1,7 @@ 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(): + for majmin in "2.7 2.6 2.5 2.4 2.3".split(): if os.path.exists( "%s/python%s" % ( staging_incdir, majmin ) ): return "python%s" % majmin if not "python-native" in bb.data.getVar( "DEPENDS", d, 1 ).split(): raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" diff --git a/classes/pythonnative.bbclass b/classes/pythonnative.bbclass index 7886207d06..f836c1fe61 100644 --- a/classes/pythonnative.bbclass +++ b/classes/pythonnative.bbclass @@ -1,3 +1,3 @@ -PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python" +PYTHON="${STAGING_BINDIR_NATIVE}/python" EXTRANATIVEPATH += "python-native" DEPENDS += " python-native " diff --git a/recipes/python/python-native_2.7.3.bb b/recipes/python/python-native_2.7.3.bb index 6b87a16d41..894d63f0ef 100644 --- a/recipes/python/python-native_2.7.3.bb +++ b/recipes/python/python-native_2.7.3.bb @@ -1,22 +1,22 @@ -require python.inc +require python27.inc EXTRANATIVEPATH += "bzip2-native" -DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native" +DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native" PR = "${INC_PR}.1" SRC_URI += "\ - file://05-enable-ctypes-cross-build.patch \ - file://06-ctypes-libffi-fix-configure.patch \ - file://10-distutils-fix-swig-parameter.patch \ - file://11-distutils-never-modify-shebang-line.patch \ - file://12-distutils-prefix-is-inside-staging-area.patch \ - file://debug.patch \ - file://unixccompiler.patch \ - file://nohostlibs.patch \ - file://multilib.patch \ - file://add-md5module-support.patch \ - file://builddir.patch \ - file://parallel-makeinst-create-bindir.patch \ + file://05-enable-ctypes-cross-build.patch;patch=1 \ + file://06-ctypes-libffi-fix-configure.patch;patch=1 \ + file://10-distutils-fix-swig-parameter.patch;patch=1 \ + file://11-distutils-never-modify-shebang-line.patch;patch=1 \ + file://12-distutils-prefix-is-inside-staging-area.patch;patch=1 \ + file://debug.patch;patch=1 \ + file://unixccompiler.patch;patch=1 \ + file://nohostlibs.patch;patch=1 \ + file://multilib.patch;patch=1 \ + file://add-md5module-support.patch;patch=1 \ + file://builddir.patch;patch=1 \ + file://parallel-makeinst-create-bindir.patch;patch=1 \ " S = "${WORKDIR}/Python-${PV}" @@ -26,7 +26,7 @@ inherit native RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native" -EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" +# EXTRA_OECONF_append = " --bindir=${bindir}/${PN}" EXTRA_OEMAKE = '\ BUILD_SYS="" \ @@ -42,11 +42,11 @@ do_configure_prepend() { do_install() { oe_runmake 'DESTDIR=${D}' install - install -d ${D}${bindir}/${PN} - install -m 0755 Parser/pgen ${D}${bindir}/${PN} + install -d ${D}${bindir}/ + install -m 0755 Parser/pgen ${D}${bindir}/ # Make sure we use /usr/bin/env python - for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT done @@ -54,5 +54,5 @@ do_install() { # "nativepython" and get the right one without needing absolute paths # (these often end up too long for the #! parser in the kernel as the # buffer is 128 bytes long). - ln -s python-native/python ${D}${bindir}/nativepython + #ln -s python-native/python ${D}${bindir}/nativepython } diff --git a/recipes/python/python-pycairo_1.8.0.bb b/recipes/python/python-pycairo_1.8.0.bb index 6f96ea8af4..ef79a85258 100644 --- a/recipes/python/python-pycairo_1.8.0.bb +++ b/recipes/python/python-pycairo_1.8.0.bb @@ -7,7 +7,7 @@ DEPENDS = "cairo" PR = "ml4" SRC_URI = "http://cairographics.org/releases/pycairo-${PV}.tar.gz \ - file://fix-setup-py.patch" + file://fix-setup-py.patch;patch=1" S = "${WORKDIR}/pycairo-${PV}" inherit distutils pkgconfig diff --git a/recipes/python/python-pygobject_2.20.0.bb b/recipes/python/python-pygobject_2.20.0.bb index 19a60ab954..f4894b0ff9 100644 --- a/recipes/python/python-pygobject_2.20.0.bb +++ b/recipes/python/python-pygobject_2.20.0.bb @@ -10,7 +10,7 @@ MAJ_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1 SRC_URI = "\ ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \ - file://generate-constants.patch \ + file://generate-constants.patch;patch=1 \ " S = "${WORKDIR}/pygobject-${PV}" diff --git a/recipes/python/python-pygtk_2.16.0.bb b/recipes/python/python-pygtk_2.16.0.bb index 699bd5d659..e7b1c1bb87 100644 --- a/recipes/python/python-pygtk_2.16.0.bb +++ b/recipes/python/python-pygtk_2.16.0.bb @@ -10,7 +10,7 @@ PR = "r3" MAJ_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}" SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/pygtk/${MAJ_VER}/${SRCNAME}-${PV}.tar.bz2;name=pygtk \ - file://fix-gtkunixprint.patch \ + file://fix-gtkunixprint.patch;patch=1 \ file://acinclude.m4" S = "${WORKDIR}/${SRCNAME}-${PV}" diff --git a/recipes/python/python-2.7.1/01-fix-have-long-long-format.patch b/recipes/python/python/01-fix-have-long-long-format.patch similarity index 100% rename from recipes/python/python-2.7.1/01-fix-have-long-long-format.patch rename to recipes/python/python/01-fix-have-long-long-format.patch diff --git a/recipes/python/python_2.7.3.bb b/recipes/python/python_2.7.3.bb index 340f5f330f..c180d21eea 100644 --- a/recipes/python/python_2.7.3.bb +++ b/recipes/python/python_2.7.3.bb @@ -1,43 +1,45 @@ -require python.inc +require python27.inc DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib" PR = "${INC_PR}.3" DISTRO_SRC_URI ?= "file://sitecustomize.py" DISTRO_SRC_URI_linuxstdbase = "" SRC_URI += "\ - file://01-use-proper-tools-for-cross-build.patch \ - file://03-fix-tkinter-detection.patch \ - file://05-enable-ctypes-cross-build.patch \ - file://06-ctypes-libffi-fix-configure.patch \ - file://06-avoid_usr_lib_termcap_path_in_linking.patch \ + file://01-fix-have-long-long-format.patch;patch=1 \ + file://01-use-proper-tools-for-cross-build.patch;patch=1 \ + file://03-fix-tkinter-detection.patch;patch=1 \ + file://05-enable-ctypes-cross-build.patch;patch=1 \ + file://06-ctypes-libffi-fix-configure.patch;patch=1 \ + file://06-avoid_usr_lib_termcap_path_in_linking.patch;patch=1 \ ${DISTRO_SRC_URI} \ - file://multilib.patch \ - file://cgi_py.patch \ - file://remove_sqlite_rpath.patch \ - file://setup_py_skip_cross_import_check.patch \ - file://add-md5module-support.patch \ - file://host_include_contamination.patch \ - file://fix_for_using_different_libdir.patch \ - file://setuptweaks.patch \ - file://check-if-target-is-64b-not-host.patch \ - file://search_db_h_in_inc_dirs_and_avoid_warning.patch \ - file://avoid_warning_about_tkinter.patch \ - file://avoid_warning_for_sunos_specific_module.patch \ - file://python-2.7.3-berkeley-db-5.3.patch \ - file://python-2.7.3-remove-bsdb-rpath.patch \ - file://builddir.patch \ - file://python-2.7.3-CVE-2012-2135.patch \ - file://gcc-4.8-fix-configure-Wformat.patch \ - file://fix-makefile-for-ptest.patch \ + file://multilib.patch;patch=1 \ + file://cgi_py.patch;patch=1 \ + file://remove_sqlite_rpath.patch;patch=1 \ + file://setup_py_skip_cross_import_check.patch;patch=1 \ + file://add-md5module-support.patch;patch=1 \ + file://host_include_contamination.patch;patch=1 \ + file://fix_for_using_different_libdir.patch;patch=1 \ + file://setuptweaks.patch;patch=1 \ + file://check-if-target-is-64b-not-host.patch;patch=1 \ + file://search_db_h_in_inc_dirs_and_avoid_warning.patch;patch=1 \ + file://avoid_warning_about_tkinter.patch;patch=1 \ + file://avoid_warning_for_sunos_specific_module.patch;patch=1 \ + file://python-2.7.3-berkeley-db-5.3.patch;patch=1 \ + file://python-2.7.3-remove-bsdb-rpath.patch;patch=1 \ + file://builddir.patch;patch=1 \ + file://python-2.7.3-CVE-2012-2135.patch;patch=1 \ + file://gcc-4.8-fix-configure-Wformat.patch;patch=1 \ + file://fix-makefile-for-ptest.patch;patch=1 \ file://run-ptest \ - file://CVE-2013-4073_py27.patch \ - file://pypirc-secure.patch \ - file://parallel-makeinst-create-bindir.patch \ + file://CVE-2013-4073_py27.patch;patch=1 \ + file://pypirc-secure.patch;patch=1 \ + file://parallel-makeinst-create-bindir.patch;patch=1 \ " S = "${WORKDIR}/Python-${PV}" -inherit autotools multilib_header pythonnative +inherit autotools pythonnative +# inherit multilib_header # The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :( @@ -52,7 +54,7 @@ do_configure_prepend() { do_compile() { # regenerate platform specific files, because they depend on system headers cd Lib/plat-linux2 - include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \ + include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python \ ${S}/Tools/scripts/h2py.py -i '(u_long)' \ ${STAGING_INCDIR}/dlfcn.h \ ${STAGING_INCDIR}/linux/cdrom.h \ @@ -70,7 +72,7 @@ do_compile() { if [ ! -f Makefile.orig ]; then install -m 0644 Makefile Makefile.orig fi - sed -i -e 's,^LDFLAGS=.*,LDFLAGS=-L. -L${STAGING_LIBDIR},g' \ + sed -i -e 's,^LDFLAGS=.*,LDFLAGS+=-L. -L${STAGING_LIBDIR},g' \ -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \ -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \ -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \ @@ -85,8 +87,8 @@ do_compile() { export CROSS_COMPILE="${TARGET_PREFIX}" export PYTHONBUILDDIR="${S}" - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ - HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ STAGING_LIBDIR=${STAGING_LIBDIR} \ STAGING_INCDIR=${STAGING_INCDIR} \ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \ @@ -104,8 +106,8 @@ do_install() { # After swizzling the makefile, we need to run the build again. # install can race with the build so we have to run this first, then install - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ - HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ STAGING_LIBDIR=${STAGING_LIBDIR} \ STAGING_INCDIR=${STAGING_INCDIR} \ @@ -113,8 +115,8 @@ do_install() { BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ DESTDIR=${D} LIBDIR=${libdir} - oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \ - HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \ + oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/pgen \ + HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python \ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \ STAGING_LIBDIR=${STAGING_LIBDIR} \ STAGING_INCDIR=${STAGING_INCDIR} \ @@ -128,12 +130,12 @@ do_install() { install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN} fi - oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h +# oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h } -do_install_append_class-nativesdk () { - create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' -} +#do_install_append_class-nativesdk () { +# create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' +#} SSTATE_SCAN_FILES += "Makefile" PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess" @@ -152,7 +154,7 @@ require python-${PYTHON_MAJMIN}-manifest.inc RPROVIDES_${PN}-core = "${PN}" RRECOMMENDS_${PN}-core = "${PN}-readline" RRECOMMENDS_${PN}-crypt = "openssl" -RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" +# RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl" # package libpython2 PACKAGES =+ "lib${BPN}2" @@ -166,7 +168,7 @@ PACKAGES += "${PN}-misc" FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}" RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc" #inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten -inherit ptest +#inherit ptest # This must come after inherit ptest for the override to take effect do_install_ptest() { @@ -180,4 +182,22 @@ do_install_ptest() { PACKAGES += "${PN}-man" FILES_${PN}-man = "${datadir}/man" -BBCLASSEXTEND = "nativesdk" +# BBCLASSEXTEND = "nativesdk" + +# old OE tree hacks: + +# additional stuff -dev + +FILES_${PN}-dev += "\ + ${includedir} \ + ${libdir}/lib*${SOLIBSDEV} \ + ${libdir}/*.la \ + ${libdir}/*.a \ + ${libdir}/*.o \ + ${libdir}/pkgconfig \ + ${base_libdir}/*.a \ + ${base_libdir}/*.o \ + ${datadir}/aclocal \ + ${datadir}/pkgconfig \ +" + -- 2.39.5