Browse Source

Add android-libcutils as disabled package

android-5
Fredrik Fornwall 9 years ago
parent
commit
d1ea38d86d
  1. 30
      disabled-packages/android-libcutils/build.sh
  2. 31
      disabled-packages/android-libcutils/log.h

30
disabled-packages/android-libcutils/build.sh

@ -0,0 +1,30 @@
TERMUX_PKG_HOMEPAGE=http://elinux.org/Android_aapt
TERMUX_PKG_DESCRIPTION="Library providing common functionalities for Android related tools"
TERMUX_PKG_VERSION=6.0.1
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_make_install () {
local _TAGNAME=${TERMUX_PKG_VERSION}_r5
LIBCUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_${_TAGNAME}.tar.gz
test ! -f $LIBCUTILS_TARFILE && curl -o $LIBCUTILS_TARFILE "https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz"
# https://android.googlesource.com/platform/system/core/+/android-4.4.4_r2/include/cutils/
LIBCUTILS_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_include_${_TAGNAME}.tar.gz
test ! -f $LIBCUTILS_INCLUDE_TARFILE && curl -o $LIBCUTILS_INCLUDE_TARFILE \
"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/include/cutils.tar.gz"
mkdir -p libcutils include/{cutils,log}
tar xf $LIBCUTILS_INCLUDE_TARFILE -C include/cutils
cp $TERMUX_PKG_BUILDER_DIR/log.h include/log/
cp $TERMUX_PKG_BUILDER_DIR/log.h include/cutils/
cp -Rf include/cutils $TERMUX_PREFIX/include/cutils
cd libcutils
tar xf $LIBCUTILS_TARFILE
rm dlmalloc_stubs.c ashmem-host.c properties.c fs_config.c trace-*.c
$CC -isystem $TERMUX_PKG_SRCDIR/include *.c -shared -o $TERMUX_PREFIX/lib/libcutils.so
}

31
disabled-packages/android-libcutils/log.h

@ -0,0 +1,31 @@
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <android/log.h>
/* https://android.googlesource.com/platform/system/core/+/android-4.4.4_r2/include/log/log.h */
#define QUOTEME_(x) #x
#define QUOTEME(x) QUOTEME_(x)
#define ALOGV(...) printf("VERBOSE (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__)
#define ALOGD(...) printf("DEBUG (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__)
#define ALOGI(...) printf("INFO (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__)
#define ALOGW(...) printf("WARNING (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__)
#define ALOGE(...) printf("ERROR (" __FILE__ ":" QUOTEME(__LINE__) "): " __VA_ARGS__)
#define HAL_PRIORITY_URGENT_DISPLAY ANDROID_LOG_INFO
#define LOG_FATAL_IF(...)
#define LOG_ALWAYS_FATAL(...)
#define LOG_ALWAYS_FATAL_IF(...)
#define LOG_PRI(...)
#define ALOGW_IF(...)
#define android_printAssert(cond, tag, fmt...)
#define ALOG_ASSERT(...)
#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
#define OS_PATH_SEPARATOR '/'
Loading…
Cancel
Save