build-package.sh: Cleanup a bit

- Put everything into shell functions.
- Start fixing shellcheck warnings.
- Run a hostbuild before setting up an android toolchain (fixes #657).

It was quite a hasty rewrite, so things could be broken. Let me know!
This commit is contained in:
Fredrik Fornwall 2017-01-05 20:37:45 -05:00
parent 5584aa2e08
commit 7b1f1bd35d
8 changed files with 695 additions and 687 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,20 +4,20 @@ TERMUX_PKG_VERSION=2.20
TERMUX_PKG_SRCURL=http://patches.freeiz.com/alpine/release/src/alpine-${TERMUX_PKG_VERSION}.tar.xz
#TERMUX_PKG_DEPENDS="pcre, openssl, libuuid"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-c-client-target=lnx --without-pthread --without-password-prog --without-tcl --without-ldap --without-krb5 --disable-debug --with-system-pinerc=/data/data/com.termux/files/usr/etc/pine.conf --with-password-prog=no"
export TERMUX_HOST_PLATFORM="${TERMUX_ARCH}-linux-android"
if [ $TERMUX_ARCH = "arm" ]; then export TERMUX_HOST_PLATFORM="${TERMUX_HOST_PLATFORM}eabi"; fi
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_pre_configure () {
LDFLAGS+=" -lcrypt -llog"
LDFLAGS+=" -lcrypt -llog"
cp $TERMUX_PKG_BUILDER_DIR/getpass.c $TERMUX_PKG_SRCDIR/include/
cp $TERMUX_PKG_BUILDER_DIR/getpass.h $TERMUX_PKG_SRCDIR/include/
cd $TERMUX_PKG_SRCDIR
autoreconf -if
touch $TERMUX_PKG_SRCDIR/imap/lnxok
touch $TERMUX_PKG_SRCDIR/imap/lnxok
export TPATH=$PATH
}
export TPATH=$PATH
termux_step_pre_make () {
termux_step_post_configure() {
cd pith
$CC_FOR_BUILD help_c_gen.c -o help_c_gen
$CC_FOR_BUILD help_c_gen.c -o help_c_gen
$CC_FOR_BUILD help_h_gen.c -o help_h_gen
}

View File

@ -7,7 +7,7 @@ TERMUX_PKG_DEPENDS="perl"
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_pre_make(){
termux_step_post_configure(){
export INSTALL_DIR=${PREFIX}/bin
export MAN_DIR=${PREFIX}/share/man/man1
export ETC_DIR=${PREFIX}/etc

View File

@ -8,7 +8,7 @@ TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_CONFLICTS="lua,lua-dev"
TERMUX_PKG_REPLACES="lua,lua-dev"
termux_step_post_extract_package() {
termux_step_pre_configure() {
# luajit wants same pointer size for host and target build
export HOST_CC="gcc"
if [ $TERMUX_ARCH_BITS = "32" ]; then

View File

@ -16,7 +16,7 @@ termux_step_pre_configure() {
LDFLAGS+=" -llog" # liblog for android logging in syslog hack
}
termux_step_pre_make () {
termux_step_post_configure() {
# We need to remove this file before installing, since otherwise the
# install leaves it alone which means no updated timestamps.
rm -Rf $TERMUX_PREFIX/etc/moduli

View File

@ -12,7 +12,7 @@ termux_step_pre_configure () {
# TODO: Add the tsx extension with file/networking (http://heras-gilsanz.com/manuel/tsx.html)
# and the regexp extension (http://downloads.sourceforge.net/project/tinyscheme/tinyscheme-regex/1.3/re-1.3.tar.gz)
#termux_step_pre_make () {
#termux_step_post_configure () {
#TSX_TARFILE=$TERMUX_PKG_CACHEDIR/tsx-1.1.tar.gz
#test ! -f $TSX_TARFILE && curl -o $TSX_TARFILE "http://heras-gilsanz.com/manuel/tsx-1.1.tgz"
#}

View File

@ -9,7 +9,7 @@ TERMUX_PKG_FOLDERNAME=tty-clock-${_COMMIT}
TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_pre_make () {
termux_step_post_configure() {
LDFLAGS+=" -lncurses"
CFLAGS+=" $CPPFLAGS"
}

View File

@ -6,7 +6,7 @@ TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/zile/zile-${TERMUX_PKG_VERSION}
TERMUX_PKG_DEPENDS="libgc, ncurses"
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_pre_make () {
termux_step_post_configure() {
# zile uses help2man to build the zile.1 man page, which would require
# a host build. To avoid that just copy a pre-built man page.
cp $TERMUX_PKG_BUILDER_DIR/zile.1 $TERMUX_PKG_BUILDDIR/doc/zile.1