From 68faa04f883627deea6e6d0bd6293e0001498403 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 3 Dec 2015 20:00:19 -0500 Subject: [PATCH] apt: Update from 1.0.10.2 to 1.1.3 --- packages/apt/Makefile.patch | 11 ---- packages/apt/apt-key.patch | 46 --------------- ...ion.patch => apt-pkg-aptconfiguration.cc.patch} | 30 +++++----- packages/apt/apt-pkg-contrib-gpgv.cc.patch | 12 ++++ packages/apt/apt-pkg-contrib-srvrec.cc.patch | 31 ++++++++++ ...utl.c.patch => apt-pkg-contrib-strutl.cc.patch} | 31 +++++----- packages/apt/apt-pkg-deb-debrecords.cc.patch | 28 +++++++++ packages/apt/apt-pkg-edsp-edspsystem.cc.patch | 11 ++++ packages/apt/apt-pkg-makefile-no-libutil.patch | 12 ---- packages/apt/apt-pkg-makefile.patch | 12 ++++ packages/apt/build.sh | 13 ++++- packages/apt/cmdline-apt-helper.cc.patch | 11 ++++ packages/apt/cmdline-apt-key.in.patch | 42 ++++++++++++++ packages/apt/cmdline-makefile.patch | 12 ++++ packages/apt/configure.ac.patch | 15 ----- packages/apt/configure.patch | 17 +++--- packages/apt/contrib-fileutl.cc.patch | 41 +++++++++++++ packages/apt/debrecords-cc-no-langinfo.patch | 27 --------- packages/apt/dpkgpm.cc.patch | 26 --------- packages/apt/fileutl.patch | 67 ---------------------- packages/apt/gpgv.patch | 12 ---- .../install-progress-cc-include-termios-h.patch | 11 ---- packages/apt/methods-makefile.patch | 37 ++++++++++++ packages/apt/no-usr-bin-test.patch | 12 ---- 24 files changed, 288 insertions(+), 279 deletions(-) delete mode 100644 packages/apt/Makefile.patch delete mode 100644 packages/apt/apt-key.patch rename packages/apt/{aptconfiguration.patch => apt-pkg-aptconfiguration.cc.patch} (70%) create mode 100644 packages/apt/apt-pkg-contrib-gpgv.cc.patch create mode 100644 packages/apt/apt-pkg-contrib-srvrec.cc.patch rename packages/apt/{strutl.c.patch => apt-pkg-contrib-strutl.cc.patch} (74%) create mode 100644 packages/apt/apt-pkg-deb-debrecords.cc.patch create mode 100644 packages/apt/apt-pkg-edsp-edspsystem.cc.patch delete mode 100644 packages/apt/apt-pkg-makefile-no-libutil.patch create mode 100644 packages/apt/apt-pkg-makefile.patch create mode 100644 packages/apt/cmdline-apt-helper.cc.patch create mode 100644 packages/apt/cmdline-apt-key.in.patch create mode 100644 packages/apt/cmdline-makefile.patch delete mode 100644 packages/apt/configure.ac.patch create mode 100644 packages/apt/contrib-fileutl.cc.patch delete mode 100644 packages/apt/debrecords-cc-no-langinfo.patch delete mode 100644 packages/apt/dpkgpm.cc.patch delete mode 100644 packages/apt/fileutl.patch delete mode 100644 packages/apt/gpgv.patch delete mode 100644 packages/apt/install-progress-cc-include-termios-h.patch create mode 100644 packages/apt/methods-makefile.patch delete mode 100644 packages/apt/no-usr-bin-test.patch diff --git a/packages/apt/Makefile.patch b/packages/apt/Makefile.patch deleted file mode 100644 index c597f520..00000000 --- a/packages/apt/Makefile.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../upstream.git/Makefile ./Makefile ---- ../upstream.git/Makefile 2013-12-07 14:12:14.000000000 +0100 -+++ ./Makefile 2014-05-03 23:46:58.870093099 +0200 -@@ -21,7 +21,6 @@ - $(MAKE) -C dselect $@ - $(MAKE) -C doc $@ - $(MAKE) -C po $@ -- $(MAKE) -C test $@ - - all headers library clean veryclean binary program doc manpages debiandoc test update-po: startup dirs - diff --git a/packages/apt/apt-key.patch b/packages/apt/apt-key.patch deleted file mode 100644 index 21d223f0..00000000 --- a/packages/apt/apt-key.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff -u -r ../upstream.git/cmdline/apt-key.in ./cmdline/apt-key.in ---- ../upstream.git/cmdline/apt-key.in 2014-04-25 13:39:00.000000000 +0200 -+++ ./cmdline/apt-key.in 2014-06-03 11:55:07.623749140 +0200 -@@ -40,10 +40,7 @@ - TMP_KEYRING=${APT_DIR}/var/lib/apt/keyrings/maybe-import-keyring.gpg - - requires_root() { -- if [ "$(id -u)" -ne 0 ]; then -- echo >&1 "ERROR: This command can only be used by root." -- exit 1 -- fi -+ # We do not require root - } - - # gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead. -@@ -216,11 +213,11 @@ - remove_key_from_keyring "$FORCED_KEYRING" "$1" - else - # otherwise all known keyrings are up for inspection -- local TRUSTEDFILE="/etc/apt/trusted.gpg" -+ local TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg" - eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) - eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) - remove_key_from_keyring "$TRUSTEDFILE" "$1" -- TRUSTEDPARTS="/etc/apt/trusted.gpg.d" -+ TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" - eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) - if [ -d "$TRUSTEDPARTS" ]; then - for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do -@@ -278,14 +275,14 @@ - done - - if [ -z "$TRUSTEDFILE" ]; then -- TRUSTEDFILE="/etc/apt/trusted.gpg" -+ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg" - eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) - eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) - if [ -r "$TRUSTEDFILE" ]; then - GPG="$GPG --keyring $TRUSTEDFILE" - fi - GPG="$GPG --primary-keyring $TRUSTEDFILE" -- TRUSTEDPARTS="/etc/apt/trusted.gpg.d" -+ TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" - eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) - if [ -d "$TRUSTEDPARTS" ]; then - # strip / suffix as gpg will double-slash in that case (#665411) diff --git a/packages/apt/aptconfiguration.patch b/packages/apt/apt-pkg-aptconfiguration.cc.patch similarity index 70% rename from packages/apt/aptconfiguration.patch rename to packages/apt/apt-pkg-aptconfiguration.cc.patch index 37017b03..49508e81 100644 --- a/packages/apt/aptconfiguration.patch +++ b/packages/apt/apt-pkg-aptconfiguration.cc.patch @@ -1,18 +1,9 @@ -diff -u -r ../upstream.git/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguration.cc ---- ../upstream.git/apt-pkg/aptconfiguration.cc 2014-04-25 13:39:00.000000000 +0200 -+++ ./apt-pkg/aptconfiguration.cc 2014-06-03 11:39:43.931774391 +0200 -@@ -193,7 +193,7 @@ - // get the environment language codes: LC_MESSAGES (and later LANGUAGE) - // we extract both, a long and a short code and then we will - // check if we actually need both (rare) or if the short is enough -- string const envMsg = string(Locale == 0 ? std::setlocale(LC_MESSAGES, NULL) : *Locale); -+ string const envMsg = "en_US.UTF-8"; // string(Locale == 0 ? std::setlocale(LC_MESSAGES, NULL) : *Locale); - size_t const lenShort = (envMsg.find('_') != string::npos) ? envMsg.find('_') : 2; - size_t const lenLong = (envMsg.find_first_of(".@") != string::npos) ? envMsg.find_first_of(".@") : (lenShort + 3); - -@@ -405,8 +405,8 @@ +diff -u -r ../apt-1.1.3/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguration.cc +--- ../apt-1.1.3/apt-pkg/aptconfiguration.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/aptconfiguration.cc 2015-12-03 18:16:35.167212811 -0500 +@@ -35,8 +35,8 @@ // setDefaultConfigurationForCompressors /*{{{*/ - void Configuration::setDefaultConfigurationForCompressors() { + static void setDefaultConfigurationForCompressors() { // Set default application paths to check for optional compression types - _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); - _config->CndSet("Dir::Bin::xz", "/usr/bin/xz"); @@ -21,7 +12,7 @@ diff -u -r ../upstream.git/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguratio if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) { _config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz")); _config->Set("APT::Compressor::lzma::Binary", "xz"); -@@ -419,7 +419,7 @@ +@@ -49,7 +49,7 @@ _config->Set("APT::Compressor::lzma::UncompressArg::", "-d"); } } else { @@ -30,3 +21,12 @@ diff -u -r ../upstream.git/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguratio if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) { _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix="); _config->Set("APT::Compressor::lzma::CompressArg::", "-9"); +@@ -218,7 +218,7 @@ + // get the environment language codes: LC_MESSAGES (and later LANGUAGE) + // we extract both, a long and a short code and then we will + // check if we actually need both (rare) or if the short is enough +- string const envMsg = string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale); ++ string const envMsg = "en_US.UTF-8"; // string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale); + size_t const lenShort = (envMsg.find('_') != string::npos) ? envMsg.find('_') : 2; + size_t const lenLong = (envMsg.find_first_of(".@") != string::npos) ? envMsg.find_first_of(".@") : (lenShort + 3); + diff --git a/packages/apt/apt-pkg-contrib-gpgv.cc.patch b/packages/apt/apt-pkg-contrib-gpgv.cc.patch new file mode 100644 index 00000000..785fe6c9 --- /dev/null +++ b/packages/apt/apt-pkg-contrib-gpgv.cc.patch @@ -0,0 +1,12 @@ +diff -u -r ../apt-1.1.3/apt-pkg/contrib/gpgv.cc ./apt-pkg/contrib/gpgv.cc +--- ../apt-1.1.3/apt-pkg/contrib/gpgv.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/contrib/gpgv.cc 2015-12-03 16:57:57.183003187 -0500 +@@ -47,7 +47,7 @@ + int const &statusfd, int fd[2], std::string const &key) + { + #define EINTERNAL 111 +- std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "/usr/bin/apt-key"); ++ std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "@TERMUX_PREFIX@/bin/apt-key"); + + bool const Debug = _config->FindB("Debug::Acquire::gpgv", false); + diff --git a/packages/apt/apt-pkg-contrib-srvrec.cc.patch b/packages/apt/apt-pkg-contrib-srvrec.cc.patch new file mode 100644 index 00000000..541e3a87 --- /dev/null +++ b/packages/apt/apt-pkg-contrib-srvrec.cc.patch @@ -0,0 +1,31 @@ +diff -u -r ../apt-1.1.3/apt-pkg/contrib/srvrec.cc ./apt-pkg/contrib/srvrec.cc +--- ../apt-1.1.3/apt-pkg/contrib/srvrec.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/contrib/srvrec.cc 2015-12-03 16:21:54.397715576 -0500 +@@ -40,14 +40,27 @@ + struct servent *s_ent = nullptr; + std::vector buf(1024); + ++#ifdef __ANDROID__ ++ s_ent = getservbyport(htons(port), "tcp"); ++ if (s_ent == nullptr) return false; ++#else + res = getservbyport_r(htons(port), "tcp", &s_ent_buf, buf.data(), buf.size(), &s_ent); + if (res != 0 || s_ent == nullptr) + return false; ++#endif + + strprintf(target, "_%s._tcp.%s", s_ent->s_name, host.c_str()); + return GetSrvRecords(target, Result); + } + ++/* Bionic has res_init() but it's not in any header */ ++#ifdef __ANDROID__ ++extern "C" int res_init(); ++extern "C" int res_query(const char* dname, int class_, int type_, unsigned char* answer, int anslen); ++extern "C" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom); ++static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); } ++#endif ++ + bool GetSrvRecords(std::string name, std::vector &Result) + { + unsigned char answer[PACKETSZ]; diff --git a/packages/apt/strutl.c.patch b/packages/apt/apt-pkg-contrib-strutl.cc.patch similarity index 74% rename from packages/apt/strutl.c.patch rename to packages/apt/apt-pkg-contrib-strutl.cc.patch index 22028498..8ff6807c 100644 --- a/packages/apt/strutl.c.patch +++ b/packages/apt/apt-pkg-contrib-strutl.cc.patch @@ -1,6 +1,6 @@ -diff -u -r ../upstream.git/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc ---- ../upstream.git/apt-pkg/contrib/strutl.cc 2014-06-18 13:17:17.000000000 +0200 -+++ ./apt-pkg/contrib/strutl.cc 2014-07-01 16:49:25.305832759 +0200 +diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc +--- ../apt-1.1.3/apt-pkg/contrib/strutl.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/contrib/strutl.cc 2015-12-03 18:36:34.555425494 -0500 @@ -35,7 +35,9 @@ #include #include @@ -11,7 +11,7 @@ diff -u -r ../upstream.git/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc #include /*}}}*/ -@@ -68,6 +70,7 @@ +@@ -87,6 +89,7 @@ // UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/ // --------------------------------------------------------------------- /* This is handy to use before display some information for enduser */ @@ -19,7 +19,7 @@ diff -u -r ../upstream.git/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest) { iconv_t cd; -@@ -134,6 +137,7 @@ +@@ -153,6 +156,7 @@ return true; } @@ -27,23 +27,24 @@ diff -u -r ../upstream.git/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ // --------------------------------------------------------------------- -@@ -375,13 +379,13 @@ - { +@@ -392,14 +396,14 @@ if (ASize < 100 && I != 0) { -- sprintf(S,"%'.1f %c",ASize,Ext[I]); -+ sprintf(S,"%.1f %c",ASize,Ext[I]); - break; + std::string S; +- strprintf(S, "%'.1f %c", ASize, Ext[I]); ++ strprintf(S, "%.1f %c", ASize, Ext[I]); + return S; } - + if (ASize < 10000) { -- sprintf(S,"%'.0f %c",ASize,Ext[I]); -+ sprintf(S,"%.0f %c",ASize,Ext[I]); - break; + std::string S; +- strprintf(S, "%'.0f %c", ASize, Ext[I]); ++ strprintf(S, "%.0f %c", ASize, Ext[I]); + return S; } ASize /= 1000.0; -@@ -909,14 +913,16 @@ +@@ -928,14 +932,16 @@ setlocale (LC_ALL,"C"); bool const invalid = // Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 diff --git a/packages/apt/apt-pkg-deb-debrecords.cc.patch b/packages/apt/apt-pkg-deb-debrecords.cc.patch new file mode 100644 index 00000000..3b512df9 --- /dev/null +++ b/packages/apt/apt-pkg-deb-debrecords.cc.patch @@ -0,0 +1,28 @@ +diff -u -r ../apt-1.1.3/apt-pkg/deb/debrecords.cc ./apt-pkg/deb/debrecords.cc +--- ../apt-1.1.3/apt-pkg/deb/debrecords.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/deb/debrecords.cc 2015-12-03 16:30:51.506746167 -0500 +@@ -25,7 +25,9 @@ + #include + #include + #include ++#ifndef __ANDROID__ + #include ++#endif + + #include + /*}}}*/ +@@ -143,12 +145,14 @@ + orig = Section.FindS("Description"); + } + ++#ifndef __ANDROID__ + char const * const codeset = nl_langinfo(CODESET); + if (strcmp(codeset,"UTF-8") != 0) { + string dest; + UTF8ToCodeset(codeset, orig, &dest); + return dest; + } ++#endif + + return orig; + } diff --git a/packages/apt/apt-pkg-edsp-edspsystem.cc.patch b/packages/apt/apt-pkg-edsp-edspsystem.cc.patch new file mode 100644 index 00000000..f04bda05 --- /dev/null +++ b/packages/apt/apt-pkg-edsp-edspsystem.cc.patch @@ -0,0 +1,11 @@ +diff -u -r ../apt-1.1.3/apt-pkg/edsp/edspsystem.cc ./apt-pkg/edsp/edspsystem.cc +--- ../apt-1.1.3/apt-pkg/edsp/edspsystem.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/edsp/edspsystem.cc 2015-12-03 16:33:49.052450163 -0500 +@@ -21,6 +21,7 @@ + + #include + #include ++#include /* For mkdtemp */ + + #include + #include diff --git a/packages/apt/apt-pkg-makefile-no-libutil.patch b/packages/apt/apt-pkg-makefile-no-libutil.patch deleted file mode 100644 index 4ac8129e..00000000 --- a/packages/apt/apt-pkg-makefile-no-libutil.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/makefile ./apt-pkg/makefile ---- ../apt-0.9.16.1/apt-pkg/makefile 2014-03-15 17:59:06.000000000 +0100 -+++ ./apt-pkg/makefile 2014-03-25 01:26:00.600685588 +0100 -@@ -14,7 +14,7 @@ - LIBRARY=apt-pkg - MAJOR=$(LIBAPTPKG_MAJOR) - MINOR=$(LIBAPTPKG_RELEASE) --SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil -ldl -+SLIBS=$(PTHREADLIB) $(INTLLIBS) -ldl - ifeq ($(HAVE_ZLIB),yes) - SLIBS+= -lz - endif diff --git a/packages/apt/apt-pkg-makefile.patch b/packages/apt/apt-pkg-makefile.patch new file mode 100644 index 00000000..4c3df8d1 --- /dev/null +++ b/packages/apt/apt-pkg-makefile.patch @@ -0,0 +1,12 @@ +diff -u -r ../apt-1.1.3/apt-pkg/makefile ./apt-pkg/makefile +--- ../apt-1.1.3/apt-pkg/makefile 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/makefile 2015-12-03 16:37:32.041569392 -0500 +@@ -15,7 +15,7 @@ + LIBRARY=apt-pkg + MAJOR=$(LIBAPTPKG_MAJOR) + MINOR=$(LIBAPTPKG_RELEASE) +-SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil -ldl -lresolv ++SLIBS=$(PTHREADLIB) $(INTLLIBS) -ldl + ifeq ($(HAVE_ZLIB),yes) + SLIBS+= -lz + endif diff --git a/packages/apt/build.sh b/packages/apt/build.sh index 68ad3a82..35bcc42f 100644 --- a/packages/apt/build.sh +++ b/packages/apt/build.sh @@ -1,15 +1,21 @@ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" TERMUX_PKG_DEPENDS="libbz2, liblzma, libgnustl, dpkg, gnupg" -TERMUX_PKG_VERSION=1.0.10.2 +TERMUX_PKG_VERSION=1.1.3 TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/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_FOLDERNAME=apt-${TERMUX_PKG_VERSION} TERMUX_PKG_ESSENTIAL=yes # $NDK/docs/STANDALONE-TOOLCHAIN.html: "If you use the GNU libstdc++, you will need to explicitly link with libsupc++ if you use these features" export LDFLAGS="$LDFLAGS -lgnustl_shared" # -lsupc++" +# Some files use STD*_FILENO without including where they are declared. +# Define them here to avoid having to patch files: +CXXFLAGS+=" -DSTDIN_FILENO=0 -DSTDOUT_FILENO=1 -DSTDERR_FILENO=2 -DAI_IDN=0" + termux_step_pre_configure () { cp $TERMUX_COMMON_CACHEDIR/config.{guess,sub} $TERMUX_PKG_SRCDIR/buildlib perl -p -i -e "s/TERMUX_ARCH/$TERMUX_ARCH/" $TERMUX_PKG_SRCDIR/configure @@ -31,13 +37,14 @@ termux_step_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.4.16,private.so.0.0} $TERMUX_PREFIX/lib/ - (cd $TERMUX_PREFIX/lib; rm -f libapt-pkg.so; ln -s libapt-pkg.so.4.16 libapt-pkg.so) # used by python-apt + cp $TERMUX_PKG_BUILDDIR/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 ) 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} $TERMUX_PREFIX/lib/apt/methods (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip bzip2) + (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://apt.termux.com stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list diff --git a/packages/apt/cmdline-apt-helper.cc.patch b/packages/apt/cmdline-apt-helper.cc.patch new file mode 100644 index 00000000..5eeb7011 --- /dev/null +++ b/packages/apt/cmdline-apt-helper.cc.patch @@ -0,0 +1,11 @@ +diff -u -r ../apt-1.1.3/cmdline/apt-helper.cc ./cmdline/apt-helper.cc +--- ../apt-1.1.3/cmdline/apt-helper.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./cmdline/apt-helper.cc 2015-12-03 16:49:25.049283100 -0500 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include // For atoi + + #include + /*}}}*/ diff --git a/packages/apt/cmdline-apt-key.in.patch b/packages/apt/cmdline-apt-key.in.patch new file mode 100644 index 00000000..86ba52e3 --- /dev/null +++ b/packages/apt/cmdline-apt-key.in.patch @@ -0,0 +1,42 @@ +diff -u -r ../apt-1.1.3/cmdline/apt-key.in ./cmdline/apt-key.in +--- ../apt-1.1.3/cmdline/apt-key.in 2015-11-30 03:08:24.000000000 -0500 ++++ ./cmdline/apt-key.in 2015-12-03 16:55:22.860914040 -0500 +@@ -19,10 +19,7 @@ + aptkey_echo() { echo "$@"; } + + requires_root() { +- if [ "$(id -u)" -ne 0 ]; then +- echo >&2 "ERROR: This command can only be used by root." +- exit 1 +- fi ++ continue + } + + get_fingerprints_of_keyring() { +@@ -212,7 +209,7 @@ + if [ -s "$TRUSTEDFILE" ]; then + $ACTION "$TRUSTEDFILE" "$@" + fi +- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" ++ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" + eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) + if [ -d "$TRUSTEDPARTS" ]; then + # strip / suffix as gpg will double-slash in that case (#665411) +@@ -286,7 +283,7 @@ + fi + else + # otherwise all known keyrings are merged +- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" ++ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d" + eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) + if [ -d "$TRUSTEDPARTS" ]; then + # ignore errors mostly for non-existing $TRUSTEDFILE +@@ -441,7 +438,7 @@ + done + + if [ -z "$TRUSTEDFILE" ]; then +- TRUSTEDFILE="/etc/apt/trusted.gpg" ++ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg" + eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) + eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) + fi diff --git a/packages/apt/cmdline-makefile.patch b/packages/apt/cmdline-makefile.patch new file mode 100644 index 00000000..b11c0aa8 --- /dev/null +++ b/packages/apt/cmdline-makefile.patch @@ -0,0 +1,12 @@ +diff -u -r ../apt-1.1.3/cmdline/makefile ./cmdline/makefile +--- ../apt-1.1.3/cmdline/makefile 2015-11-30 03:08:24.000000000 -0500 ++++ ./cmdline/makefile 2015-12-03 16:50:46.792294882 -0500 +@@ -49,7 +49,7 @@ + + # The apt-helper + PROGRAM=apt-helper +-SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -lresolv ++SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) + LIB_MAKES = apt-pkg/makefile apt-private/makefile + SOURCE = apt-helper.cc + include $(PROGRAM_H) diff --git a/packages/apt/configure.ac.patch b/packages/apt/configure.ac.patch deleted file mode 100644 index 321fdff9..00000000 --- a/packages/apt/configure.ac.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -u -r ../upstream.git/configure.ac ./configure.ac ---- ../upstream.git/configure.ac 2014-06-18 14:12:32.000000000 +0200 -+++ ./configure.ac 2014-06-18 23:18:51.219899072 +0200 -@@ -89,11 +89,6 @@ - AC_MSG_ERROR([failed: I need CURL due https support]), - ) - --AC_LANG_PUSH([C++]) --AC_CHECK_HEADER(gtest/gtest.h,, -- AC_MSG_ERROR([failed: I need gtest to build tests]), --) --AC_LANG_POP([C++]) - - - AC_SUBST(BDBLIB) diff --git a/packages/apt/configure.patch b/packages/apt/configure.patch index d35e4d8c..1a534829 100644 --- a/packages/apt/configure.patch +++ b/packages/apt/configure.patch @@ -1,19 +1,22 @@ -diff -u -r ../upstream.git/configure ./configure ---- ../upstream.git/configure 2014-06-18 14:12:34.000000000 +0200 -+++ ./configure 2014-06-18 23:09:25.315914542 +0200 -@@ -4807,11 +4807,6 @@ +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" +-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_fn_error $? "failed: I need gtest to build tests" "$LINENO" 5 +- { $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 -@@ -4986,7 +4981,7 @@ +@@ -5003,7 +4997,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking debian architecture" >&5 $as_echo_n "checking debian architecture... " >&6; } diff --git a/packages/apt/contrib-fileutl.cc.patch b/packages/apt/contrib-fileutl.cc.patch new file mode 100644 index 00000000..c4292229 --- /dev/null +++ b/packages/apt/contrib-fileutl.cc.patch @@ -0,0 +1,41 @@ +diff -u -r ../apt-1.1.3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc +--- ../apt-1.1.3/apt-pkg/contrib/fileutl.cc 2015-11-30 03:08:24.000000000 -0500 ++++ ./apt-pkg/contrib/fileutl.cc 2015-12-03 17:43:23.360831115 -0500 +@@ -100,7 +100,7 @@ + _exit(100); + } + +- if (chdir("/tmp/") != 0) ++ if (chdir("@TERMUX_PREFIX@/tmp/") != 0) + _exit(100); + + unsigned int Count = 1; +@@ -2102,6 +2102,7 @@ + std::vector Glob(std::string const &pattern, int flags) + { + std::vector result; ++#ifndef __ANDROID__ + glob_t globbuf; + int glob_res; + unsigned int i; +@@ -2121,6 +2122,7 @@ + result.push_back(string(globbuf.gl_pathv[i])); + + globfree(&globbuf); ++#endif + return result; + } + /*}}}*/ +@@ -2136,10 +2138,10 @@ + struct stat st; + if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set + stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory +- tmpdir = "/tmp"; ++ tmpdir = "@TERMUX_PREFIX@/tmp"; + else if (geteuid() != 0 && // root can do everything anyway + faccessat(-1, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0) // current user has rwx access to directory +- tmpdir = "/tmp"; ++ tmpdir = "@TERMUX_PREFIX@/tmp"; + + return string(tmpdir); + } diff --git a/packages/apt/debrecords-cc-no-langinfo.patch b/packages/apt/debrecords-cc-no-langinfo.patch deleted file mode 100644 index 19771f47..00000000 --- a/packages/apt/debrecords-cc-no-langinfo.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -u -r ../upstream.git/apt-pkg/deb/debrecords.cc ./apt-pkg/deb/debrecords.cc ---- ../upstream.git/apt-pkg/deb/debrecords.cc 2014-04-25 13:39:00.000000000 +0200 -+++ ./apt-pkg/deb/debrecords.cc 2014-07-01 16:47:41.913835586 +0200 -@@ -22,7 +22,9 @@ - #include - #include - #include -+#ifndef __ANDROID__ - #include -+#endif - /*}}}*/ - - using std::string; -@@ -151,11 +153,13 @@ - orig = Section.FindS(string("Description-").append(*l).c_str()); - } - -+#ifndef __ANDROID__ - char const * const codeset = nl_langinfo(CODESET); - if (strcmp(codeset,"UTF-8") != 0) { - UTF8ToCodeset(codeset, orig, &dest); - orig = dest; - } -+#endif - - return orig; - } diff --git a/packages/apt/dpkgpm.cc.patch b/packages/apt/dpkgpm.cc.patch deleted file mode 100644 index 50c78121..00000000 --- a/packages/apt/dpkgpm.cc.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -u -r ../apt-1.0.9.4/apt-pkg/deb/dpkgpm.cc ./apt-pkg/deb/dpkgpm.cc ---- ../apt-1.0.9.4/apt-pkg/deb/dpkgpm.cc 2014-12-03 10:06:58.000000000 -0500 -+++ ./apt-pkg/deb/dpkgpm.cc 2014-12-07 07:17:09.210804305 -0500 -@@ -27,7 +27,9 @@ - #include - #include - #include --#include -+#ifndef __ANDROID__ -+# include -+#endif - #include - #include - #include -@@ -1075,7 +1077,11 @@ - - _error->PushToStack(); - -+#ifdef __ANDROID__ -+ d->master = open("/dev/ptmx", O_RDWR | O_NOCTTY); -+# else - d->master = posix_openpt(O_RDWR | O_NOCTTY); -+#endif - if (d->master == -1) - _error->Errno("posix_openpt", _("Can not write log (%s)"), _("Is /dev/pts mounted?")); - else if (unlockpt(d->master) == -1) diff --git a/packages/apt/fileutl.patch b/packages/apt/fileutl.patch deleted file mode 100644 index 1e06a43d..00000000 --- a/packages/apt/fileutl.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -u -r ../upstream.git/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc ---- ../upstream.git/apt-pkg/contrib/fileutl.cc 2014-05-05 14:01:59.000000000 +0200 -+++ ./apt-pkg/contrib/fileutl.cc 2014-06-06 00:09:17.233239376 +0200 -@@ -46,7 +46,9 @@ - #include - #include - #include -+#ifndef __ANDROID__ - #include -+#endif - - #include - #include -@@ -93,7 +95,7 @@ - _exit(100); - } - -- if (chdir("/tmp/") != 0) -+ if (chdir("@TERMUX_PREFIX@/tmp/") != 0) - _exit(100); - - unsigned int Count = 1; -@@ -1883,7 +1885,11 @@ - FileFdErrno("read","Unable to read original size of gzipped file"); - return 0; - } -+#ifdef __ANDROID__ -+ size = letoh32(size); -+#else - size = le32toh(size); -+#endif - - if (lseek(iFd, oldPos, SEEK_SET) < 0) - { -@@ -1998,6 +2004,7 @@ - std::vector Glob(std::string const &pattern, int flags) - { - std::vector result; -+#ifndef __ANDROID__ - glob_t globbuf; - int glob_res; - unsigned int i; -@@ -2017,6 +2024,7 @@ - result.push_back(string(globbuf.gl_pathv[i])); - - globfree(&globbuf); -+#endif - return result; - } - /*}}}*/ -@@ -2025,15 +2033,10 @@ - { - const char *tmpdir = getenv("TMPDIR"); - --#ifdef P_tmpdir -- if (!tmpdir) -- tmpdir = P_tmpdir; --#endif -- - // check that tmpdir is set and exists - struct stat st; - if (!tmpdir || strlen(tmpdir) == 0 || stat(tmpdir, &st) != 0) -- tmpdir = "/tmp"; -+ tmpdir = "@TERMUX_PREFIX@/tmp"; - - return string(tmpdir); - } diff --git a/packages/apt/gpgv.patch b/packages/apt/gpgv.patch deleted file mode 100644 index 2d936792..00000000 --- a/packages/apt/gpgv.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../upstream.git/apt-pkg/contrib/gpgv.cc ./apt-pkg/contrib/gpgv.cc ---- ../upstream.git/apt-pkg/contrib/gpgv.cc 2014-04-25 13:39:00.000000000 +0200 -+++ ./apt-pkg/contrib/gpgv.cc 2014-06-06 00:18:13.209224724 +0200 -@@ -43,7 +84,7 @@ - int const &statusfd, int fd[2]) - { - #define EINTERNAL 111 -- std::string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); -+ std::string const gpgvpath = _config->Find("Dir::Bin::gpg", "@TERMUX_PREFIX@/bin/gpgv"); - // FIXME: remove support for deprecated APT::GPGV setting - std::string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted")); - std::string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts"); diff --git a/packages/apt/install-progress-cc-include-termios-h.patch b/packages/apt/install-progress-cc-include-termios-h.patch deleted file mode 100644 index 6476607c..00000000 --- a/packages/apt/install-progress-cc-include-termios-h.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/install-progress.cc ./apt-pkg/install-progress.cc ---- ../apt-0.9.16.1/apt-pkg/install-progress.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./apt-pkg/install-progress.cc 2014-03-25 01:16:03.436701913 +0100 -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include - diff --git a/packages/apt/methods-makefile.patch b/packages/apt/methods-makefile.patch new file mode 100644 index 00000000..4870b4e1 --- /dev/null +++ b/packages/apt/methods-makefile.patch @@ -0,0 +1,37 @@ +diff -u -r ../apt-1.1.3/methods/makefile ./methods/makefile +--- ../apt-1.1.3/methods/makefile 2015-11-30 03:08:24.000000000 -0500 ++++ ./methods/makefile 2015-12-03 16:45:46.819879625 -0500 +@@ -46,21 +46,21 @@ + + # The http method + PROGRAM=http +-SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv ++SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) + LIB_MAKES = apt-pkg/makefile + SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc + include $(PROGRAM_H) + + # The https method + PROGRAM=https +-SLIBS = -lapt-pkg -lcurl $(INTLLIBS) -lresolv ++SLIBS = -lapt-pkg -lcurl $(INTLLIBS) + LIB_MAKES = apt-pkg/makefile + SOURCE = https.cc server.cc + include $(PROGRAM_H) + + # The ftp method + PROGRAM=ftp +-SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv ++SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) + LIB_MAKES = apt-pkg/makefile + SOURCE = ftp.cc rfc2553emu.cc connect.cc + include $(PROGRAM_H) +@@ -81,7 +81,7 @@ + + # The mirror method + PROGRAM=mirror +-SLIBS = -lapt-pkg $(SOCKETLIBS) -lresolv ++SLIBS = -lapt-pkg $(SOCKETLIBS) + LIB_MAKES = apt-pkg/makefile + SOURCE = mirror.cc http.cc rfc2553emu.cc connect.cc server.cc + include $(PROGRAM_H) diff --git a/packages/apt/no-usr-bin-test.patch b/packages/apt/no-usr-bin-test.patch deleted file mode 100644 index dd58cfa9..00000000 --- a/packages/apt/no-usr-bin-test.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../upstream.git/buildlib/configure.mak ./buildlib/configure.mak ---- ../upstream.git/buildlib/configure.mak 2013-12-07 14:12:14.000000000 +0100 -+++ ./buildlib/configure.mak 2014-03-11 15:33:01.000000000 +0100 -@@ -55,7 +55,7 @@ - aclocal -I buildlib - - $(BUILDDIR)/config.status: configure -- /usr/bin/test -e $(BUILDDIR) || mkdir $(BUILDDIR) -+ test -e $(BUILDDIR) || mkdir $(BUILDDIR) - (HERE=`pwd`; cd $(BUILDDIR) && $$HERE/configure) - - $(addprefix $(BUILDDIR)/,$(CONVERTED)): $(BUILDDIR)/config.status -- 2.11.0