X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/aa9890c5981fd602f0b8389dceab55c2c74e78df..295241d4043c55a41259b4846464e1668b2f6a5f:/packages/aapt/build.sh diff --git a/packages/aapt/build.sh b/packages/aapt/build.sh index 7bceacea..3f5d6826 100644 --- a/packages/aapt/build.sh +++ b/packages/aapt/build.sh @@ -1,12 +1,14 @@ +# FIXME: We would like to enable checksums when downloading +# tar files, but they change each time as the tar metadata +# differs: https://github.com/google/gitiles/issues/84 TERMUX_PKG_HOMEPAGE=http://elinux.org/Android_aapt TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool" _TAG_VERSION=7.0.0 -_TAG_REVISION=6 +_TAG_REVISION=14 TERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION} -TERMUX_PKG_BUILD_REVISION=1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_DEPENDS="libexpat, libpng, libzopfli" -TERMUX_PKG_CLANG=yes termux_step_make_install () { local _TAGNAME=${_TAG_VERSION}_r${_TAG_REVISION} @@ -38,7 +40,8 @@ termux_step_make_install () { mkdir -p android-base cd android-base tar xf $ANDROID_BASE_INCLUDE_TARFILE - + cd ../log + patch -p0 < $TERMUX_PKG_BUILDER_DIR/log.h.patch.txt # Build libcutils: mkdir -p $TERMUX_PKG_SRCDIR/{libcutils,androidfw} @@ -48,8 +51,8 @@ termux_step_make_install () { "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz" \ $LIBCUTILS_TARFILE tar xf $LIBCUTILS_TARFILE - $CXX -isystem $AOSP_INCLUDE_DIR -c -o sockets.o sockets.cpp - $CXX -isystem $AOSP_INCLUDE_DIR -c -o sockets_unix.o sockets_unix.cpp + $CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets.o sockets.cpp + $CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets_unix.o sockets_unix.cpp sed -i 's%include %include %' properties.c # From Android.mk: libcutils_common_sources="\ @@ -80,7 +83,7 @@ termux_step_make_install () { socket_network_client_unix.c \ sockets_unix.o \ str_parms.c" - $CC \ + $CC $CFLAGS \ -Dchar16_t=uint16_t \ -std=c11 \ -isystem $AOSP_INCLUDE_DIR \ @@ -115,6 +118,7 @@ termux_step_make_install () { tar xf $LIBUTILS_TARFILE # From Android.mk: #CallStack.cpp \ + #SystemClock.cpp \ commonSources="\ FileMap.cpp \ JenkinsHash.cpp \ @@ -129,7 +133,6 @@ termux_step_make_install () { StopWatch.cpp \ String8.cpp \ String16.cpp \ - SystemClock.cpp \ Threads.cpp \ Timers.cpp \ Tokenizer.cpp \ @@ -138,6 +141,7 @@ termux_step_make_install () { misc.cpp" $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \ -std=c++11 \ + '-DALOG_ASSERT(a,...)=' \ -Dtypeof=decltype \ -isystem $TERMUX_PREFIX/include/aosp \ -isystem $SAFE_IOP_DIR/include \ @@ -161,9 +165,9 @@ termux_step_make_install () { rm -Rf $TERMUX_PREFIX/include/aosp/android-base mv include/android-base $TERMUX_PREFIX/include/aosp patch -p1 < $TERMUX_PKG_BUILDER_DIR/libbase-patch.txt + #logging.cpp \ libbase_src_files="\ file.cpp \ - logging.cpp \ parsenetaddress.cpp \ stringprintf.cpp \ strings.cpp \ @@ -171,7 +175,7 @@ termux_step_make_install () { libbase_linux_src_files="\ errors_unix.cpp" # __USE_BSD for DEFFILEMODE to be defined by . - $CXX $CPPFLAGS -std=c++11 \ + $CXX $CXXFLAGS $CPPFLAGS -std=c++11 \ -D__USE_BSD \ -isystem $AOSP_INCLUDE_DIR \ $libbase_src_files $libbase_linux_src_files \ @@ -252,6 +256,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 +297,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 }