fix: let's see what this does

This commit is contained in:
Lucaskyy 2022-06-16 20:40:28 +02:00
parent b496bf7496
commit a6b20cf4bb
No known key found for this signature in database
GPG Key ID: 1530BFF96D1EEB89
6 changed files with 43 additions and 139 deletions

View File

@ -10,47 +10,37 @@ on:
description: 'Reason'
required: false
default: 'update package'
env:
NDK_VERSION: "23.1.7779620"
jobs:
build:
name: build
runs-on: ubuntu-latest
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
strategy:
matrix:
target_arch: [i686]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clone termux-packages repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: termux/termux-packages
path: termux-packages
fetch-depth: 0
- name: Apply termux patches
run: |
cd termux-packages
git apply ../termux/*.patch
- name: Build aapt package
run: |
cd termux-packages
./scripts/run-docker.sh ./build-package.sh -a ${{ matrix.target_arch }} aapt
- name: Prepare artifacts
run: |
cd termux-packages/output
for pkg in *.deb; do dpkg-deb -x $pkg extracted_packages; done
cd extracted_packages/data/data/com.termux/files/usr/
rm -r include/ share/ lib/pkgconfig/ lib/cmake/
find bin ! -name 'aapt2' -mindepth 1 -exec rm -f {} +
- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
name: aapt-${{ matrix.target_arch }}-${{ github.sha }}
path: termux-packages/output/extracted_packages/data/data/com.termux/files/usr/bin/
distribution: 'zulu'
java-version: '8'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Setup Android NDK
run: sdkmanager "ndk;${{ env.NDK_VERSION }}"
- name: Build aapt2
env:
NDK_TOOLCHAIN: "${{ env.ANDROID_HOME }}/ndk/${{ env.NDK_VERSION }}"
run: ./build.sh
- uses: actions/upload-artifact@v3
with:
name: dist
path: sdk-tools-source/dist/

View File

@ -1,7 +1,18 @@
cd termux-packages
mv ../setup.sh .
./scripts/run-docker.sh ./setup.sh
for arch in "aarch64" "arm" "i686"; do
echo "Downloading sources.."
wget https://github.com/Lzhiyong/sdk-tools/releases/download/33.0.1/sdk-tools-source.zip -O sdk-tools-source.zip
unzip sdk-tools-source.zip
cd sdk-tools-source
for arch in "aarch64" "arm" "x86"; do
echo "Building aapt for $arch"
./scripts/run-docker.sh ./build-package.sh -I -a $arch aapt
buildAapt $arch
done
function buildAapt() {
arch=$1
python3 build.py \
--ndk="$NDK_TOOLCHAIN" \
--arch "$arch" \
--build "dist/$arch" \
--target aapt2
}

View File

@ -1,11 +0,0 @@
cd termux-packages/output
for pkg in *.deb
do
echo "Extracting $pkg"
extname=$(basename $pkg .deb)
dpkg-deb -x $pkg $extname
cd extracted_packages/data/data/com.termux/files/usr/
rm -r include/ share/ lib/pkgconfig/ lib/cmake/
find bin ! -name 'aapt2' -mindepth 1 -exec rm -f {} +
echo "Extracted $pkg to $extname"
done

View File

@ -1,4 +0,0 @@
mkdir -p /home/builder/.termux-build/aapt/src
cd /home/builder/.termux-build/aapt/src
echo "Cloning AOSP base..."
git clone --depth 1 --single-branch --branch android-12.0.0_r27 https://android.googlesource.com/platform/frameworks/base

View File

@ -1,82 +0,0 @@
--- a/packages/aapt/build.sh
+++ b/packages/aapt/build.sh
@@ -6,8 +6,7 @@ _TAG_VERSION=12.0.0
_TAG_REVISION=27
TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION}
TERMUX_PKG_REVISION=3
-TERMUX_PKG_SRCURL=(https://android.googlesource.com/platform/frameworks/base
- https://android.googlesource.com/platform/system/core
+TERMUX_PKG_SRCURL=(https://android.googlesource.com/platform/system/core
https://android.googlesource.com/platform/system/libbase
https://android.googlesource.com/platform/system/libziparchive
https://android.googlesource.com/platform/system/logging
@@ -21,7 +20,6 @@ TERMUX_PKG_SHA256=(SKIP_CHECKSUM
SKIP_CHECKSUM
SKIP_CHECKSUM
SKIP_CHECKSUM
- SKIP_CHECKSUM
SKIP_CHECKSUM)
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_BUILD_IN_SRC=true
@@ -34,6 +32,8 @@ termux_step_post_get_source() {
# tar files, but they change each time as the tar metadata
# differs: https://github.com/google/gitiles/issues/84
+ git clone --depth 1 https://github.com/iBotPeaches/platform_frameworks_base.git base
+
for i in $(seq 0 $(( ${#TERMUX_PKG_SRCURL[@]}-1 ))); do
git clone --depth 1 --single-branch \
--branch $TERMUX_PKG_GIT_BRANCH \
@@ -126,7 +126,7 @@ termux_step_make() {
for f in $libcutils_sources; do
$CXX $CXXFLAGS $CPPFLAGS $f -c
done
- $CC $CFLAGS *.o -shared $LDFLAGS \
+ $CC $CFLAGS *.o $LDFLAGS \
-o $_TMP_LIBDIR/libandroid-cutils.so
# Build libutils:
@@ -134,7 +134,7 @@ termux_step_make() {
for f in $libutils_sources; do
$CXX $CXXFLAGS $CPPFLAGS $f -c
done
- $CXX $CXXFLAGS *.o -shared $LDFLAGS \
+ $CXX $CXXFLAGS *.o $LDFLAGS \
-landroid-cutils \
-o $_TMP_LIBDIR/libandroid-utils.so
@@ -143,7 +143,7 @@ termux_step_make() {
for f in $libbase_sources; do
$CXX $CXXFLAGS $CPPFLAGS $f -c
done
- $CXX $CXXFLAGS *.o -shared $LDFLAGS \
+ $CXX $CXXFLAGS *.o $LDFLAGS \
-o $_TMP_LIBDIR/libandroid-base.so
# Build libziparchive:
@@ -151,7 +151,7 @@ termux_step_make() {
for f in $libziparchive_sources; do
$CXX $CXXFLAGS -std=c++20 $CPPFLAGS -I$INCFS_SUPPORT_INCDIR $f -c
done
- $CXX $CXXFLAGS *.o -shared $LDFLAGS \
+ $CXX $CXXFLAGS *.o $LDFLAGS \
-landroid-base \
-lz \
-o $_TMP_LIBDIR/libandroid-ziparchive.so
@@ -165,7 +165,7 @@ termux_step_make() {
for f in $androidfw_sources $INCFS_UTIL_SRCDIR/map_ptr.cpp; do
$CXX $CXXFLAGS $CPPFLAGS $f -c
done
- $CXX $CXXFLAGS *.o -shared $LDFLAGS \
+ $CXX $CXXFLAGS *.o $LDFLAGS \
-landroid-base \
-landroid-cutils \
-landroid-ziparchive \
@@ -203,6 +203,7 @@ termux_step_make() {
-lexpat \
-lpng \
-lprotobuf \
+ -static \
-o $_TMP_BINDIR/aapt2
# Build zipalign: