summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3_3.3.3.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-05-14 15:00:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-02 22:37:39 +0000
commit1c8869bca49cacbbad7520d17df1d3fab475a71c (patch)
tree931c923665138acf2fb101c11545735286c022e4 /meta/recipes-devtools/python/python3_3.3.3.bb
parent3f57c714d0d4b9cc68a129c332291c41e6615a9f (diff)
downloadpoky-1c8869bca49cacbbad7520d17df1d3fab475a71c.tar.gz
python3: Add target and native recipes
3.3.3 is latest bugfix release in 3.3 series License text is changed to reflect year and prev releases +++ ../Python-3.3.2/LICENSE 2013-05-15 09:32:54.000000000 -0700 @@ -74,7 +74,9 @@ 3.2.1 3.2 2011 PSF yes 3.2.2 3.2.1 2011 PSF yes 3.2.3 3.2.2 2012 PSF yes + 3.2.4 3.2.3 2013 PSF yes 3.3.0 3.2 2012 PSF yes + 3.3.1 3.3.0 2013 PSF yes Footnotes: @@ -110,8 +112,8 @@ distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -2011, 2012 Python Software Foundation; All Rights Reserved" are retained in Python -alone or in any derivative version prepared by Licensee. +2011, 2012, 2013 Python Software Foundation; All Rights Reserved" are retained +in Python alone or in any derivative version prepared by Licensee. We use native python in disutils bbclass and this needs to peek into target sysroot when building plugins in cross environment. Otherwise anything that inherits distutils3.bbclass will not build. Fix host include contamination issue Let compiler append sysroot to include path if it can Fix the compiler invocation and linker flags when cross compiling The details are in patch header. This should fix the QA errors about host contamination Add virtual/libintl to dep list There is use of libintl.h but we dont express the dependency Add lzma dependency for python3-misc Fixes and from test-dependencies.sh run there is undeterministic lzma dependency: WARN: packages/armv5te-oe-linux-gnueabi/python3/python3-misc/latest lost dependency on liblzma Fix staging warnings due to duplicate install WARNING: The recipe python3 is trying to install files into a shared area when those files already exist. Those files and their manifest location are: builds/world/tmp/sysroots/qemux86-64/usr/include/python3.3m/pyconfig.h builds/world/tmp/sysroots/qemux86-64/usr/lib/libpython3.3m.so.1.0 builds/world/tmp/sysroots/qemux86-64/usr/lib/libpython3.3m.so builds/world/tmp/sysroots/qemux86-64/usr/lib/python3.3/config/Makefile Let compiler search includes relative to sysroot This makes it cross compilable and assumption on hardcoded paths is fixed. Errors like below would appear if ncursesw is installed on build host cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories] (From OE-Core rev: 185fcfc3286b355394ae89300f22b8cb7aaa43c1) Signed-off-by: Khem Raj <raj.khem@gmail.com> Fix linking not happening issue in modules We need to tweak CONFIGURE_LDFLAGS for python3 instead of LDFLAGS directly Add second compile stage which uses original makefile Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3_3.3.3.bb')
-rw-r--r--meta/recipes-devtools/python/python3_3.3.3.bb211
1 files changed, 211 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3_3.3.3.bb b/meta/recipes-devtools/python/python3_3.3.3.bb
new file mode 100644
index 0000000000..d359863833
--- /dev/null
+++ b/meta/recipes-devtools/python/python3_3.3.3.bb
@@ -0,0 +1,211 @@
1require recipes-devtools/python/python.inc
2
3DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
4PR = "${INC_PR}.0"
5PYTHON_MAJMIN = "3.3"
6PYTHON_BINABI= "${PYTHON_MAJMIN}m"
7DISTRO_SRC_URI ?= "file://sitecustomize.py"
8DISTRO_SRC_URI_linuxstdbase = ""
9SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
10file://12-distutils-prefix-is-inside-staging-area.patch \
11file://000-cross-compile.patch \
12file://020-dont-compile-python-files.patch \
13file://030-fixup-include-dirs.patch \
14file://070-dont-clean-ipkg-install.patch \
15file://080-distutils-dont_adjust_files.patch \
16file://110-enable-zlib.patch \
17file://130-readline-setup.patch \
18file://150-fix-setupterm.patch \
19file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
20${DISTRO_SRC_URI} \
21"
22
23SRC_URI += "\
24 file://03-fix-tkinter-detection.patch \
25 file://04-default-is-optimized.patch \
26 file://avoid_warning_about_tkinter.patch \
27 file://06-ctypes-libffi-fix-configure.patch \
28 file://remove_sqlite_rpath.patch \
29 file://cgi_py.patch \
30 file://host_include_contamination.patch \
31 file://python-3.3-multilib.patch \
32 file://shutil-follow-symlink-fix.patch \
33 file://sysroot-include-headers.patch \
34 file://unixccompiler.patch \
35 file://avoid-ncursesw-include-path.patch \
36 "
37SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c"
38SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb"
39
40LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005"
41
42S = "${WORKDIR}/Python-${PV}"
43
44inherit autotools multilib_header python3native pkgconfig
45
46CONFIGUREOPTS += " --with-system-ffi "
47
48CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
49 ac_cv_have_lchflags=no \
50 ac_cv_have_long_long_format=yes \
51 ac_cv_buggy_getaddrinfo=no \
52 ac_cv_file__dev_ptmx=yes \
53 ac_cv_file__dev_ptc=no \
54"
55# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
56#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
57TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
58TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
59TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
60EXTRA_OEMAKE += "CROSS_COMPILE=yes"
61
62do_configure_prepend() {
63 rm -f ${S}/Makefile.orig
64 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
65}
66
67do_compile() {
68 # regenerate platform specific files, because they depend on system headers
69 cd Lib/plat-linux*
70 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
71 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
72 ${STAGING_INCDIR}/dlfcn.h \
73 ${STAGING_INCDIR}/linux/cdrom.h \
74 ${STAGING_INCDIR}/netinet/in.h \
75 ${STAGING_INCDIR}/sys/types.h
76 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
77 cd -
78
79 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
80 sed -i -e s,ccache,'$(CCACHE)', Makefile
81
82 # remove any bogus LD_LIBRARY_PATH
83 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
84
85 if [ ! -f Makefile.orig ]; then
86 install -m 0644 Makefile Makefile.orig
87 fi
88 sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
89 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
90 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
91 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
92 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
93 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
94 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
95 Makefile
96 # save copy of it now, because if we do it in do_install and
97 # then call do_install twice we get Makefile.orig == Makefile.sysroot
98 install -m 0644 Makefile Makefile.sysroot
99
100 export CROSS_COMPILE="${TARGET_PREFIX}"
101 export PYTHONBUILDDIR="${S}"
102 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
103 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
104 STAGING_LIBDIR=${STAGING_LIBDIR} \
105 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
106 STAGING_INCDIR=${STAGING_INCDIR} \
107 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
108 LIB=${baselib} \
109 ARCH=${TARGET_ARCH} \
110 OPT="${CFLAGS}" libpython3.so
111
112 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
113 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
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 LIB=${baselib} \
119 ARCH=${TARGET_ARCH} \
120 OPT="${CFLAGS}"
121}
122
123do_install() {
124 # make install needs the original Makefile, or otherwise the inclues would
125 # go to ${D}${STAGING...}/...
126 install -m 0644 Makefile.orig Makefile
127
128 export CROSS_COMPILE="${TARGET_PREFIX}"
129 export PYTHONBUILDDIR="${S}"
130 install -d ${D}${libdir}/pkgconfig
131 install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
132
133 # rerun the build once again with original makefile this time
134 # run install in a separate step to avoid compile/install race
135 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
136 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
137 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
138 STAGING_LIBDIR=${STAGING_LIBDIR} \
139 STAGING_INCDIR=${STAGING_INCDIR} \
140 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
141 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
142 LIB=${baselib} \
143 ARCH=${TARGET_ARCH} \
144 DESTDIR=${D} LIBDIR=${libdir}
145
146 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
147 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
148 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
149 STAGING_LIBDIR=${STAGING_LIBDIR} \
150 STAGING_INCDIR=${STAGING_INCDIR} \
151 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
152 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
153 LIB=${baselib} \
154 ARCH=${TARGET_ARCH} \
155 DESTDIR=${D} LIBDIR=${libdir} install
156
157 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
158
159 if [ -e ${WORKDIR}/sitecustomize.py ]; then
160 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
161 fi
162
163 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
164}
165
166do_install_append_class-nativesdk () {
167 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
168}
169
170SSTATE_SCAN_FILES += "Makefile"
171PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
172
173py_package_preprocess () {
174 # copy back the old Makefile to fix target package
175 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
176 # Remove references to buildmachine paths in target Makefile
177 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
178}
179
180require python-${PYTHON_MAJMIN}-manifest.inc
181
182# manual dependency additions
183RPROVIDES_${PN}-core = "${PN}"
184RRECOMMENDS_${PN}-core = "${PN}-readline"
185RRECOMMENDS_${PN}-crypt = "openssl"
186RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
187
188FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
189FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
190FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
191
192PACKAGES =+ "${PN}-pyvenv"
193FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
194
195# package libpython3
196PACKAGES =+ "libpython3 libpython3-staticdev"
197FILES_libpython3 = "${libdir}/libpython*.so.*"
198FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
199
200# catch debug extensions (isn't that already in python-core-dbg?)
201FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
202
203# catch all the rest (unsorted)
204PACKAGES += "${PN}-misc"
205FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
206
207# catch manpage
208PACKAGES += "${PN}-man"
209FILES_${PN}-man = "${datadir}/man"
210
211BBCLASSEXTEND = "nativesdk"