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