python: hacks for the old tree
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 14 Dec 2013 22:03:21 +0000 (00:03 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 15 Dec 2013 18:11:32 +0000 (20:11 +0200)
classes/python-dir.bbclass
classes/pythonnative.bbclass
recipes/python/python-native_2.7.3.bb
recipes/python/python-pycairo_1.8.0.bb
recipes/python/python-pygobject_2.20.0.bb
recipes/python/python-pygtk_2.16.0.bb
recipes/python/python/01-fix-have-long-long-format.patch [moved from recipes/python/python-2.7.1/01-fix-have-long-long-format.patch with 100% similarity]
recipes/python/python_2.7.3.bb

index d631a5c..f490844 100644 (file)
@@ -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 ?"
index 7886207..f836c1f 100644 (file)
@@ -1,3 +1,3 @@
-PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
+PYTHON="${STAGING_BINDIR_NATIVE}/python"
 EXTRANATIVEPATH += "python-native"
 DEPENDS += " python-native "
index 6b87a16..894d63f 100644 (file)
@@ -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
 }
index 6f96ea8..ef79a85 100644 (file)
@@ -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
index 19a60ab..f4894b0 100644 (file)
@@ -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}"
 
index 699bd5d..e7b1c1b 100644 (file)
@@ -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}"
 
index 340f5f3..c180d21 100644 (file)
@@ -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 \
+"
+