libtalloc: Update from 2.1.8 to 2.1.9
[termux-packages] / build-package.sh
index 3846995..af3d0c5 100755 (executable)
@@ -348,7 +348,12 @@ termux_step_start_build() {
        # scripts can assume that it works on both builder and host later on:
        ln -f -s /bin/sh "$TERMUX_PREFIX/bin/sh"
 
-       TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/termux-elf-cleaner.cpp
+       local TERMUX_ELF_CLEANER_SRC=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner.cpp
+       local TERMUX_ELF_CLEANER_VERSION=$(bash -c ". $TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/build.sh; echo \$TERMUX_PKG_VERSION")
+       termux_download \
+               https://raw.githubusercontent.com/termux/termux-elf-cleaner/v$TERMUX_ELF_CLEANER_VERSION/termux-elf-cleaner.cpp \
+               $TERMUX_ELF_CLEANER_SRC \
+               11a38372f4d0e36b7556382c7ecffecae35cee8b68daaee2dbee025f758e17ee
        if [ "$TERMUX_ELF_CLEANER_SRC" -nt "$TERMUX_ELF_CLEANER" ]; then
                g++ -std=c++11 -Wall -Wextra -pedantic -Os "$TERMUX_ELF_CLEANER_SRC" -o "$TERMUX_ELF_CLEANER"
        fi
@@ -668,6 +673,10 @@ termux_step_configure_autotools () {
        if [ "$TERMUX_PKG_EXTRA_CONFIGURE_ARGS" != "${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--host=/}" ]; then
                HOST_FLAG=""
        fi
+       LIBEXEC_FLAG="--libexecdir=$TERMUX_PREFIX/libexec"
+        if [ "$TERMUX_PKG_EXTRA_CONFIGURE_ARGS" != "${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--libexecdir=/}" ]; then
+                LIBEXEC_FLAG=""
+        fi
 
        # Some packages provides a $PKG-config script which some configure scripts pickup instead of pkg-config:
        mkdir "$TERMUX_PKG_TMPDIR/config-scripts"
@@ -687,6 +696,7 @@ termux_step_configure_autotools () {
        AVOID_GNULIB+=" gl_cv_func_dup2_works=yes"
        AVOID_GNULIB+=" gl_cv_func_fcntl_f_dupfd_cloexec=yes"
        AVOID_GNULIB+=" gl_cv_func_fcntl_f_dupfd_works=yes"
+       AVOID_GNULIB+=" gl_cv_func_fnmatch_posix=yes"
        AVOID_GNULIB+=" gl_cv_func_getcwd_abort_bug=no"
        AVOID_GNULIB+=" gl_cv_func_getcwd_null=yes"
        AVOID_GNULIB+=" gl_cv_func_getcwd_path_max=yes"
@@ -695,11 +705,14 @@ termux_step_configure_autotools () {
        AVOID_GNULIB+=" gl_cv_func_gettimeofday_posix_signature=yes"
        AVOID_GNULIB+=" gl_cv_func_link_works=yes"
        AVOID_GNULIB+=" gl_cv_func_lstat_dereferences_slashed_symlink=yes"
+       AVOID_GNULIB+=" gl_cv_func_malloc_0_nonnull=yes"
        AVOID_GNULIB+=" gl_cv_func_memchr_works=yes"
        AVOID_GNULIB+=" gl_cv_func_mkdir_trailing_dot_works=yes"
        AVOID_GNULIB+=" gl_cv_func_mkdir_trailing_slash_works=yes"
        AVOID_GNULIB+=" gl_cv_func_select_detects_ebadf=yes"
+       AVOID_GNULIB+=" gl_cv_func_snprintf_posix=yes"
        AVOID_GNULIB+=" gl_cv_func_snprintf_retval_c99=yes"
+       AVOID_GNULIB+=" gl_cv_func_snprintf_truncation_c99=yes"
        AVOID_GNULIB+=" gl_cv_func_stat_dir_slash=yes"
        AVOID_GNULIB+=" gl_cv_func_stat_file_slash=yes"
        AVOID_GNULIB+=" gl_cv_func_strerror_0_works=yes"
@@ -707,6 +720,8 @@ termux_step_configure_autotools () {
        AVOID_GNULIB+=" gl_cv_func_tzset_clobber=no"
        AVOID_GNULIB+=" gl_cv_func_unlink_honors_slashes=yes"
        AVOID_GNULIB+=" gl_cv_func_unlink_honors_slashes=yes"
+       AVOID_GNULIB+=" gl_cv_func_vsnprintf_posix=yes"
+       AVOID_GNULIB+=" gl_cv_func_vsnprintf_zerosize_c99=yes"
        AVOID_GNULIB+=" gl_cv_func_wcwidth_works=yes"
        AVOID_GNULIB+=" gl_cv_func_working_getdelim=yes"
        AVOID_GNULIB+=" gl_cv_func_working_mkstemp=yes"
@@ -724,7 +739,7 @@ termux_step_configure_autotools () {
                $DISABLE_NLS \
                $ENABLE_SHARED \
                $DISABLE_STATIC \
-               --libexecdir=$TERMUX_PREFIX/libexec
+               $LIBEXEC_FLAG
 }
 
 termux_step_configure_cmake () {
@@ -894,6 +909,7 @@ termux_step_massage() {
                local SUB_PKG_DIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/subpackages/$SUB_PKG_NAME
                local TERMUX_SUBPKG_DEPENDS=""
                local TERMUX_SUBPKG_CONFLICTS=""
+               local TERMUX_SUBPKG_CONFFILES=""
                local SUB_PKG_MASSAGE_DIR=$SUB_PKG_DIR/massage/$TERMUX_PREFIX
                local SUB_PKG_PACKAGE_DIR=$SUB_PKG_DIR/package
                mkdir -p "$SUB_PKG_MASSAGE_DIR" "$SUB_PKG_PACKAGE_DIR"
@@ -935,6 +951,8 @@ termux_step_massage() {
                test ! -z "$TERMUX_SUBPKG_CONFLICTS" && echo "Conflicts: $TERMUX_SUBPKG_CONFLICTS" >> control
                $TERMUX_TAR -cJf "$SUB_PKG_PACKAGE_DIR/control.tar.xz" .
 
+               for f in $TERMUX_SUBPKG_CONFFILES; do echo "$TERMUX_PREFIX/$f" >> conffiles; done
+
                # Create the actual .deb file:
                TERMUX_SUBPKG_DEBFILE=$TERMUX_DEBDIR/${SUB_PKG_NAME}_${TERMUX_PKG_FULLVERSION}_${SUB_PKG_ARCH}.deb
                test ! -f "$TERMUX_COMMON_CACHEDIR/debian-binary" && echo "2.0" > "$TERMUX_COMMON_CACHEDIR/debian-binary"