diff --git a/buildozer/default.spec b/buildozer/default.spec index bf6045f..757f02d 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -95,6 +95,8 @@ fullscreen = 1 # (str) XML file to include as an intent filters in tag #android.manifest.intent_filters = +# (list) Android additionnal libraries to copy into libs/armeabi +#android.add_libs_armeabi = libs/android/*.so # # iOS specific diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 3c37466..eabe8ba 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -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}'