Пользовательский рецепт для Python для Android не удалось в ld
Следующий рецепт, который я написал для android для python for Persistence (PyPi), чтобы запустить zodb под kivy/android:
from pythonforandroid.toolchain import PythonRecipe
class PersistenceRecipe(PythonRecipe):
url ='https://pypi.python.org/packages/c1/f8/39c50b4d91f0aa0d28423159c6d16751b63de758a4e5358e98140ff987e7/Persistence-2.13.2.zip'
depends = ['python2', 'setuptools']
call_hostpython_via_targetpython = False
recipe = PersistenceRecipe()
при запуске buildozer -v android debug произошел сбой при установке следующих пакетов:
[INFO]: android said it is already built, skipping
[INFO]: Building persistence for armeabi-v7a
[INFO]: persistence apparently isn't already in site-packages
[INFO]: Installing persistence into site-packages
[INFO]: -> directory context /home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/persistence/armeabi-v7a/persistence
[INFO]: -> running hostpython setup.py install -O2 --root=/home/fwe/src/sailnav/.buildozer/android/platform/build/build/python-installs/sailna...(and 43 more)
working: gcc: error: unrecognized command line option '-mfpu=vfp';Exception in thread background thread for pid 22243:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 2170, in background_thread
handle_exit_code(exit_code)
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 1929, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
raise exc
ErrorReturnCode_1:
RAN: /ho
me/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py install -O2 --root=/home/fwe/src/sailnav/.buildozer/android/platform/build/build/python-installs/sailnav --install-lib=lib/python2.7/site-packages
STDOUT:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/Persistence
copying src/Persistence/__init__.py -> build/lib.linux-x86_64-2.7/Persistence
copying src/Persistence/mapping.py -> build/lib.linux-x86_64-2.7/Persistence
creating build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/__init__.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/test_mapping.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/test_ExtensionClass.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/testPersistent.py -> build/lib.linux-x86_64-2.7/Persistence/tests
running egg_info
writing requirements to src/Persistence.egg-info/requires.txt
writing src/Persistence.egg-info/PKG-INFO
writing top-level names to src/Persistence.egg-info/top_level.txt
writing dependency_links to src/Persistence.egg-info/dependency_links.txt
reading manifest file 'src/Persistence.egg-info/SOURCES.txt'
writing manifest file 'src/Persistence.egg-info/SOURCES.txt'
copying src/Persistence/_Persistence.c -> build/lib.linux-x86_64-2.7/Persistence
running build_ext
building 'Persistence._Persistence' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/Persistence
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Iinclude -Isrc -I/home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Include -I/home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2 -c src/Persistence/_Persistence.c -o build/temp.linux-x86_64-2.7/src/Persistence/_Persistence.o
In file included from src/Persistence/_Persistence.c:21:0:
src/Persistence/_Persistence.c: In function 'P_getattr':
include/persistent/cPersistence.h:127:73: warning: value computed is not used [-Wunused-value]
#define PER_ALLOW_DEACTIVATION(O) ((O)->state==cPersistent_STICKY_STATE && ((O)->state=cPersistent_UPTODATE_STATE))
^
src/Persistence/_Persistence.c:111:11: note: in expansion of macro 'PER_ALLOW_DEACTIVATION'
PER_ALLOW_DEACTIVATION(self);
^
gcc -pthread -shared -lm -L/home/fwe/src/sailnav/.buildozer/android/platform/build/build/libs_collections/sailnav/armeabi-v7a -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb build/temp.linux-x86_64-2.7/src/Persistence/_Persistence.o -o build/lib.linux-x86_64-2.7/Persistence/_Persistence.so
gcc: error: unrecognized command line option '-mfloat-abi=softfp'
gcc: error: unrecognized command line option '-mfpu=vfp'; did you mean '-mcpu='?
gcc: error: unrecognized command line option '-mthumb'; did you mean '-mtbm'?
error: command 'gcc' failed with exit status 1
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/fwe/src/python-for-android/pythonforandroid/toolchain.py", line 916, in <module>
main()
File "/home/fwe/src/python-for-android/pythonforandroid/toolchain.py", line 913, in main
ToolchainCL()
File "/home/fwe/src/python-for-android/pythonforandroid/toolchain.py", line 514, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/fwe/src/python-for-android/pythonforandroid/toolchain.py", line 147, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/fwe/src/python-for-android/pythonforandroid/toolchain.py", line 192, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 572, in build_recipes
File "pythonforandroid/recipe.py", line 806, in build_arch
File "pythonforandroid/recipe.py", line 859, in install_python_package
File "pythonforandroid/logger.py", line 175, in shprint
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 720, in next
self.wait()
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 651, in wait
self.handle_command_exit_code(exit_code)
File "/home/fwe/.local/lib/python2.7/site-packages/sh.py", line 672, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/hostpython setup.py install -O2 --root=/home/fwe/src/sailnav/.buildozer/android/platform/build/build/python-installs/sailnav --install-lib=lib/python2.7/site-packages
STDOUT:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/Persistence
copying src/Persistence/__init__.py -> build/lib.linux-x86_64-2.7/Persistence
copying src/Persistence/mapping.py -> build/lib.linux-x86_64-2.7/Persistence
creating build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/__init__.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/test_mapping.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/test_ExtensionClass.py -> build/lib.linux-x86_64-2.7/Persistence/tests
copying src/Persistence/tests/testPersistent.py -> build/lib.linux-x86_64-2.7/Persistence/tests
running egg_info
writing requirements to src/Persistence.egg-info/requires.txt
writing src/Persistence.egg-info/PKG-INFO
writing top-level names to src/Persistence.egg-info/top_level.txt
writing dependency_links to src/Persistence.egg-info/dependency_links.txt
reading manifest file 'src/Persistence.egg-info/SOURCES.txt'
writing manifest file 'src/Persistence.egg-info/SOURCES.txt'
copying src/Persistence/_Persistence.c -> build/lib.linux-x86_64-2.7/Persistence
running build_ext
building 'Persistence._Persistence' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/Persistence
/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -fPIC -Iinclude -Isrc -I/home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/Include -I/home/fwe/src/sailnav/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2 -c src/Persistence/_Persistence.c -o build/temp.linux-x86_64-2.7/src/Persistence/_Persistence.o
In file included from src/Persistence/_Persistence.c:21:0:
src/Persistence/_Persistence.c: In function 'P_getattr':
include/persistent/cPersistence.h:127:73: warning: value computed is not used [-Wunused-value]
#define PER_ALLOW_DEACTIVATION(O) ((O)->state==cPersistent_STICKY_STATE && ((O)->state=cPersistent_UPTODATE_STATE))
^
src/Persistence/_Persistence.c:111:11: note: in expansion of macro 'PER_ALLOW_DEACTIVATION'
PER_ALLOW_DEACTIVATION(self);
^
gcc -pthread -shared -lm -L/home/fwe/src/sailnav/.buildozer/android/platform/build/build/libs_collections/sailnav/armeabi-v7a -DANDROID -mandroid -fomit-frame-pointer --sysroot /home/fwe/.buildozer/android/platform/android-ndk-r9c/platforms/android-15/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb build/temp.linux-x86_64-2.7/src/Persistence/_Persistence.o -o build/lib.linux-x86_64-2.7/Persistence/_Persistence.so
gcc: error: unrecognized command line option '-mfloat-abi=softfp'
gcc: error: unrecognized command line option '-mfpu=vfp'; did you mean '-mcpu='?
gcc: error: unrecognized command line option '-mthumb'; did you mean '-mtbm'?
error: command 'gcc' failed with exit status 1
STDERR:
# Command failed: /usr/bin/python2.7 -m pythonforandroid.toolchain create --dist_name=sailnav --bootstrap=sdl2 --requirements=kivy,plyer,android,pyproj,persistence --arch armeabi-v7a --copy-libs --local-recipes /home/fwe/src/sailnav/recipes --color=always --storage-dir=/home/fwe/src/sailnav/.buildozer/android/platform/build
#
# Buildozer failed to execute the last command
Я полагаю, проблема в том, что вместо вызова arm-ld был вызван x86-ld. Но сейчас я не знаю, как настроить код рецепта, чтобы изменить это.