Browse Source

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!
android-5
Fredrik Fornwall 8 years ago
parent
commit
7b1f1bd35d
  1. 1372
      build-package.sh
  2. 14
      disabled-packages/alpine/build.sh
  3. 2
      packages/colordiff/build.sh
  4. 2
      packages/libluajit/build.sh
  5. 2
      packages/openssh/build.sh
  6. 2
      packages/tinyscheme/build.sh
  7. 2
      packages/tty-clock/build.sh
  8. 2
      packages/zile/build.sh

1372
build-package.sh

File diff suppressed because it is too large

14
disabled-packages/alpine/build.sh

@ -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_SRCURL=http://patches.freeiz.com/alpine/release/src/alpine-${TERMUX_PKG_VERSION}.tar.xz
#TERMUX_PKG_DEPENDS="pcre, openssl, libuuid" #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" 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_PKG_BUILD_IN_SRC=yes
termux_step_pre_configure () { 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.c $TERMUX_PKG_SRCDIR/include/
cp $TERMUX_PKG_BUILDER_DIR/getpass.h $TERMUX_PKG_SRCDIR/include/ cp $TERMUX_PKG_BUILDER_DIR/getpass.h $TERMUX_PKG_SRCDIR/include/
cd $TERMUX_PKG_SRCDIR cd $TERMUX_PKG_SRCDIR
autoreconf -if 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 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 $CC_FOR_BUILD help_h_gen.c -o help_h_gen
} }

2
packages/colordiff/build.sh

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

2
packages/libluajit/build.sh

@ -8,7 +8,7 @@ TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_CONFLICTS="lua,lua-dev" TERMUX_PKG_CONFLICTS="lua,lua-dev"
TERMUX_PKG_REPLACES="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 # luajit wants same pointer size for host and target build
export HOST_CC="gcc" export HOST_CC="gcc"
if [ $TERMUX_ARCH_BITS = "32" ]; then if [ $TERMUX_ARCH_BITS = "32" ]; then

2
packages/openssh/build.sh

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

2
packages/tinyscheme/build.sh

@ -12,7 +12,7 @@ termux_step_pre_configure () {
# TODO: Add the tsx extension with file/networking (http://heras-gilsanz.com/manuel/tsx.html) # 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) # 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 #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" #test ! -f $TSX_TARFILE && curl -o $TSX_TARFILE "http://heras-gilsanz.com/manuel/tsx-1.1.tgz"
#} #}

2
packages/tty-clock/build.sh

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

2
packages/zile/build.sh

@ -6,7 +6,7 @@ TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/zile/zile-${TERMUX_PKG_VERSION}
TERMUX_PKG_DEPENDS="libgc, ncurses" TERMUX_PKG_DEPENDS="libgc, ncurses"
TERMUX_PKG_BUILD_IN_SRC=yes 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 # 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. # 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 cp $TERMUX_PKG_BUILDER_DIR/zile.1 $TERMUX_PKG_BUILDDIR/doc/zile.1

Loading…
Cancel
Save