[PyQt] Android & the pyqtdeploy tool: the provided demo relies on undocumented libraries/headers?

Jonathan Leaders jonathan at leadersandco.com
Thu Aug 23 21:09:25 BST 2018

Hey Phil! Thank you so much for the direction. We got further by 
following your advice of using the same versions of SIP & PyQt5 that was 
found in the pyqtdeploy demo image in the docs 

I'm a big fan of software that is "one-click" dev environment setup. I 
noticed I had to use specific old versions of PyQt5, Python, SIP, for 
the pyqtdeploy demo to work. It'd be interesting to add a--download-libs 
argument to demo-build.py that automatically downloads the source 
archives, since only certain versions are compatible. To help make that 
easier, here is a list of statements to download versions that are 
listed in your docs image:

# you must first run the universal Qt Installer script to install 
exactly 5.9.3
# I used qt-unified-linux-x64-3.0.5-online.run to install exactly 5.9.3 
in ~/Qt5.9.3
ln -s ~/Qt5.9.3/ src/Qt

cd src

# Download source archive required by pyqtdeploy 2.1 (only certain 
versions work)
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz

# Versions that are known to fail in pyqtdeploy 2.1:
#wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz

cd -

The documentation aside, here's where I'm stuck now. Have you seen this 
error before? This happens after everything is built, the build 
directory is removed, and things are freezing, so it's really late in 
the process. It looks like its an issue linking:

-Wl,--no-undefined -Wl,-z,noexecstack -shared -o libpyqt-demo.so 
pyqtdeploy_main.o pyqtdeploy_start.o pdytools_module.o _heapqmodule.o 
_math.o _posixsubprocess.o mathmodule.o selectmodule.o timemodule.o 
-lQtAndroidExtras -lQtCore -lQtGui -lQtNetwork -lQtWidgets -lpython3.6 
-lsip -L/home/jonny/Qt5.9.3/5.9.3/android_armv7/lib -lQt5Widgets 
-lQt5Gui -lQt5Network -lQt5AndroidExtras -lQt5Core -lGLESv2 
-lgnustl_shared -lgcc -llog -lz -lm -ldl -lc
os_makedev: error: undefined reference to 'makedev'
os_minor: error: undefined reference to 'minor'
os_major: error: undefined reference to 'major'
collect2: error: ld returned 1 exit status
Makefile:259: recipe for target 'libpyqt-demo.so' failed
make: *** [libpyqt-demo.so] Error 1


Doing some digging into the C code, it appears it has to with this block 
in line 58 of posixmodule.c 

/* GNU C Library: major(), minor(), makedev() */
#include <sys/sysmacros.h>

I wonder if it was a recent change based on this comment in February: 

Any ideas? I'm stumped on how to get the Android APK of the pyqtdeploy 
demo built. Even with the versions listed it seems to fail building.

Thanks for your time, you've been very helpful.

On 08/22/2018 02:18 PM, Phil Thompson wrote:
> On 22 Aug 2018, at 10:13 pm, Jonathan Leaders<jonathan at leadersandco.com>  wrote:
>> The missing steps in the docs would be which versions to download (it would be nice to have a series of wget commands to download  the exact versions required in the docs). I didn't see any versioning requirements in the docs, but I did see the image of versions here:http://pyqt.sourceforge.net/Docs/pyqtdeploy/demo.html
>> Are these versions in the image the ones I should use?
> If you don't want to change anything, eg. the sysroot.json file.
>> In any case, I notice I'm using openssl-1.0.2p.tar.gz -- not sure if 1.0.2p that is the same as 1.0.2 but it is failing to build trying to find the standard library (stdlib). Perhaps because the sysroot-android-32/includedirectory is empty? Shouldn't there be *.h files in there? I tried removing the sysroot and running again but it still failed.
> The include directory is populated as the sysroot is built.
> Do you have a working Android development environment set up?
> Phil


Leaders and Company <http://leadersandco.com> 		
*Jonathan Leaders <http://jonathanleaders.com>* • Coder 
<http://www.jonnyleaders.com/programming-portfolio/> • (424) 644-7048 
Leaders & Company LLC <http://leadersandco.com> • Los Angeles 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180823/54d88e8d/attachment.html>

More information about the PyQt mailing list