new android.add_libs_armeabi to add custom .so in the libs/armeabi directory.

This commit is contained in:
Mathieu Virbel 2013-09-11 15:08:28 +02:00
parent efc5c7b3e4
commit 4d8cf3ecc7
2 changed files with 18 additions and 1 deletions

View file

@ -95,6 +95,8 @@ fullscreen = 1
# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =
# (list) Android additionnal libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#
# iOS specific

View file

@ -22,7 +22,7 @@ from sys import platform, executable
from buildozer import BuildozerException
from buildozer.target import Target
from os import environ
from os.path import join, realpath, expanduser
from os.path import join, realpath, expanduser, basename
from shutil import copyfile
from glob import glob
@ -375,6 +375,21 @@ class TargetAndroid(Target):
package = self._get_package()
version = self.buildozer.get_version()
# add extra libs/armeabi files in dist/default/libs/armeabi
# XXX to the same for x86 and v7a
add_libs_armeabi = config.getlist('app', 'android.add_libs_armeabi', [])
for pattern in add_libs_armeabi:
matches = glob(expanduser(pattern.strip()))
if matches:
for fn in matches:
self.buildozer.file_copy(
join(self.buildozer.root_dir, fn),
join(dist_dir, 'libs', 'armeabi', basename(fn)))
else:
raise SystemError(
'Failed to find libs_armeabi files: {}'.format(
pattern))
build_cmd = (
'{python} build.py --name {name}'
' --version {version}'