[PyQt] make error when statically building Python for cross-compiling to android from linux

Phil Thompson phil at riverbankcomputing.com
Tue Oct 10 22:42:31 BST 2017


Check the NEWS file for which versions are supported. What’s important 
is the chronology of releases, not their version numbers.

Phil

On 10/10/2017 22:32, umbertofilippo wrote:
> Thank you very much Phil.
> 
> 
> I am trying now to do everything with Python 3.5.4, to hopefully being
> able to continue.
> 
> However, I am getting this error now, when I am trying to statically
> build python:/
> //    Configuring /home/umberto/Documents/apps/Python-3.5.4 as Python
> v3.5.4 for android-32//
> //    Patching
> /home/umberto/Documents/apps/Python-3.5.4/Include/unicodeobject.h//
> //    pyqtdeploycli:
> /home/umberto/Documents/apps/Python-3.5.4/Include/unicodeobject.h:2280:
> line does not match diff context/
> 
> /
> /
> 
> I read that this is probably due to the fact that 'Python needs
> unpatched source', but unfortunately, I don't know what that means...
> 
> I tried to create a new venv with python 3.5.4 (as my source Python),
> a new pip installation of pyqt5 and pyqtdeploy, and then downloaded
> the gzipped tarball source of Python 3.5.4 (target) from
> https://www.python.org/downloads/release/python-354/.
> 
> Then I extracted it, cd to it and run
> 
> /pyqt//deploycli --package python --target android-32 configure/
> 
> /
> /
> 
> May I ask what am I doing wrong, or what should I do in order to 'have
> fresh, unpatched source for python' (I am quoting this discussion
> <http://python.6.x6.nabble.com/LONG-BIT-error-static-compiling-Python3-4-2-for-Android-tp5085286p5085337.html>)?
> 
> From the documentation
> <http://pyqt.sourceforge.net/Docs/pyqtdeploy/command_line.html#cmdoption-pyqtdeploycli-disable-patches>
> I read in the description of pyqtdeploycli's --disable-patches option
> that '/The default is to enable the patching of the Python source code
> for Android based targets/'. How do I revert this if possible?
> 
> 
> Thanks in advance for any help, I really like PyQt!
> 
> Umberto
> 
> 
> On 09/10/2017 23:29, Phil Thompson wrote:
>> On 9 Oct 2017, at 10:11 pm, umbertofilippo <umbertofilippo at tiscali.it> 
>> wrote:
>>> Hello,
>>> 
>>> 
>>> I am trying to build Python 3.6 statically to cross-compile from 
>>> linux to android (finale target API 25).
>>> 
>>> I am following the instructions in 
>>> http://pyqt.sourceforge.net/Docs/pyqtdeploy/static_builds.html#python.
>>> 
>>> I've set SYSROOT to point my app folder (export 
>>> SYSROOT=${SYSROOT}:/home/umberto/Documents/apps/testApp/sysroot-android).
>>> 
>>> I've created a symlink to android Qt installation in the root of my 
>>> folder this way:
>>> 
>>> 	• cd /home/umberto/Documents/apps/testApp/sysroot-android/
>>> 	• ln -s /home/umberto/Qt5.9.1/5.9.1/android_armv7/
>>> I downloaded the binary from python.org (the gzipped source tarball).
>>> 
>>> I extracted it in a folder and then ran these commands:
>>> 
>>> 	• cd /folder/where/I/extracted/Python-3.6.2
>>> 	• pyqtdeploycli --package python --target android-32 configure
>>>>>> /home/umberto/Documents/apps/testApp/sysroot-android/android_armv7/bin/qmake 
>>> SYSROOT=$SYSROOT
>>> 	• make
>>> At the 'make' command I receive an error, which does not let me ho on 
>>> with 'make install'.
>>> 
>>> 
>>> Python/pystrtod.c:181:32: error: 'struct lconv' has no member named 
>>> 'decimal_point'
>>>       decimal_point = locale_data->decimal_point;
>>>                                  ^
>>> Python/pystrtod.c: In function 'change_decimal_from_locale_to_dot':
>>> Python/pystrtod.c:448:44: error: 'struct lconv' has no member named 
>>> 'decimal_point'
>>>       const char *decimal_point = locale_data->decimal_point;
>>>                                              ^
>>> Makefile:14373: recipe for target '.obj/pystrtod.o' failed
>>> make: *** [.obj/pystrtod.o] Error 1
>>> 
>>> 
>>> I attached the output of the 'make' command as it is very long, in 
>>> order to give someone the possibility to hopefully helping me trying 
>>> to figure out what's going on.
>>> 
>>> Is it something related to (quoting the documentation) "It may also 
>>> be necessary to set the ANDROID_NDK_TOOLCHAIN_VERSION if Qt and the 
>>> Android NDK disagree on which version of the toolchain to use."?
>> pyqtdeploy hasn't been updated for Python v3.6.2 (although I'm not 
>> saying that that is the cause of the problem).
>> 
>> Phil



More information about the PyQt mailing list