Commit | Line | Data |
---|---|---|
59f0d218 FF |
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" | |
a922c73f | 3 | TERMUX_PKG_VERSION=${TERMUX_NDK_VERSION} |
59f0d218 FF |
4 | TERMUX_PKG_BUILD_IN_SRC=yes |
5 | TERMUX_PKG_ESSENTIAL=yes | |
6 | ||
7 | termux_step_post_extract_package () { | |
c5730e4d | 8 | mkdir -p src/musl-locale/ src/musl-multibyte/ include/ src/musl-ctype/ |
d453a486 | 9 | cp $NDK/sources/android/support/src/musl-multibyte/{mblen.c,mbsrtowcs.c,mbsnrtowcs.c,libc.h,internal.h,internal.c} src/musl-multibyte/ |
0c1ada1f | 10 | cp $NDK/sources/android/support/src/musl-locale/{catclose.c,catgets.c,catopen.c} src/musl-locale/ |
c48baa62 | 11 | cp $NDK/sources/android/support/src/musl-locale/{langinfo.c,intl.c,iconv.c,strfmon.c} src/musl-locale/ |
c5730e4d FF |
12 | cp $NDK/sources/android/support/src/musl-ctype/* src/musl-ctype/ |
13 | ||
0c1ada1f FF |
14 | cp $NDK/sources/android/support/include/* include/ |
15 | cp $NDK/sources/android/support/src/musl-locale/{libc.h,codepages.h,legacychars.h,jis0208.h,gb18030.h,big5.h,hkscs.h,ksc.h} include/ | |
65d7b23c FF |
16 | |
17 | # Use up-to-date (Unicode 9) wcwidth: | |
18 | cp $TERMUX_PKG_BUILDER_DIR/wcwidth.c $NDK/sources/android/support/src/musl-ctype/wcwidth.c | |
59f0d218 FF |
19 | } |
20 | ||
21 | termux_step_make_install () { | |
0c1ada1f | 22 | _C_FILES="src/musl-*/*.c" |
59f0d218 | 23 | # Link against libm to avoid linkers having to do it |
b27e6fed FF |
24 | $CC $CFLAGS -std=c99 -DNULL=0 $CPPFLAGS $LDFLAGS -lm \ |
25 | -Iinclude -Isrc/locale \ | |
8f7dda83 | 26 | $_C_FILES \ |
b27e6fed FF |
27 | -shared -fpic \ |
28 | -o libandroid-support.so | |
59f0d218 | 29 | |
b27e6fed | 30 | cp libandroid-support.so $TERMUX_PREFIX/lib/ |
59f0d218 | 31 | |
b27e6fed | 32 | (cd $TERMUX_PREFIX/lib; ln -f -s libandroid-support.so libiconv.so; ln -f -s libandroid-support.so libintl.so) |
59f0d218 FF |
33 | |
34 | rm -Rf $TERMUX_PREFIX/include/libandroid-support | |
35 | mkdir -p $TERMUX_PREFIX/include/libandroid-support | |
36 | cp -Rf include/* $TERMUX_PREFIX/include/libandroid-support/ | |
37 | ||
b27e6fed | 38 | (cd $TERMUX_PREFIX/include; ln -f -s libandroid-support/libintl.h libintl.h; ln -f -s libandroid-support/iconv.h iconv.h) |
59f0d218 | 39 | } |