summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python_2.7.9.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python_2.7.9.bb')
-rw-r--r--meta/recipes-devtools/python/python_2.7.9.bb178
1 files changed, 178 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb
new file mode 100644
index 0000000000..048ec3903a
--- /dev/null
+++ b/meta/recipes-devtools/python/python_2.7.9.bb
@@ -0,0 +1,178 @@
1require python.inc
2DEPENDS = "python-native bzip2 db gdbm openssl readline sqlite3 zlib"
3PR = "${INC_PR}"
4
5DISTRO_SRC_URI ?= "file://sitecustomize.py"
6DISTRO_SRC_URI_linuxstdbase = ""
7SRC_URI += "\
8 file://01-use-proper-tools-for-cross-build.patch \
9 file://03-fix-tkinter-detection.patch \
10 file://06-avoid_usr_lib_termcap_path_in_linking.patch \
11 ${DISTRO_SRC_URI} \
12 file://multilib.patch \
13 file://cgi_py.patch \
14 file://setup_py_skip_cross_import_check.patch \
15 file://add-md5module-support.patch \
16 file://host_include_contamination.patch \
17 file://fix_for_using_different_libdir.patch \
18 file://setuptweaks.patch \
19 file://check-if-target-is-64b-not-host.patch \
20 file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
21 file://avoid_warning_about_tkinter.patch \
22 file://avoid_warning_for_sunos_specific_module.patch \
23 file://python-2.7.3-remove-bsdb-rpath.patch \
24 file://fix-makefile-for-ptest.patch \
25 file://run-ptest \
26 file://parallel-makeinst-create-bindir.patch \
27 file://use_sysroot_ncurses_instead_of_host.patch \
28"
29
30S = "${WORKDIR}/Python-${PV}"
31
32inherit autotools multilib_header python-dir pythonnative
33
34# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
35#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
36TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
37TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
38
39# The following is a hack until we drop ac_cv_sizeof_off_t from site files
40EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)} ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no"
41
42do_configure_prepend() {
43 rm -f ${S}/Makefile.orig
44 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
45}
46
47do_compile() {
48 # regenerate platform specific files, because they depend on system headers
49 cd ${S}/Lib/plat-linux2
50 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
51 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
52 ${STAGING_INCDIR}/dlfcn.h \
53 ${STAGING_INCDIR}/linux/cdrom.h \
54 ${STAGING_INCDIR}/netinet/in.h \
55 ${STAGING_INCDIR}/sys/types.h
56 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
57 cd -
58
59 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
60 sed -i -e s,ccache\ ,'$(CCACHE) ', Makefile
61
62 # remove any bogus LD_LIBRARY_PATH
63 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
64
65 if [ ! -f Makefile.orig ]; then
66 install -m 0644 Makefile Makefile.orig
67 fi
68 sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
69 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
70 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
71 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
72 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
73 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
74 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
75 Makefile
76 # save copy of it now, because if we do it in do_install and
77 # then call do_install twice we get Makefile.orig == Makefile.sysroot
78 install -m 0644 Makefile Makefile.sysroot
79
80 export CROSS_COMPILE="${TARGET_PREFIX}"
81 export PYTHONBUILDDIR="${B}"
82
83 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
84 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
85 STAGING_LIBDIR=${STAGING_LIBDIR} \
86 STAGING_INCDIR=${STAGING_INCDIR} \
87 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
88 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
89 OPT="${CFLAGS}"
90}
91
92do_install() {
93 # make install needs the original Makefile, or otherwise the inclues would
94 # go to ${D}${STAGING...}/...
95 install -m 0644 Makefile.orig Makefile
96
97 export CROSS_COMPILE="${TARGET_PREFIX}"
98 export PYTHONBUILDDIR="${B}"
99
100 # After swizzling the makefile, we need to run the build again.
101 # install can race with the build so we have to run this first, then install
102 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
103 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
104 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
105 STAGING_LIBDIR=${STAGING_LIBDIR} \
106 STAGING_INCDIR=${STAGING_INCDIR} \
107 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
108 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
109 DESTDIR=${D} LIBDIR=${libdir}
110
111 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
112 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
113 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
114 STAGING_LIBDIR=${STAGING_LIBDIR} \
115 STAGING_INCDIR=${STAGING_INCDIR} \
116 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
117 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
118 DESTDIR=${D} LIBDIR=${libdir} install
119
120 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
121
122 if [ -e ${WORKDIR}/sitecustomize.py ]; then
123 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
124 fi
125
126 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
127}
128
129do_install_append_class-nativesdk () {
130 create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
131}
132
133SSTATE_SCAN_FILES += "Makefile"
134PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
135
136py_package_preprocess () {
137 # copy back the old Makefile to fix target package
138 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
139
140 # Remove references to buildmachine paths in target Makefile
141 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
142}
143
144require python-${PYTHON_MAJMIN}-manifest.inc
145
146# manual dependency additions
147RPROVIDES_${PN}-core = "${PN}"
148RRECOMMENDS_${PN}-core = "${PN}-readline"
149RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
150RRECOMMENDS_${PN}-crypt = "openssl"
151
152# package libpython2
153PACKAGES =+ "lib${BPN}2"
154FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
155
156# catch debug extensions (isn't that already in python-core-dbg?)
157FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
158
159# catch all the rest (unsorted)
160PACKAGES += "${PN}-misc"
161FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
162RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc"
163#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
164inherit ptest
165
166# This must come after inherit ptest for the override to take effect
167do_install_ptest() {
168 cp ${B}/Makefile ${D}${PTEST_PATH}
169 sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
170 -e s:LIBDIR:${libdir}:g \
171 -i ${D}${PTEST_PATH}/run-ptest
172}
173
174# catch manpage
175PACKAGES += "${PN}-man"
176FILES_${PN}-man = "${datadir}/man"
177
178BBCLASSEXTEND = "nativesdk"