* 64-bit support
* update gitlab CI build
* update android.arch in buildozer.spec
This commit is contained in:
Akinwale Ariwodola 2019-07-10 21:34:52 +01:00 committed by GitHub
parent c977d2ed86
commit 530923640c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1794 additions and 64 deletions

View file

@ -25,6 +25,7 @@ build apk:
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
- cp -f $CI_PROJECT_DIR/scripts/mangled-glibc-syscalls__arm64.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
- git secret reveal
- mv buildozer.spec.ci buildozer.spec

2
app

@ -1 +1 @@
Subproject commit e3f66e4fa67867b1e2b80ada480cd05808cad136
Subproject commit fccf371dde3bebf7d13739cdca990c8dd0839a43

View file

@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
#android.copy_libs = 1
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a
android.arch = arm64-v8a
#
# Python for android (p4a) specific

View file

@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
#android.copy_libs = 1
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a
android.arch = arm64-v8a
#
# Python for android (p4a) specific

View file

@ -187,7 +187,7 @@ android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android
#android.copy_libs = 1
# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
android.arch = armeabi-v7a
android.arch = arm64-v8a
#
# Python for android (p4a) specific

View file

@ -70,7 +70,7 @@ class BdistAPK(Command):
sys.argv.append('--version={}'.format(version))
if not argv_contains('--arch'):
arch = 'armeabi'
arch = 'arm64-v8a'
self.arch = arch
sys.argv.append('--arch={}'.format(arch))

View file

@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
google()
maven { url "https://jitpack.io" }
}
dependencies {
@ -41,7 +41,7 @@ android {
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
abiFilters "armeabi-v7a", "arm64-v8a"
}
}

View file

@ -288,7 +288,7 @@ class ToolchainCL(object):
generic_parser.add_argument(
'--arch', help='The archs to build for, separated by commas.',
default='armeabi-v7a')
default='arm64-v8a')
# Options for specifying the Distribution
generic_parser.add_argument(

View file

@ -1,31 +1,27 @@
from os.path import exists, join
from multiprocessing import cpu_count
from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import info, shprint
from pythonforandroid.util import current_directory
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory, ensure_dir
import sh
class LibffiRecipe(Recipe):
"""
Requires additional system dependencies on Ubuntu:
- `automake` for the `aclocal` binary
- `autoconf` for the `autoreconf` binary
- `libltdl-dev` which defines the `LT_SYS_SYMBOL_USCORE` macro
"""
name = 'libffi'
version = 'v3.2.1'
url = 'https://github.com/atgreen/libffi/archive/{version}.zip'
version = '3.2.1'
url = 'https://github.com/libffi/libffi/archive/v{version}.tar.gz'
patches = ['remove-version-info.patch']
def get_host(self, arch):
with current_directory(self.get_build_dir(arch.arch)):
host = None
with open('Makefile') as f:
for line in f:
if line.startswith('host = '):
host = line.strip()[7:]
break
if not host or not exists(host):
raise RuntimeError('failed to find build output! ({})'
.format(host))
return host
patches = ['remove-version-info.patch',
# This patch below is already included into libffi's master
# branch and included in the pre-release 3.3rc0...so we should
# remove this when we update the version number for libffi
'fix-includedir.patch']
def should_build(self, arch):
return not exists(join(self.ctx.get_libs_dir(arch.arch), 'libffi.so'))
@ -37,47 +33,21 @@ class LibffiRecipe(Recipe):
shprint(sh.Command('./autogen.sh'), _env=env)
shprint(sh.Command('autoreconf'), '-vif', _env=env)
shprint(sh.Command('./configure'),
'--host=' + arch.toolchain_prefix,
'--prefix=' + self.ctx.get_python_install_dir(),
'--host=' + arch.command_prefix,
'--prefix=' + self.get_build_dir(arch.arch),
'--disable-builddir',
'--enable-shared', _env=env)
#'--with-sysroot={}'.format(self.ctx.ndk_platform),
#'--target={}'.format(arch.toolchain_prefix),
# ndk 15 introduces unified headers required --sysroot and
# -isysroot for libraries and headers. libtool's head explodes
# trying to weave them into it's own magic. The result is a link
# failure tryng to link libc. We call make to compile the bits
# and manually link...
shprint(sh.make, '-j', str(cpu_count()), 'libffi.la', _env=env)
try:
shprint(sh.make, '-j5', 'libffi.la', _env=env)
except sh.ErrorReturnCode_2:
info("make libffi.la failed as expected")
cc = sh.Command(env['CC'].split()[0])
cflags = env['CC'].split()[1:]
cflags.extend(['-march=armv7-a', '-mfloat-abi=softfp', '-mfpu=vfp',
'-mthumb', '-shared', '-fPIC', '-DPIC',
'src/.libs/prep_cif.o', 'src/.libs/types.o',
'src/.libs/raw_api.o', 'src/.libs/java_raw_api.o',
'src/.libs/closures.o', 'src/arm/.libs/sysv.o',
'src/arm/.libs/ffi.o', ]
)
ldflags = env['LDFLAGS'].split()
cflags.extend(ldflags)
cflags.extend(['-Wl,-soname', '-Wl,libffi.so', '-o',
'.libs/libffi.so'])
with current_directory(self.get_host(arch)):
shprint(cc, *cflags, _env=env)
shprint(sh.cp, '-t', self.ctx.get_libs_dir(arch.arch),
join(self.get_host(arch), '.libs', 'libffi.so'))
host_build = self.get_build_dir(arch.arch)
ensure_dir(self.ctx.get_libs_dir(arch.arch))
shprint(sh.cp,
join(host_build, '.libs', 'libffi.so'),
self.ctx.get_libs_dir(arch.arch))
def get_include_dirs(self, arch):
return [join(self.get_build_dir(arch.arch), self.get_host(arch),
'include')]
return [join(self.get_build_dir(arch.arch), 'include')]
recipe = LibffiRecipe()

View file

@ -0,0 +1,34 @@
From 982b89c01aca99c7bc229914fc1521f96930919b Mon Sep 17 00:00:00 2001
From: Yen Chi Hsuan <yan12125@gmail.com>
Date: Sun, 13 Nov 2016 19:17:19 +0800
Subject: [PATCH] Install public headers in the standard path
---
include/Makefile.am | 3 +--
libffi.pc.in | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/Makefile.am b/include/Makefile.am
index bb241e88..c59df9fb 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -6,5 +6,4 @@ DISTCLEANFILES=ffitarget.h
noinst_HEADERS=ffi_common.h ffi_cfi.h
EXTRA_DIST=ffi.h.in
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-nodist_includes_HEADERS = ffi.h ffitarget.h
+nodist_include_HEADERS = ffi.h ffitarget.h
diff --git a/libffi.pc.in b/libffi.pc.in
index edf6fde5..6fad83b4 100644
--- a/libffi.pc.in
+++ b/libffi.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
toolexeclibdir=@toolexeclibdir@
-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includedir=@includedir@
Name: @PACKAGE_NAME@
Description: Library supporting Foreign Function Interfaces

View file

@ -64,6 +64,7 @@ class OpenSSLRecipe(Recipe):
makefile = join(self.get_build_dir(arch.arch), 'Makefile')
sh.sed('-i', 's/CROSS_COMPILE=arm-linux-androideabi-/CROSS_COMPILE=/g', makefile)
sh.sed('-i', 's/CROSS_COMPILE=aarch64-linux-android-/CROSS_COMPILE=/g', makefile)
shprint(sh.make, 'build_libs', _env=env)
self.install_libs(arch, 'libssl.a', 'libssl' + self.version + '.so',

File diff suppressed because it is too large Load diff