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