diff --git a/packages/coreutils/build.sh b/packages/coreutils/build.sh index f321861d5..b85636e7e 100755 --- a/packages/coreutils/build.sh +++ b/packages/coreutils/build.sh @@ -14,4 +14,6 @@ TERMUX_PKG_BUILD_IN_SRC=yes # Host build for man pages generated by help2man, see makefile.patch: TERMUX_PKG_HOSTBUILD=yes -CPPFLAGS+=" -DDEFAULT_TMPDIR=\\\"$TERMUX_PREFIX/tmp\\\"" +termux_step_pre_configure() { + CPPFLAGS+=" -DDEFAULT_TMPDIR=\\\"$TERMUX_PREFIX/tmp\\\"" +} diff --git a/packages/direvent/build.sh b/packages/direvent/build.sh index 3717d12f4..a6c96e7c0 100644 --- a/packages/direvent/build.sh +++ b/packages/direvent/build.sh @@ -4,4 +4,6 @@ TERMUX_PKG_VERSION=5.1 TERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/direvent/direvent-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libandroid-glob" -LDFLAGS+=" -llog -landroid-glob" +termux_step_pre_configure() { + LDFLAGS+=" -llog -landroid-glob" +} diff --git a/packages/dnsutils/build.sh b/packages/dnsutils/build.sh index 500092891..138f7e93f 100644 --- a/packages/dnsutils/build.sh +++ b/packages/dnsutils/build.sh @@ -8,16 +8,18 @@ TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-gssapi=no --with-randomdev=/dev/random -with-ecdsa=no --with-gost=no --with-libxml2=no --with-libtool" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX" -export BUILD_AR=ar -export BUILD_CC=gcc -export BUILD_CFLAGS= -export BUILD_CPPFLAGS= -export BUILD_LDFLAGS= -export BUILD_RANLIB= +termux_step_pre_configure () { + export BUILD_AR=ar + export BUILD_CC=gcc + export BUILD_CFLAGS= + export BUILD_CPPFLAGS= + export BUILD_LDFLAGS= + export BUILD_RANLIB= -_RESOLV_CONF=$TERMUX_PREFIX/etc/resolv.conf -CFLAGS+=" $CPPFLAGS -DRESOLV_CONF=\\\"$_RESOLV_CONF\\\"" -LDFLAGS+=" -llog" + _RESOLV_CONF=$TERMUX_PREFIX/etc/resolv.conf + CFLAGS+=" $CPPFLAGS -DRESOLV_CONF=\\\"$_RESOLV_CONF\\\"" + LDFLAGS+=" -llog" +} termux_step_make () { make -C lib/isc diff --git a/packages/elfutils/build.sh b/packages/elfutils/build.sh index 72050b44a..de81e4c0b 100644 --- a/packages/elfutils/build.sh +++ b/packages/elfutils/build.sh @@ -10,13 +10,13 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--program-prefix='eu-'" # The ar.c file is patched away for now: TERMUX_PKG_RM_AFTER_INSTALL="bin/eu-ar" -LDFLAGS+=" -lintl" -CFLAGS+=" -DTERMUX_EXPOSE_MEMPCPY=1 -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error" +termux_step_pre_configure() { + LDFLAGS+=" -lintl" + CFLAGS+=" -DTERMUX_EXPOSE_MEMPCPY=1 -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error" -# Exposes ACCESSPERMS in which elfutils uses: -CFLAGS+=" -D__USE_BSD" + # Exposes ACCESSPERMS in which elfutils uses: + CFLAGS+=" -D__USE_BSD" -termux_step_pre_configure () { # Install argp lib. ARGP_FILE=$TERMUX_PKG_CACHEDIR/argp-standalone.1.3.tar.gz if [ ! -f $ARGP_FILE ]; then diff --git a/packages/figlet/build.sh b/packages/figlet/build.sh index d57a0caf3..9a04e9070 100644 --- a/packages/figlet/build.sh +++ b/packages/figlet/build.sh @@ -4,4 +4,6 @@ TERMUX_PKG_VERSION=2.2.5 TERMUX_PKG_SRCURL=ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes -LD=$CC +termux_step_pre_configure () { + LD=$CC +} diff --git a/packages/finch/build.sh b/packages/finch/build.sh index de72e8e75..45f8ac728 100644 --- a/packages/finch/build.sh +++ b/packages/finch/build.sh @@ -7,8 +7,10 @@ TERMUX_PKG_DEPENDS="libgnutls, libxml2, ncurses-ui-libs, glib" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-gtkui --disable-gstreamer --disable-vv --disable-idn --disable-meanwhile --disable-avahi --disable-dbus --disable-perl --disable-tcl --without-zephyr --with-ncurses-headers=$TERMUX_PREFIX/include --without-python" TERMUX_PKG_RM_AFTER_INSTALL="share/sounds/purple lib/purple-2/libmsn.so" -# For arpa: -CFLAGS="$CFLAGS -isystem $TERMUX_PKG_BUILDER_DIR" +termux_step_pre_configure () { + # For arpa: + CFLAGS+=" -isystem $TERMUX_PKG_BUILDER_DIR" +} termux_step_post_configure () { # Hack to compile first version of libpurple-ciphers.la diff --git a/packages/fish/build.sh b/packages/fish/build.sh index 3aac8f634..abe874484 100644 --- a/packages/fish/build.sh +++ b/packages/fish/build.sh @@ -9,7 +9,9 @@ TERMUX_PKG_DEPENDS="ncurses, libandroid-support, ncurses-utils, man" TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_FOLDERNAME=fish-$TERMUX_PKG_VERSION -CXXFLAGS+=" $CPPFLAGS" +termux_step_pre_configure() { + CXXFLAGS+=" $CPPFLAGS" +} termux_step_post_make_install () { cat >> $TERMUX_PREFIX/etc/fish/config.fish <> termux_configure.cache echo "glib_cv_stack_grows=no" >> termux_configure.cache echo "glib_cv_uscore=no" >> termux_configure.cache - #echo "ac_cv_func_posix_getpwuid_r=yes" >> termux_configure.cache - #echo "ac_cv_func_posix_getgrgid_r=yes" >> termux_configure.cache - #echo "ac_cv_func_posix_getpwnam_r=yes" >> termux_configure.cache - #echo "ac_cv_func_posix_getpwuid_r=yes" >> termux_configure.cache - #echo "ac_cv_header_pwd_h=no" >> termux_configure.cache - chmod a-w termux_configure.cache # prevent configure from changing + chmod a-w termux_configure.cache } diff --git a/packages/gnugo/build.sh b/packages/gnugo/build.sh index 7da088482..43d9edca3 100644 --- a/packages/gnugo/build.sh +++ b/packages/gnugo/build.sh @@ -6,7 +6,9 @@ TERMUX_PKG_DEPENDS="ncurses, readline" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-readline" TERMUX_PKG_HOSTBUILD=yes -export CFLAGS="$CFLAGS -Wno-overflow" +termux_step_pre_configure() { + CFLAGS+=" -Wno-overflow" +} termux_step_post_configure () { cp $TERMUX_PKG_HOSTBUILD_DIR/patterns/mkeyes $TERMUX_PKG_BUILDDIR/patterns/mkeyes diff --git a/packages/gnushogi/build.sh b/packages/gnushogi/build.sh index 9145f2a1d..5932d8768 100644 --- a/packages/gnushogi/build.sh +++ b/packages/gnushogi/build.sh @@ -6,7 +6,10 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_curses_clrtoeol=yes --with-curses" TERMUX_PKG_RM_AFTER_INSTALL="info/gnushogi.info" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_HOSTBUILD=yes -export CFLAGS="$CFLAGS $CPPFLAGS" + +termux_step_pre_configure() { + CFLAGS+=" $CPPFLAGS" +} termux_step_post_configure () { cp $TERMUX_PKG_HOSTBUILD_DIR/gnushogi/pat2inc $TERMUX_PKG_BUILDDIR/gnushogi/pat2inc diff --git a/packages/inetutils/build.sh b/packages/inetutils/build.sh index bb78ea8f2..254563514 100644 --- a/packages/inetutils/build.sh +++ b/packages/inetutils/build.sh @@ -8,5 +8,7 @@ TERMUX_PKG_DEPENDS="readline, libutil" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-ifconfig --disable-rcp --disable-rlogin --disable-rsh --disable-rexecd --disable-uucpd --disable-rexec --disable-ping --disable-ping6 --disable-hostname" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no" -CPPFLAGS+=" -DLOGIN_PROCESS=6 -DDEAD_PROCESS=8 -DLOG_NFACILITIES=24" -LDFLAGS+=" -llog" # for syslog +termux_step_pre_configure() { + CPPFLAGS+=" -DLOGIN_PROCESS=6 -DDEAD_PROCESS=8 -DLOG_NFACILITIES=24" + LDFLAGS+=" -llog" # for syslog +} diff --git a/packages/inotify-tools/build.sh b/packages/inotify-tools/build.sh index 9b06ace8e..34d993458 100644 --- a/packages/inotify-tools/build.sh +++ b/packages/inotify-tools/build.sh @@ -4,7 +4,9 @@ TERMUX_PKG_VERSION=3.14 TERMUX_PKG_SRCURL=https://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes -LDFLAGS+=" -llog" +termux_step_pre_configure() { + LDFLAGS+=" -llog" +} termux_step_make () { continue diff --git a/packages/kona/build.sh b/packages/kona/build.sh index 9fb3073e5..ad670aa55 100644 --- a/packages/kona/build.sh +++ b/packages/kona/build.sh @@ -5,6 +5,3 @@ TERMUX_PKG_DESCRIPTION="Open-source implementation of the APL-like K programming TERMUX_PKG_SRCURL="https://github.com/kevinlawler/kona/archive/Win.${TERMUX_PKG_VERSION}.zip" TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_MAINTAINER="Jonathan Badger " - -export PREFIX=$TERMUX_PREFIX - diff --git a/packages/lftp/build.sh b/packages/lftp/build.sh index 2619f533b..6ff54743d 100644 --- a/packages/lftp/build.sh +++ b/packages/lftp/build.sh @@ -5,11 +5,13 @@ TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=http://lftp.yar.ru/ftp/lftp-${TERMUX_PKG_VERSION}.tar.xz # (1) Android has dn_expand, but lftp assumes that dn_skipname then exists, which it does not on android. # (2) Use --with-openssl to use openssl instead of gnutls. -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_dn_expand=no --with-openssl --with-zlib=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr --with-expat=$TERMUX_PREFIX" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_dn_expand=no --with-openssl --with-expat=$TERMUX_PREFIX" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-readline=$TERMUX_PREFIX" TERMUX_PKG_DEPENDS="libexpat, openssl, readline, libutil, libidn" termux_step_pre_configure () { + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-zlib=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr" + # We have patched an m4 file. cd $TERMUX_PKG_SRCDIR aclocal diff --git a/packages/libgc/build.sh b/packages/libgc/build.sh index 26e9776a3..be0b197c6 100644 --- a/packages/libgc/build.sh +++ b/packages/libgc/build.sh @@ -4,9 +4,6 @@ TERMUX_PKG_VERSION=7.6.0 TERMUX_PKG_SRCURL=http://www.hboehm.info/gc/gc_source/gc-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_RM_AFTER_INSTALL="share/gc" -# Avoid defining structs already defined in api level 21 or beyond -# CFLAGS+=" -DGC_DONT_DEFINE_LINK_MAP" - termux_step_pre_configure () { cd $TERMUX_PKG_SRCDIR autoconf diff --git a/packages/libgcrypt/build.sh b/packages/libgcrypt/build.sh index 7d6454bef..12672b860 100755 --- a/packages/libgcrypt/build.sh +++ b/packages/libgcrypt/build.sh @@ -5,15 +5,17 @@ TERMUX_PKG_SRCURL=ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-${TERMUX_PKG_VE TERMUX_PKG_DEPENDS="libgpg-error" # configure tries to detect pthreads by linking with -lpthread, which does not exist on Android: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_pthread_pthread_create=yes" -LDFLAGS="$LDFLAGS -llog" # libgcrypt uses syslog, which we redirect to android logging termux_step_pre_configure () { + LDFLAGS="$LDFLAGS -llog" # libgcrypt uses syslog, which we redirect to android logging + if [ $TERMUX_ARCH = "arm" ]; then # See http://marc.info/?l=gnupg-devel&m=139136972631909&w=3 CFLAGS+=" -mno-unaligned-access" - # Avoid text relocations: - TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" gcry_cv_gcc_inline_asm_neon=no" + # Avoid text relocations: + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" gcry_cv_gcc_inline_asm_neon=no" fi + if [ $TERMUX_ARCH = "i686" -o $TERMUX_ARCH = "x86_64" ]; then # Fix i686 android build, also in https://bugzilla.gnome.org/show_bug.cgi?id=724050 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --disable-asm" diff --git a/packages/libgmp/build.sh b/packages/libgmp/build.sh index 101e00ef8..8de522567 100755 --- a/packages/libgmp/build.sh +++ b/packages/libgmp/build.sh @@ -3,5 +3,7 @@ TERMUX_PKG_HOMEPAGE=https://gmplib.org/ TERMUX_PKG_DESCRIPTION="Library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers" TERMUX_PKG_SRCURL=https://gmplib.org/download/gmp/gmp-${TERMUX_PKG_VERSION}.tar.lz -# https://gmplib.org/list-archives/gmp-bugs/2012-April/002620.html -export CFLAGS="$CFLAGS $LDFLAGS" +termux_step_pre_configure() { + # https://gmplib.org/list-archives/gmp-bugs/2012-April/002620.html + CFLAGS+=" $LDFLAGS" +} diff --git a/packages/libgnutls/build.sh b/packages/libgnutls/build.sh index e878ef66b..0fd94375c 100644 --- a/packages/libgnutls/build.sh +++ b/packages/libgnutls/build.sh @@ -6,4 +6,6 @@ TERMUX_PKG_VERSION=${_TERMUX_PKG_MAJOR_VERSION}.14 TERMUX_PKG_SRCURL=ftp://ftp.gnutls.org/gcrypt/gnutls/v${_TERMUX_PKG_MAJOR_VERSION}/gnutls-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-hardware-acceleration --disable-cxx --disable-openssl-compatibility --with-included-libtasn1 --without-p11-kit --with-default-trust-store-file=$TERMUX_PREFIX/etc/tls/cert.pem" -CFLAGS+=" -std=c99" +termux_step_pre_configure() { + CFLAGS+=" -std=c99" +} diff --git a/packages/libluajit/build.sh b/packages/libluajit/build.sh index 8589617b6..4c980c940 100644 --- a/packages/libluajit/build.sh +++ b/packages/libluajit/build.sh @@ -5,25 +5,26 @@ TERMUX_PKG_SRCURL=http://luajit.org/download/LuaJIT-2.1.0-beta2.tar.gz TERMUX_PKG_EXTRA_MAKE_ARGS="amalg PREFIX=$TERMUX_PREFIX" TERMUX_PKG_BUILD_IN_SRC=yes -# luajit wants same pointer size for host and target build -export HOST_CC="gcc" -if [ $TERMUX_ARCH_BITS = "32" ]; then - if [ `uname` = "Linux" ]; then - # NOTE: "apt install libc6-dev-i386" for 32-bit headers - export HOST_CFLAGS="-m32" # -arch i386" - export HOST_LDFLAGS="-m32" # arch i386" - - elif [ `uname` = "Darwin" ]; then - export HOST_CFLAGS="-m32 -arch i386" - export HOST_LDFLAGS="-arch i386" +termux_step_post_extract_package() { + # luajit wants same pointer size for host and target build + export HOST_CC="gcc" + if [ $TERMUX_ARCH_BITS = "32" ]; then + if [ `uname` = "Linux" ]; then + # NOTE: "apt install libc6-dev-i386" for 32-bit headers + export HOST_CFLAGS="-m32" # -arch i386" + export HOST_LDFLAGS="-m32" # arch i386" + elif [ `uname` = "Darwin" ]; then + export HOST_CFLAGS="-m32 -arch i386" + export HOST_LDFLAGS="-arch i386" + fi fi -fi -export CROSS=${TERMUX_HOST_PLATFORM}- -export TARGET_FLAGS="$CFLAGS $CPPFLAGS $LDFLAGS" -export TARGET_SYS=Linux + export CROSS=${TERMUX_HOST_PLATFORM}- + export TARGET_FLAGS="$CFLAGS $CPPFLAGS $LDFLAGS" + export TARGET_SYS=Linux -ORIG_STRIP=$STRIP -unset AR AS CC CXX CPP CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RANLIB LD PKG_CONFIG STRIP + ORIG_STRIP=$STRIP + unset AR AS CC CXX CPP CPPFLAGS CFLAGS CXXFLAGS LDFLAGS RANLIB LD PKG_CONFIG STRIP +} termux_step_make_install () { mkdir -p $TERMUX_PREFIX/include/luajit-2.0 diff --git a/packages/libmcrypt/build.sh b/packages/libmcrypt/build.sh index fe66c6ddf..23bbe3971 100644 --- a/packages/libmcrypt/build.sh +++ b/packages/libmcrypt/build.sh @@ -4,4 +4,3 @@ TERMUX_PKG_VERSION=2.5.8 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/${TERMUX_PKG_VERSION}/libmcrypt-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_EXTRA_CONFIGURE_ARGS+="--mandir=$TERMUX_PREFIX/share/man" - diff --git a/packages/libpopt/build.sh b/packages/libpopt/build.sh index 217e9bd06..e8d4e4369 100644 --- a/packages/libpopt/build.sh +++ b/packages/libpopt/build.sh @@ -4,4 +4,6 @@ TERMUX_PKG_VERSION=1.16 TERMUX_PKG_SRCURL=http://rpm5.org/files/popt/popt-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libandroid-glob" -LDFLAGS+=" -landroid-glob" +termux_step_pre_configure() { + LDFLAGS+=" -landroid-glob" +} diff --git a/packages/lighttpd/build.sh b/packages/lighttpd/build.sh index 270817567..d5a8fb906 100644 --- a/packages/lighttpd/build.sh +++ b/packages/lighttpd/build.sh @@ -5,5 +5,8 @@ TERMUX_PKG_SRCURL=http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd- TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-bzip2 --with-openssl --with-pcre --with-zlib" TERMUX_PKG_DEPENDS="libbz2, openssl, pcre, libcrypt, libandroid-glob" TERMUX_PKG_RM_AFTER_INSTALL="bin/lighttpd-angel" -# liblog for syslog: -LDFLAGS="$LDFLAGS -llog -landroid-glob" + +termux_step_pre_configure () { + # liblog for syslog: + LDFLAGS="$LDFLAGS -llog -landroid-glob" +} diff --git a/packages/ltrace/build.sh b/packages/ltrace/build.sh index 75f798374..c808170ce 100644 --- a/packages/ltrace/build.sh +++ b/packages/ltrace/build.sh @@ -2,24 +2,17 @@ TERMUX_PKG_HOMEPAGE=http://www.ltrace.org/ TERMUX_PKG_DESCRIPTION="Tracks runtime library calls in dynamically linked programs" TERMUX_PKG_VERSION=0.7.3.20160411 TERMUX_PKG_DEPENDS="elfutils" - -# TERMUX_PKG_SRCURL=http://www.ltrace.org/ltrace_${TERMUX_PKG_VERSION}.orig.tar.bz2 -# TERMUX_PKG_FOLDERNAME=ltrace-${TERMUX_PKG_VERSION} - _COMMIT=2def9f1217374cc8371105993003b2c663aefda7 TERMUX_PKG_SRCURL=https://github.com/dkogan/ltrace/archive/${_COMMIT}.zip TERMUX_PKG_FOLDERNAME=ltrace-${_COMMIT} - -termux_step_pre_configure () { - autoreconf -i ../src -} - - TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_host=$TERMUX_ARCH-generic-linux-gnu" -CFLAGS+=" -Wno-error=maybe-uninitialized" +termux_step_pre_configure () { + CFLAGS+=" -Wno-error=maybe-uninitialized" + # rindex is obsolete name of strrchr which is not available in Android + # function signature stays same, so I'm replacing it with C preprocessor + # instead of patch + CFLAGS+=" -Drindex=strrchr" -# rindex is obsolete name of strrchr which is not available in Android -# function signature stays same, so I'm replacing it with C preprocessor -# instead of patch -CFLAGS+=" -Drindex=strrchr" + autoreconf -i ../src +} diff --git a/packages/lua/build.sh b/packages/lua/build.sh index b86dc5036..d05e445ba 100644 --- a/packages/lua/build.sh +++ b/packages/lua/build.sh @@ -6,5 +6,7 @@ TERMUX_PKG_DEPENDS="readline" TERMUX_PKG_EXTRA_MAKE_ARGS=linux TERMUX_PKG_BUILD_IN_SRC=yes -AR="$AR rcu" -LDFLAGS="$LDFLAGS -lm" +termux_step_pre_configure () { + AR="$AR rcu" + LDFLAGS="$LDFLAGS -lm" +} diff --git a/packages/macchanger/build.sh b/packages/macchanger/build.sh index 8d5f3fa98..6485a05d1 100644 --- a/packages/macchanger/build.sh +++ b/packages/macchanger/build.sh @@ -3,8 +3,6 @@ TERMUX_PKG_DESCRIPTION="Utility that makes the maniputation of MAC addresses of TERMUX_PKG_VERSION=1.7.0 TERMUX_PKG_SRCURL=https://github.com/alobbs/macchanger/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_FOLDERNAME=macchanger-${TERMUX_PKG_VERSION} -# TERMUX_PKG_DEPENDS="pcre, openssl, libuuid" -# TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ssl=openssl --disable-iri" termux_step_pre_configure() { cd $TERMUX_PKG_SRCDIR diff --git a/packages/mathomatic/build.sh b/packages/mathomatic/build.sh index 0d802b57b..d081eaf1c 100644 --- a/packages/mathomatic/build.sh +++ b/packages/mathomatic/build.sh @@ -9,6 +9,6 @@ TERMUX_PKG_DEPENDS="readline" TERMUX_PKG_RM_AFTER_INSTALL="share/applications/mathomatic.desktop share/pixmaps" TERMUX_PKG_MAINTAINER="Jonathan Badger " -export PREFIX=$TERMUX_PREFIX -CPPFLAGS+=" -DUSE_TGAMMA -DBOLD_COLOR" - +termux_step_pre_configure() { + CPPFLAGS+=" -DUSE_TGAMMA -DBOLD_COLOR" +} diff --git a/packages/mlocate/build.sh b/packages/mlocate/build.sh index 3854fce12..7e2df66e3 100644 --- a/packages/mlocate/build.sh +++ b/packages/mlocate/build.sh @@ -4,7 +4,9 @@ TERMUX_PKG_VERSION=0.26 TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=https://fedorahosted.org/releases/m/l/mlocate/mlocate-${TERMUX_PKG_VERSION}.tar.xz -CPPFLAGS+=" -DLINE_MAX=_POSIX2_LINE_MAX" +termux_step_pre_configure() { + CPPFLAGS+=" -DLINE_MAX=_POSIX2_LINE_MAX" +} termux_step_create_debscripts () { echo "mkdir -p $TERMUX_PREFIX/var/mlocate/" > postinst diff --git a/packages/mosh/build.sh b/packages/mosh/build.sh index b127f2188..0779a6505 100644 --- a/packages/mosh/build.sh +++ b/packages/mosh/build.sh @@ -3,12 +3,11 @@ TERMUX_PKG_DESCRIPTION="Mobile shell that supports roaming and intelligent local TERMUX_PKG_VERSION=1.2.6 TERMUX_PKG_SRCURL=https://github.com/mobile-shell/mosh/archive/mosh-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_FOLDERNAME=mosh-mosh-$TERMUX_PKG_VERSION - TERMUX_PKG_DEPENDS="libandroid-support, protobuf, ncurses, openssl, openssh, libutil" -export PROTOC=$TERMUX_TOPDIR/protobuf/host-build/src/protoc - termux_step_pre_configure () { + export PROTOC=$TERMUX_TOPDIR/protobuf/host-build/src/protoc + cd $TERMUX_PKG_SRCDIR ./autogen.sh } @@ -16,10 +15,10 @@ termux_step_pre_configure () { termux_step_post_make_install () { cd $TERMUX_PREFIX/bin mv mosh mosh.pl - $CXX $CXXFLAGS $LDFLAGS \ - -isystem $TERMUX_PREFIX/include \ - -lutil \ - -DPACKAGE_VERSION=\"$TERMUX_PKG_VERSION\" \ - -std=c++11 -Wall -Wextra -Werror \ - $TERMUX_PKG_BUILDER_DIR/mosh.cc -o mosh + $CXX $CXXFLAGS $LDFLAGS \ + -isystem $TERMUX_PREFIX/include \ + -lutil \ + -DPACKAGE_VERSION=\"$TERMUX_PKG_VERSION\" \ + -std=c++11 -Wall -Wextra -Werror \ + $TERMUX_PKG_BUILDER_DIR/mosh.cc -o mosh } diff --git a/packages/mpv/build.sh b/packages/mpv/build.sh index f0c7a34e3..fb8ac5f17 100644 --- a/packages/mpv/build.sh +++ b/packages/mpv/build.sh @@ -1,9 +1,3 @@ -# Does not work with libjpeg-turbo or libpng installed, since -# linking against libOpenSLES causes indirect linkage against -# libskia.so, which links against the platform libjpeg.so and -# libpng.so, which are not compatible with the Termux ones. -# -# On Android N also liblzma seems to conflict. TERMUX_PKG_HOMEPAGE=https://mpv.io/ TERMUX_PKG_DESCRIPTION="Command-line media player" TERMUX_PKG_VERSION=0.20.0 @@ -35,6 +29,11 @@ termux_step_make_install () { echo "ao=opensles" > $TERMUX_PREFIX/etc/mpv/mpv.conf # Try to work around OpenSL ES library clashes: + # Linking against libOpenSLES causes indirect linkage against + # libskia.so, which links against the platform libjpeg.so and + # libpng.so, which are not compatible with the Termux ones. + # + # On Android N also liblzma seems to conflict. mkdir -p $TERMUX_PREFIX/libexec mv $TERMUX_PREFIX/bin/mpv $TERMUX_PREFIX/libexec diff --git a/packages/openal-soft/build.sh b/packages/openal-soft/build.sh index 2ee7935f4..da9a2be38 100644 --- a/packages/openal-soft/build.sh +++ b/packages/openal-soft/build.sh @@ -2,8 +2,6 @@ TERMUX_PKG_HOMEPAGE=http://kcat.strangesoft.net/openal.html TERMUX_PKG_DESCRIPTION="Software implementation of the OpenAL API" TERMUX_PKG_VERSION=1.17.2 TERMUX_PKG_SRCURL=http://kcat.strangesoft.net/openal-releases/openal-soft-${TERMUX_PKG_VERSION}.tar.bz2 -# TERMUX_PKG_DEPENDS="libgnutls, libuuid, libandroid-glob" -# LDFLAGS+=" -landroid-glob" termux_step_configure () { cd $TERMUX_PKG_BUILDDIR diff --git a/packages/openssh/build.sh b/packages/openssh/build.sh index 90002acec..7383e41d7 100755 --- a/packages/openssh/build.sh +++ b/packages/openssh/build.sh @@ -11,8 +11,10 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --disable-libutil ac_cv_search_openpty=no --w TERMUX_PKG_MAKE_INSTALL_TARGET="install-nokeys" TERMUX_PKG_RM_AFTER_INSTALL="bin/slogin share/man/man1/slogin.1" -export LD=$CC # Needed to link the binaries -export LDFLAGS="$LDFLAGS -llog" # liblog for android logging in syslog hack +termux_step_pre_configure() { + LD=$CC # Needed to link the binaries + LDFLAGS+=" -llog" # liblog for android logging in syslog hack +} termux_step_pre_make () { # We need to remove this file before installing, since otherwise the diff --git a/packages/optipng/build.sh b/packages/optipng/build.sh index 6ac52d938..4eacacb87 100644 --- a/packages/optipng/build.sh +++ b/packages/optipng/build.sh @@ -6,4 +6,6 @@ TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/optipng/OptiPNG/optip TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-system-zlib --with-system-libpng --mandir=$TERMUX_PREFIX/share/man" TERMUX_PKG_BUILD_IN_SRC=yes -LD=$CC +termux_step_pre_configure () { + LD=$CC +} diff --git a/packages/pcre/build.sh b/packages/pcre/build.sh index 059ec5dca..f939c640f 100644 --- a/packages/pcre/build.sh +++ b/packages/pcre/build.sh @@ -4,5 +4,3 @@ TERMUX_PKG_VERSION=8.39 TERMUX_PKG_SRCURL=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_RM_AFTER_INSTALL="bin/pcre-config bin/pcregrep bin/pcretest share/man/man1/pcre*.1 lib/libpcreposix.so lib/libpcreposix.so.0 lib/libpcreposix.so.0.0.2" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-cpp --enable-utf8 --enable-unicode-properties" - - diff --git a/packages/pforth/build.sh b/packages/pforth/build.sh index 0771dc3d7..21ecfad47 100644 --- a/packages/pforth/build.sh +++ b/packages/pforth/build.sh @@ -7,8 +7,8 @@ TERMUX_PKG_FOLDERNAME=pforth-${_COMMIT} TERMUX_PKG_HOSTBUILD=yes termux_step_host_build () { - cp -Rf $TERMUX_PKG_SRCDIR/* . cd build/unix + CC=gcc make pfdicdat.h CC=gcc make all } diff --git a/packages/procps/build.sh b/packages/procps/build.sh index 1a3062337..e14aa1082 100644 --- a/packages/procps/build.sh +++ b/packages/procps/build.sh @@ -10,4 +10,6 @@ TERMUX_PKG_DEPENDS="ncurses" # "For compatibility between distributions, can we have /bin/kill made available from coreutils?" TERMUX_PKG_RM_AFTER_INSTALL="bin/kill share/man/man1/kill.1 usr/bin/w share/man/man1/w.1 usr/bin/slabtop share/man/man1/slabtop.1" -CFLAGS+=" -DHOST_NAME_MAX=255" +termux_step_pre_configure() { + CFLAGS+=" -DHOST_NAME_MAX=255" +} diff --git a/packages/proot/build.sh b/packages/proot/build.sh index 7a0fedb20..c8d5ab18b 100644 --- a/packages/proot/build.sh +++ b/packages/proot/build.sh @@ -7,7 +7,9 @@ TERMUX_PKG_SRCURL=https://github.com/termux/proot/archive/${_COMMIT}.zip TERMUX_PKG_FOLDERNAME=proot-$_COMMIT TERMUX_PKG_DEPENDS="libtalloc" -export LD=$CC +termux_step_pre_configure() { + export LD=$CC +} termux_step_make_install () { export CROSS_COMPILE=${TERMUX_HOST_PLATFORM}- diff --git a/packages/rsync/build.sh b/packages/rsync/build.sh index 4755e282e..ade002c33 100755 --- a/packages/rsync/build.sh +++ b/packages/rsync/build.sh @@ -3,4 +3,7 @@ TERMUX_PKG_DESCRIPTION="Utility that provides fast incremental file transfer" TERMUX_PKG_VERSION=3.1.2 TERMUX_PKG_SRCURL=http://rsync.samba.org/ftp/rsync/src/rsync-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-rsyncd-conf=$TERMUX_PREFIX/etc/rsyncd.conf --with-included-zlib=no --disable-debug" -CFLAGS="$CFLAGS -llog" # for syslog + +termux_step_pre_configure () { + CFLAGS="$CFLAGS -llog" # for syslog +} diff --git a/packages/ruby/build.sh b/packages/ruby/build.sh index 4e58b228c..ef6ebd6c4 100644 --- a/packages/ruby/build.sh +++ b/packages/ruby/build.sh @@ -15,11 +15,13 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-gdbm" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_crypt_crypt=no" # Fix DEPRECATED_TYPE macro clang compatibility: TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" rb_cv_type_deprecated=x" +# getresuid(2) does not work on ChromeOS - https://github.com/termux/termux-app/issues/147: +# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_getresuid=no" -# Ruby does not use this directly, but specify for gem building C++-using extensions: -CXXFLAGS+=" -frtti -fexceptions" # -lgnustl_shared" +termux_step_pre_configure() { + # Ruby does not use this directly, but specify for gem building C++-using extensions: + CXXFLAGS+=" -frtti -fexceptions" -termux_step_pre_configure () { export GEM_HOME=$TERMUX_PREFIX/var/lib/gems mkdir -p $GEM_HOME } diff --git a/packages/socat/build.sh b/packages/socat/build.sh index 8ebe24c01..d71f9b373 100644 --- a/packages/socat/build.sh +++ b/packages/socat/build.sh @@ -7,7 +7,9 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_header_resolv_h=no ac_cv_c_compiler_gnu=yes TERMUX_PKG_BUILD_IN_SRC=yes #TERMUX_PKG_HOSTBUILD=yes -LDFLAGS="$LDFLAGS -llog" # uses syslog +termux_step_pre_configure () { + LDFLAGS="$LDFLAGS -llog" # uses syslog +} #termux_step_configure () { # From socat_buildscript_for_android.sh in socat source: diff --git a/packages/sox/build.sh b/packages/sox/build.sh index f3848f01e..8954f1d56 100644 --- a/packages/sox/build.sh +++ b/packages/sox/build.sh @@ -8,4 +8,6 @@ TERMUX_PKG_RM_AFTER_INSTALL="bin/play bin/rec share/man/man1/play.1 share/man/ma # Depend on file for libmagic.so linking: TERMUX_PKG_DEPENDS="file, libpng, libmp3lame, libogg, libvorbis, libandroid-glob, libflac, libid3tag, libmad" -LDFLAGS+=" -landroid-glob" +termux_step_pre_configure() { + LDFLAGS+=" -landroid-glob" +} diff --git a/packages/stag/build.sh b/packages/stag/build.sh index 1989fb678..9624cda5e 100644 --- a/packages/stag/build.sh +++ b/packages/stag/build.sh @@ -5,5 +5,8 @@ TERMUX_PKG_SRCURL=https://github.com/seenaburns/stag/archive/v${TERMUX_PKG_VERSI TERMUX_PKG_FOLDERNAME=stag-$TERMUX_PKG_VERSION TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_BUILD_IN_SRC=yes -CFLAGS+=" $CPPFLAGS" -CFLAGS+=" $LDFLAGS" + +termux_step_pre_configure() { + CFLAGS+=" $CPPFLAGS" + CFLAGS+=" $LDFLAGS" +} diff --git a/packages/strace/build.sh b/packages/strace/build.sh index 2f6cda279..74774137b 100755 --- a/packages/strace/build.sh +++ b/packages/strace/build.sh @@ -4,10 +4,13 @@ TERMUX_PKG_VERSION=4.13 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/strace/strace/${TERMUX_PKG_VERSION}/strace-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_RM_AFTER_INSTALL=bin/strace-graph # This is a perl script -CFLAGS+=" -DIOV_MAX=1024" +termux_step_pre_configure () { + if [ $TERMUX_ARCH_BITS = "64" ]; then + # The strace configure script only looks for struct flock64 in , + # but we actually have it in here: + TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_type_struct_flock64=yes" + fi + + CFLAGS+=" -DIOV_MAX=1024" +} -if [ $TERMUX_ARCH_BITS = "64" ]; then - # The strace configure script only looks for struct flock64 in , - # but we actually have it in here: - TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_type_struct_flock64=yes" -fi diff --git a/packages/stunnel/build.sh b/packages/stunnel/build.sh index 2969c7742..e3ce2a450 100644 --- a/packages/stunnel/build.sh +++ b/packages/stunnel/build.sh @@ -6,4 +6,6 @@ TERMUX_PKG_DEPENDS="openssl, libutil" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-shared --with-ssl=$TERMUX_PREFIX --disable-fips" TERMUX_PKG_RM_AFTER_INSTALL="bin/stunnel3 share/man/man8/stunnel.*.8" -LDFLAGS+=" -llog" +termux_step_pre_configure() { + LDFLAGS+=" -llog" +} diff --git a/packages/tinyscheme/build.sh b/packages/tinyscheme/build.sh index 002a0d577..ff0f80cfd 100644 --- a/packages/tinyscheme/build.sh +++ b/packages/tinyscheme/build.sh @@ -5,8 +5,10 @@ TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/tinyscheme/tinyscheme/tinyscheme-1.41/tinyscheme-1.41.tar.gz TERMUX_PKG_BUILD_IN_SRC=yes -AR+=" crs" -LD=$CC +termux_step_pre_configure () { + AR+=" crs" + LD=$CC +} # 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) diff --git a/packages/vim-python/build.sh b/packages/vim-python/build.sh index a0912fbc0..620489987 100755 --- a/packages/vim-python/build.sh +++ b/packages/vim-python/build.sh @@ -14,10 +14,12 @@ TERMUX_PKG_RM_AFTER_INSTALL='bin/rview bin/rvim bin/ex share/man/man1/evim.1 sha # vim-python: TERMUX_PKG_CONFLICTS="vim" -CPPFLAGS+=" -I${TERMUX_PREFIX}/include/python3.5m" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-python3interp --with-python3-config-dir=$TERMUX_PREFIX/lib/python3.5/config-3.5m/" TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" vi_cv_path_python3_pfx=$TERMUX_PREFIX vi_cv_var_python3_version=3.5" TERMUX_PKG_DESCRIPTION+=" - with python support" +termux_step_pre_configure() { + CPPFLAGS+=" -I${TERMUX_PREFIX}/include/python3.5m" +} termux_step_pre_configure () { make distclean diff --git a/packages/vorbis-tools/build.sh b/packages/vorbis-tools/build.sh index 0f5fc5e1c..85247940f 100644 --- a/packages/vorbis-tools/build.sh +++ b/packages/vorbis-tools/build.sh @@ -6,4 +6,6 @@ TERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/vorbis/vorbis-tools-${TERMU # libflac for flac support in oggenc: TERMUX_PKG_DEPENDS="libvorbis, libflac" -LDFLAGS+=" -lm" +termux_step_pre_configure() { + LDFLAGS+=" -lm" +} diff --git a/packages/xvidcore/build.sh b/packages/xvidcore/build.sh index 105fcfb24..a415db27c 100644 --- a/packages/xvidcore/build.sh +++ b/packages/xvidcore/build.sh @@ -4,7 +4,6 @@ TERMUX_PKG_VERSION=1.3.4 TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=http://downloads.xvid.org/downloads/xvidcore-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_FOLDERNAME=xvidcore - TERMUX_PKG_BUILD_IN_SRC=yes termux_step_pre_configure () {