diff --git a/packages/apt/build.sh b/packages/apt/build.sh index 5d99b0564..1a56e1f69 100644 --- a/packages/apt/build.sh +++ b/packages/apt/build.sh @@ -2,15 +2,19 @@ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" TERMUX_PKG_DEPENDS="liblzma, dpkg, gpgv" # Wait with updating to later version until the NDK supports std::to_string() and other -# functions (hopefully in r13): +# functions (hopefully in r15, https://github.com/android-ndk/ndk/issues/82). +# Updating to apt 1.4 will also get rid of the build hacks used as apt has transitioned +# to a clean cmake build system. TERMUX_PKG_VERSION=1.2.12 TERMUX_PKG_REVISION=1 # TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://launchpad.net/ubuntu/+archive/primary/+files/apt_${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--host=${TERMUX_ARCH}-linux --disable-rpath acl_cv_rpath=$TERMUX_PREFIX/lib gt_cv_func_CFPreferencesCopyAppValue=no gt_cv_func_CFLocaleCopyCurrent=no ac_cv_c_bigendian=no --no-create" -# When ready to drop bz2 support: -TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_lib_bz2_BZ2_bzopen=no" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="\ +--no-create +ac_cv_c_bigendian=no +ac_cv_lib_bz2_BZ2_bzopen=no" TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION} +TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_ESSENTIAL=yes TERMUX_PKG_CONFFILES="etc/apt/sources.list" @@ -25,35 +29,21 @@ termux_step_pre_configure () { rm $TERMUX_PKG_SRCDIR/apt-pkg/{cdrom.cc,indexcopy.cc} } -termux_step_post_configure () { - # This is needed to generate makefile, but does not work due to configure arguments not being remembered - ./config.status -} - -termux_step_make () { - unset CC - unset CFLAGS - unset LDFLAGS - unset CXX - unset CXXFLAGS - make -} - termux_step_make_install () { - cp $TERMUX_PKG_BUILDDIR/bin/apt{,-get,-cache,-config,-key} $TERMUX_PREFIX/bin/ - cp $TERMUX_PKG_BUILDDIR/bin/libapt-{pkg.so.5.0.0,private.so.0.0} $TERMUX_PREFIX/lib/ + cp $TERMUX_PKG_BUILDDIR/build/bin/apt{,-get,-cache,-config,-key} $TERMUX_PREFIX/bin/ + cp $TERMUX_PKG_BUILDDIR/build/bin/libapt-{pkg.so.5.0.0,private.so.0.0} $TERMUX_PREFIX/lib/ (cd $TERMUX_PREFIX/lib; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so.5.0; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so ) - mkdir -p $TERMUX_PREFIX/lib/apt/methods $TERMUX_PREFIX/share/man/man{5,8} - cp $TERMUX_PKG_BUILDDIR/docs/apt{,-cache,-get}.8 $TERMUX_PREFIX/share/man/man8/ - cp $TERMUX_PKG_BUILDDIR/docs/{apt.conf,sources.list}.5 $TERMUX_PREFIX/share/man/man5/ - cp $TERMUX_PKG_BUILDDIR/bin/methods/{copy,file,gpgv,gzip,http,https,store} $TERMUX_PREFIX/lib/apt/methods - (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip xz) + mkdir -p $TERMUX_PREFIX/lib/apt/methods $TERMUX_PREFIX/share/man/man{5,8} + cp $TERMUX_PKG_BUILDDIR/build/docs/apt{,-cache,-get}.8 $TERMUX_PREFIX/share/man/man8/ + cp $TERMUX_PKG_BUILDDIR/build/docs/{apt.conf,sources.list}.5 $TERMUX_PREFIX/share/man/man5/ + cp $TERMUX_PKG_BUILDDIR/build/bin/methods/{copy,file,gpgv,gzip,http,https,store} $TERMUX_PREFIX/lib/apt/methods + (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip xz) - mkdir -p $TERMUX_PREFIX/etc/apt - printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] http://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list + mkdir -p $TERMUX_PREFIX/etc/apt + printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] http://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list - # The trusted.gpg was created with "apt-key add public-key.key": - cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ + # The trusted.gpg was created with "apt-key add public-key.key": + cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/ cp $TERMUX_PKG_SRCDIR/completions/bash/apt \ diff --git a/packages/apt/configure.patch b/packages/apt/configure.patch index 1a5348291..d121f47f0 100644 --- a/packages/apt/configure.patch +++ b/packages/apt/configure.patch @@ -1,22 +1,16 @@ -diff -u -r ../apt-1.1.3/configure ./configure ---- ../apt-1.1.3/configure 2015-11-30 03:09:08.000000000 -0500 -+++ ./configure 2015-12-03 18:24:35.580920131 -0500 -@@ -4822,13 +4822,7 @@ - ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - --ac_fn_cxx_check_header_mongrel "$LINENO" "gtest/gtest.h" "ac_cv_header_gtest_gtest_h" "$ac_includes_default" --if test "x$ac_cv_header_gtest_gtest_h" = xyes; then : -- --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: failed: I need gtest (packaged as libgtest-dev) for unit testing" >&5 --$as_echo "$as_me: WARNING: failed: I need gtest (packaged as libgtest-dev) for unit testing" >&2;} --fi -+ac_cv_header_gtest_gtest_h=yes - - - ac_ext=c -@@ -5003,7 +4997,7 @@ +diff -u -r ../apt-1.2.12/configure ./configure +--- ../apt-1.2.12/configure 2016-05-11 08:58:04.000000000 +0000 ++++ ./configure 2017-01-20 14:42:21.801501806 +0000 +@@ -569,7 +569,7 @@ + ac_clean_files= + ac_config_libobj_dir=. + LIBOBJS= +-cross_compiling=no ++cross_compiling=yes + subdirs= + MFLAGS= + MAKEFLAGS= +@@ -5056,7 +5056,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking debian architecture" >&5 $as_echo_n "checking debian architecture... " >&6; }