From d94b31996739804f2033659af99d3fbd198e930e Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 7 Oct 2016 15:36:03 -0400 Subject: [PATCH] aapt: Patch in a default platform package (-I) --- packages/aapt/aapt-Main.cpp.patch.txt | 13 +++++++++++++ packages/aapt/build.sh | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 packages/aapt/aapt-Main.cpp.patch.txt diff --git a/packages/aapt/aapt-Main.cpp.patch.txt b/packages/aapt/aapt-Main.cpp.patch.txt new file mode 100644 index 000000000..205527f35 --- /dev/null +++ b/packages/aapt/aapt-Main.cpp.patch.txt @@ -0,0 +1,13 @@ +diff -u -r ../../src-pristine/aapt/Main.cpp ./Main.cpp +--- ../../src-pristine/aapt/Main.cpp 2016-10-07 15:12:44.322248606 -0400 ++++ ./Main.cpp 2016-10-07 15:18:50.708065085 -0400 +@@ -268,6 +268,9 @@ + /* default to compression */ + bundle.setCompressionMethod(ZipEntry::kCompressDeflated); + ++ // Convenience when using aapt in termux. ++ bundle.addPackageInclude("@TERMUX_PREFIX@/share/aapt/android.jar"); ++ + if (argc < 2) { + wantUsage = true; + goto bail; diff --git a/packages/aapt/build.sh b/packages/aapt/build.sh index efcd560e8..410eee711 100644 --- a/packages/aapt/build.sh +++ b/packages/aapt/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool" _TAG_VERSION=7.0.0 _TAG_REVISION=14 TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION} +TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_DEPENDS="libexpat, libpng, libzopfli" TERMUX_PKG_CLANG=yes @@ -252,6 +253,7 @@ termux_step_make_install () { mkdir $TERMUX_PKG_SRCDIR/aapt cd $TERMUX_PKG_SRCDIR/aapt tar xf $AAPT_TARFILE + sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PKG_BUILDER_DIR/aapt-Main.cpp.patch.txt | patch -p1 $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \ -std=c++11 \ -DANDROID_SMP=1 \ @@ -292,4 +294,14 @@ termux_step_make_install () { # Remove this one for now: rm -Rf $AOSP_INCLUDE_DIR + + # Create an android.jar with AndroidManifest.xml and resources.arsc: + cd $TERMUX_PKG_TMPDIR + rm -rf android-jar + mkdir android-jar + cd android-jar + cp $ANDROID_HOME/platforms/android-24/android.jar . + unzip -q android.jar + mkdir -p $TERMUX_PREFIX/share/aapt + zip -q $TERMUX_PREFIX/share/aapt/android.jar AndroidManifest.xml resources.arsc }