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