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