1 TERMUX_PKG_HOMEPAGE
=https
://developer.android.com
/tools
/sdk
/ndk
/index.html
2 TERMUX_PKG_DESCRIPTION
="Library extending the Android C library (Bionic) for additional multibyte, locale and math support"
3 # Increase last digit each time a patch changes.
4 TERMUX_PKG_VERSION
=${TERMUX_NDK_VERSION}.4
5 TERMUX_PKG_BUILD_IN_SRC
=yes
6 TERMUX_PKG_ESSENTIAL
=yes
8 termux_step_post_extract_package
() {
10 if [ "$TERMUX_ARCH_BITS" = "64" ]; then
11 # https://android.googlesource.com/platform/ndk.git/+/7c811775212f8ae0ecdcf60d05fefb1582207038
12 # For 64-bit bionic has almost everything except the following:
13 mkdir
-p src
/musl-locale
/ include
/
14 cp $NDK/sources
/android
/support
/src
/musl-locale
/{catclose.c
,catgets.c
,catopen.c
} src
/musl-locale
/
15 cp $NDK/sources
/android
/support
/include
/* include
/
17 cp -Rf
$NDK/sources
/android
/support
/* .
18 # See Android.mk for files not to build:
19 rm src
/musl-stdio
/vwscanf.c \
20 src
/musl-stdio
/wscanf.c \
21 src
/musl-locale
/newlocale.c \
22 src
/musl-locale
/nl_langinfo_l.c \
23 src
/musl-locale
/strcoll_l.c \
24 src
/musl-locale
/strxfrm_l.c \
25 src
/musl-locale
/wcscoll_l.c \
26 src
/musl-locale
/wcsxfrm_l.c \
27 src
/locale
/uselocale.c
31 termux_step_make_install
() {
32 if [ "$TERMUX_ARCH_BITS" = "64" ]; then
33 _C_FILES
="src/musl-*/*.c"
35 _C_FILES
="src/locale/*.c src/musl-*/*.c src/stdio/*.c src/*.c"
37 # Link against libm to avoid linkers having to do it
38 $CC $CFLAGS -std
=c99
-DNULL
=0 $CPPFLAGS $LDFLAGS -lm \
39 -Iinclude
-Isrc
/locale \
42 -o libandroid-support.so
44 cp libandroid-support.so
$TERMUX_PREFIX/lib
/
46 (cd $TERMUX_PREFIX/lib
; rm -f libiconv.so libintl.so
; ln -s libandroid-support.so libiconv.so
; ln -s libandroid-support.so libintl.so
)
48 rm -Rf
$TERMUX_PREFIX/include
/libandroid-support
49 mkdir
-p
$TERMUX_PREFIX/include
/libandroid-support
50 cp -Rf include
/* $TERMUX_PREFIX/include
/libandroid-support
/
52 (cd $TERMUX_PREFIX/include
; rm -f libintl.h
iconv.h
; ln -s libandroid-support
/libintl.h libintl.h
; ln -s libandroid-support
/iconv.h
iconv.h
)