Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade p4a clean #21

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a712121
import new p4a
jessopb Dec 2, 2022
9d1e47d
test build
jessopb Dec 2, 2022
7c64405
fix deployyml
jessopb Dec 2, 2022
5e5a98b
try specify ndk version
jessopb Dec 3, 2022
319c176
try ndk 25
jessopb Dec 3, 2022
13fc3a7
remove cffi custom, change requirements
jessopb Dec 3, 2022
2926957
try stock android w/ lbry modification
jessopb Dec 3, 2022
717d380
supply arch.arch to get_python_install_dir()
jessopb Dec 3, 2022
28818fb
try upgrade cython
jessopb Dec 3, 2022
6b2e690
minimal coincurve change
jessopb Dec 4, 2022
43541de
python install dir arch.arch
jessopb Dec 4, 2022
2ec4fe2
what if we just require coincurve
jessopb Dec 4, 2022
2aa1833
upgrade coincurve recipe version
jessopb Dec 4, 2022
d879cf9
tag version?
jessopb Dec 4, 2022
619cc17
update coincurve patches
jessopb Dec 4, 2022
21a6f15
try installing libssl-dev
jessopb Dec 4, 2022
40724fa
y
jessopb Dec 4, 2022
d123f86
update assemply fn name in bootstrap
jessopb Dec 6, 2022
2c8408d
lbry bootstrap
jessopb Dec 7, 2022
5a103bf
try update progress
jessopb Dec 8, 2022
d91c002
add zip dep
jessopb Dec 8, 2022
2c387e9
build.py parse_args ->
jessopb Dec 8, 2022
063a6ac
add --release
jessopb Dec 9, 2022
7bde41c
update setup
jessopb Dec 9, 2022
cb49abc
try service_library
jessopb Dec 9, 2022
2981927
try install openjdk 11
jessopb Dec 9, 2022
65b1c8e
try moving tmpl to service_library
jessopb Dec 9, 2022
682c067
rm nexus in build.tmpl.gradle
jessopb Dec 9, 2022
0ce2f15
increase heap size
jessopb Dec 9, 2022
0bbb913
gradlew stacktrace
jessopb Dec 9, 2022
e532ea7
debug strip
jessopb Dec 10, 2022
ca56ffb
change gradle in service build.tmpl.gradle
jessopb Dec 10, 2022
73d381d
compile -> implementation deps, print components
jessopb Dec 10, 2022
eb5308f
print args
jessopb Dec 10, 2022
1e326d5
print args actually
jessopb Dec 10, 2022
9641c77
try lbry bootstrap
jessopb Dec 11, 2022
4d2928b
rm venv
jessopb Dec 11, 2022
dae84b3
upgrade lbry template build.gradle temp
jessopb Dec 11, 2022
76a2934
upgrade_p4a_clean
jessopb Dec 11, 2022
ce68e25
add --release to lbry bulid
jessopb Dec 11, 2022
de51f07
upgrade gradle in build.gradle for lbry
jessopb Dec 11, 2022
bd0ae66
compile -> implement
jessopb Dec 11, 2022
0335719
comment out build.gradle lbry
jessopb Dec 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 6 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Assets

on:
push:
branches: [master]
branches: [master, upgrade_p4a_clean]

jobs:
build_arm64_aar:
Expand All @@ -16,20 +16,14 @@ jobs:
cp -r /root/.buildozer ~/.buildozer/
- name: setup
run: |
apt update
apt install libssl-dev zip unzip openjdk-11-jdk -y
export B_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
echo "BUILD_VERSION=${B_VERSION}" >> $GITHUB_ENV
export PATH=/usr/bin:$PATH
wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
cp -f $GITHUB_WORKSPACE/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
cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite
rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
wget -q 'https://dl.google.com/android/repository/android-ndk-r25b-linux.zip' -P ~/.buildozer/android/
unzip ~/.buildozer/android/android-ndk-r25b-linux.zip -d ~/.buildozer/android/
mv buildozer.spec.arm64.ci buildozer.spec
chmod u+x ./build-release.sh
- name: build release
Expand Down Expand Up @@ -77,6 +71,7 @@ jobs:
echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV
export PATH=/usr/bin:$PATH
wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
unzip ~/
tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json

p4a/*.apk
p4a/*.aar
venv
11 changes: 7 additions & 4 deletions buildozer.spec.arm64.ci
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
requirements = python3crystax, openssl, sqlite3, hostpython3crystax, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, prometheus_client==0.8.0, "git+https://github.com/lbryio/[email protected]#egg=lbry"

requirements = openssl, sqlite3, android, distro==1.4.0, pyjnius, certifi==2021.5.30, appdirs==1.4.3, docopt==0.6.2, base58==1.0.0, colorama==0.3.7, ecdsa==0.13.3, jsonschema==2.6.0, pbkdf2==1.3, pyyaml, protobuf==3.6.1, keyring==21.0.0, defusedxml, netifaces, aioupnp==0.0.17, asn1crypto, mock, cryptography, aiohttp==3.6.0, multidict==4.5.2, idna, yarl==1.3.0, chardet==3.0.4, async_timeout==3.0.1, coincurve, msgpack==0.6.1, six, attrs==18.2.0, pylru, hachoir, cffi, prometheus_client==0.8.0, "git+https://github.com/lbryio/[email protected]#egg=lbry"
# requirements = coincurve, "git+https://github.com/lbryio/[email protected]#egg=lbry"
# python3crystax, hostpython3crystax,
# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy
Expand Down Expand Up @@ -101,13 +102,15 @@ android.minapi = 21
android.sdk = 23

# (str) Android NDK version to use
#android.ndk = 13b
android.ndk = 25b

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
# android.ndk_path = ~/.buildozer/android/crystax-ndk-10.3.2
android.ndk_path = ~/.buildozer/android/android-ndk-r25b


# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path = ~/.buildozer/android
Expand Down
8 changes: 8 additions & 0 deletions docker/Dockerfile.python39.platform-28
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildoz
RUN tar -xvf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/ && \
mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk && \
unzip ~/.buildozer/android/platform/platform-28_r06.zip -d ~/.buildozer/android/platform/android-sdk/platforms && \
# android 9 (pie) comes with api level 28.
mv ~/.buildozer/android/platform/android-sdk/platforms/android-9 ~/.buildozer/android/platform/android-sdk/platforms/android-28 && \
mkdir -p ~/.buildozer/android/platform/android-sdk/build-tools && \
unzip ~/.buildozer/android/platform/build-tools_r28.0.3-linux.zip -d ~/.buildozer/android/platform/android-sdk/build-tools && \
Expand All @@ -45,3 +46,10 @@ RUN git clone https://github.com/lbryio/buildozer.git
RUN cd buildozer && python setup.py install && cd ..

CMD ["/bin/bash"]

# result is
# ./root/.buildozer/android/platform/android-sdk/[build-tools,cmdline-tools,licenses,platforms,tools]
# ...build-tools/28.0.3/
# ...cmdline-tools/5.0/[bin,lib,source.properties]
# ...platforms/android-28/[]
# ...tools/[]
3 changes: 1 addition & 2 deletions p4a/pythonforandroid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

__version__ = '0.5'
__version__ = '2022.09.04'
83 changes: 83 additions & 0 deletions p4a/pythonforandroid/androidndk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import sys
import os


class AndroidNDK:
"""
This class is used to get the current NDK information.
"""

ndk_dir = ""

def __init__(self, ndk_dir):
self.ndk_dir = ndk_dir

@property
def host_tag(self):
"""
Returns the host tag for the current system.
Note: The host tag is ``darwin-x86_64`` even on Apple Silicon macs.
"""
return f"{sys.platform}-x86_64"

@property
def llvm_prebuilt_dir(self):
return os.path.join(
self.ndk_dir, "toolchains", "llvm", "prebuilt", self.host_tag
)

@property
def llvm_bin_dir(self):
return os.path.join(self.llvm_prebuilt_dir, "bin")

@property
def clang(self):
return os.path.join(self.llvm_bin_dir, "clang")

@property
def clang_cxx(self):
return os.path.join(self.llvm_bin_dir, "clang++")

@property
def llvm_binutils_prefix(self):
return os.path.join(self.llvm_bin_dir, "llvm-")

@property
def llvm_ar(self):
return f"{self.llvm_binutils_prefix}ar"

@property
def llvm_ranlib(self):
return f"{self.llvm_binutils_prefix}ranlib"

@property
def llvm_objcopy(self):
return f"{self.llvm_binutils_prefix}objcopy"

@property
def llvm_objdump(self):
return f"{self.llvm_binutils_prefix}objdump"

@property
def llvm_readelf(self):
return f"{self.llvm_binutils_prefix}readelf"

@property
def llvm_strip(self):
return f"{self.llvm_binutils_prefix}strip"

@property
def sysroot(self):
return os.path.join(self.llvm_prebuilt_dir, "sysroot")

@property
def sysroot_include_dir(self):
return os.path.join(self.sysroot, "usr", "include")

@property
def sysroot_lib_dir(self):
return os.path.join(self.sysroot, "usr", "lib")

@property
def libcxx_include_dir(self):
return os.path.join(self.sysroot_include_dir, "c++", "v1")
Loading