aapt: Patch in a default platform package (-I)

This commit is contained in:
Fredrik Fornwall 2016-10-07 15:36:03 -04:00
parent 4d8dd31459
commit d94b319967
2 changed files with 25 additions and 0 deletions

View File

@ -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;

View File

@ -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
}