Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | TERMUX_PKG_HOMEPAGE=http://www.busybox.net/ |
2 | TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable" | |
3 | TERMUX_PKG_ESSENTIAL=yes | |
46559847 | 4 | TERMUX_PKG_VERSION=1.24.1 |
59f0d218 FF |
5 | TERMUX_PKG_SRCURL=http://www.busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 |
6 | TERMUX_PKG_BUILD_IN_SRC=yes | |
7 | ||
8 | # NOTE: sed on mac does not work for building busybox, install gsed and symlink sed => gsed | |
9 | ||
10 | CFLAGS+=" -llog -DTERMUX_EXPOSE_MEMPCPY=1" # Android system liblog.so for syslog | |
11 | ||
12 | termux_step_configure () { | |
13 | # Bug in gold linker with busybox in android r10e: | |
14 | # https://sourceware.org/ml/binutils/2015-02/msg00386.html | |
15 | CFLAGS+=" -fuse-ld=bfd" | |
16 | LD+=.bfd | |
17 | ||
18 | cp $TERMUX_PKG_BUILDER_DIR/busybox.config .config | |
19 | echo "CONFIG_SYSROOT=\"$TERMUX_STANDALONE_TOOLCHAIN/sysroot\"" >> .config | |
20 | echo "CONFIG_PREFIX=\"$TERMUX_PREFIX\"" >> .config | |
21 | echo "CONFIG_CROSS_COMPILER_PREFIX=\"${TERMUX_HOST_PLATFORM}-\"" >> .config | |
22 | echo "CONFIG_FEATURE_CROND_DIR=\"$TERMUX_PREFIX/var/spool/cron\"" >> .config | |
23 | make oldconfig | |
24 | } | |
25 | ||
26 | termux_step_post_make_install () { | |
27 | # Create symlinks in $PREFIX/bin/applets to $PREFIX/bin/busybox | |
28 | rm -Rf $TERMUX_PREFIX/bin/applets | |
29 | mkdir -p $TERMUX_PREFIX/bin/applets | |
30 | cd $TERMUX_PREFIX/bin/applets | |
31 | for f in `cat $TERMUX_PKG_SRCDIR/busybox.links`; do ln -s ../busybox `basename $f`; done | |
32 | ||
33 | cd $TERMUX_PREFIX/bin | |
34 | rm -f ash | |
4b74af2c | 35 | ln -s busybox ash |
59f0d218 FF |
36 | |
37 | # Install busybox man page | |
38 | mkdir -p $TERMUX_PREFIX/share/man/man1 | |
39 | cp $TERMUX_PKG_SRCDIR/docs/busybox.1 $TERMUX_PREFIX/share/man/man1 | |
f6b57934 FF |
40 | |
41 | # Needed for 'crontab -e' to work out of the box: | |
42 | local _CRONTABS=$TERMUX_PREFIX/var/spool/cron/crontabs | |
43 | mkdir -p $_CRONTABS | |
44 | echo "Used by the busybox crontab and crond tools" > $_CRONTABS/README.termux | |
59f0d218 FF |
45 | } |
46 |