From dc1110726feb2abd6105b9255d5492c96fe9454e Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 17 Sep 2017 20:51:20 +0200 Subject: [PATCH] apt: Update from 1.2.12 to 1.4.7 --- .../apt/apt-pkg-contrib-srvrec.cc.patch | 28 ------- .../apt/apt-pkg-contrib-strutl.cc.patch | 19 ----- .../apt/apt-pkg-deb-debrecords.cc.patch | 28 ------- disabled-packages/apt/apt-pkg-init-dir.patch | 50 ------------- .../apt/apt-private-private-download.cc.patch | 11 --- disabled-packages/apt/build.sh | 41 ----------- disabled-packages/apt/cmdline-apt-key.in.patch | 43 ----------- disabled-packages/apt/cmndline-no-strchrnul.patch | 18 ----- disabled-packages/apt/debsrcrecords.patch | 18 ----- disabled-packages/apt/methods-connect.cc.patch | 23 ------ .../apt/private-output-no-langinfo.patch | 25 ------- disabled-packages/apt/trusted.gpg | Bin 1198 -> 0 bytes disabled-packages/apt/vendor.patch | 16 ---- .../apt/CMakeLists.txt.patch | 0 packages/apt/Makefile.patch | 34 --------- .../apt/apt-pkg-CMakeLists.txt.patch | 0 packages/apt/apt-pkg-aptconfiguration.cc.patch | 34 --------- .../apt/apt-pkg-contrib-fileutl.patch | 18 ++++- packages/apt/apt-pkg-contrib-gpgv.cc.patch | 12 --- packages/apt/apt-pkg-contrib-strutl.cc.patch | 63 ++-------------- packages/apt/apt-pkg-deb-debindexfile.cc.patch | 14 ---- packages/apt/apt-pkg-init-dir.patch | 56 ++++++++++---- packages/apt/apt-pkg-makefile.patch | 12 --- packages/apt/apt-transport-https.subpackage.sh | 3 - packages/apt/build.sh | 81 +++++++++------------ packages/apt/cmdline-apt-key.in.patch | 51 +++++-------- packages/apt/cmdline-makefile.patch | 26 ------- packages/apt/completions-bash-apt.patch | 27 ------- packages/apt/configure.patch | 30 -------- packages/apt/contrib-fileutl.cc.patch | 51 ------------- packages/apt/debsystem-paths.patch | 26 ------- packages/apt/doc-makefile.patch | 13 ---- packages/apt/ftp-use-socklen_t.patch | 12 --- .../apt/methods-cmakelist.patch | 0 packages/apt/methods-connect.cc.patch | 16 ++-- packages/apt/methods-makefile.patch | 46 ------------ packages/apt/netrc.patch | 19 ----- ...interactive-helper-makefile-no-libpthread.patch | 12 --- 38 files changed, 124 insertions(+), 852 deletions(-) delete mode 100644 disabled-packages/apt/apt-pkg-contrib-srvrec.cc.patch delete mode 100644 disabled-packages/apt/apt-pkg-contrib-strutl.cc.patch delete mode 100644 disabled-packages/apt/apt-pkg-deb-debrecords.cc.patch delete mode 100644 disabled-packages/apt/apt-pkg-init-dir.patch delete mode 100644 disabled-packages/apt/apt-private-private-download.cc.patch delete mode 100644 disabled-packages/apt/build.sh delete mode 100644 disabled-packages/apt/cmdline-apt-key.in.patch delete mode 100644 disabled-packages/apt/cmndline-no-strchrnul.patch delete mode 100644 disabled-packages/apt/debsrcrecords.patch delete mode 100644 disabled-packages/apt/methods-connect.cc.patch delete mode 100644 disabled-packages/apt/private-output-no-langinfo.patch delete mode 100644 disabled-packages/apt/trusted.gpg delete mode 100644 disabled-packages/apt/vendor.patch rename {disabled-packages => packages}/apt/CMakeLists.txt.patch (100%) delete mode 100644 packages/apt/Makefile.patch rename {disabled-packages => packages}/apt/apt-pkg-CMakeLists.txt.patch (100%) delete mode 100644 packages/apt/apt-pkg-aptconfiguration.cc.patch rename {disabled-packages => packages}/apt/apt-pkg-contrib-fileutl.patch (73%) delete mode 100644 packages/apt/apt-pkg-contrib-gpgv.cc.patch delete mode 100644 packages/apt/apt-pkg-deb-debindexfile.cc.patch delete mode 100644 packages/apt/apt-pkg-makefile.patch delete mode 100644 packages/apt/apt-transport-https.subpackage.sh delete mode 100644 packages/apt/cmdline-makefile.patch delete mode 100644 packages/apt/completions-bash-apt.patch delete mode 100644 packages/apt/configure.patch delete mode 100644 packages/apt/contrib-fileutl.cc.patch delete mode 100644 packages/apt/debsystem-paths.patch delete mode 100644 packages/apt/doc-makefile.patch delete mode 100644 packages/apt/ftp-use-socklen_t.patch rename {disabled-packages => packages}/apt/methods-cmakelist.patch (100%) delete mode 100644 packages/apt/methods-makefile.patch delete mode 100644 packages/apt/netrc.patch delete mode 100644 packages/apt/test-interactive-helper-makefile-no-libpthread.patch diff --git a/disabled-packages/apt/apt-pkg-contrib-srvrec.cc.patch b/disabled-packages/apt/apt-pkg-contrib-srvrec.cc.patch deleted file mode 100644 index d698023f..00000000 --- a/disabled-packages/apt/apt-pkg-contrib-srvrec.cc.patch +++ /dev/null @@ -1,28 +0,0 @@ -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,24 @@ - 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); - } - -+#ifdef __ANDROID__ -+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/disabled-packages/apt/apt-pkg-contrib-strutl.cc.patch b/disabled-packages/apt/apt-pkg-contrib-strutl.cc.patch deleted file mode 100644 index fdb5d242..00000000 --- a/disabled-packages/apt/apt-pkg-contrib-strutl.cc.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc ---- ../apt-1.4.7/apt-pkg/contrib/strutl.cc 2017-07-13 23:45:39.000000000 +0200 -+++ ./apt-pkg/contrib/strutl.cc 2017-07-23 22:58:23.103247428 +0200 -@@ -100,6 +100,7 @@ - } - } - /*}}}*/ -+#ifndef __ANDROID__ - // UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/ - // --------------------------------------------------------------------- - /* This is handy to use before display some information for enduser */ -@@ -169,6 +170,7 @@ - - return true; - } -+#endif - /*}}}*/ - // strstrip - Remove white space from the front and back of a string /*{{{*/ - // --------------------------------------------------------------------- diff --git a/disabled-packages/apt/apt-pkg-deb-debrecords.cc.patch b/disabled-packages/apt/apt-pkg-deb-debrecords.cc.patch deleted file mode 100644 index 3b512df9..00000000 --- a/disabled-packages/apt/apt-pkg-deb-debrecords.cc.patch +++ /dev/null @@ -1,28 +0,0 @@ -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/disabled-packages/apt/apt-pkg-init-dir.patch b/disabled-packages/apt/apt-pkg-init-dir.patch deleted file mode 100644 index 151aab49..00000000 --- a/disabled-packages/apt/apt-pkg-init-dir.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- ../cache/apt-1.4.7/apt-pkg/init.cc 2017-07-14 07:45:39.000000000 +1000 -+++ ./apt-pkg/init.cc 2017-07-19 17:03:07.949752843 +1000 -@@ -51,7 +51,7 @@ - return vec; - } - -- -+#ifndef __ANDROID__ - // pkgInitArchTupleMap - Initialize the architecture tuple map /*{{{*/ - // --------------------------------------------------------------------- - /* This initializes */ -@@ -116,7 +116,7 @@ - - return true; - } -- /*}}}*/ -+#endif /*}}}*/ - - - // pkgInitConfig - Initialize the configuration class /*{{{*/ -@@ -133,6 +133,7 @@ - Cnf.CndSet("APT::Install-Recommends", true); - Cnf.CndSet("APT::Install-Suggests", false); - Cnf.CndSet("Dir","/"); -+ Cnf.CndSet("Acquire::Languages", "none"); - - // State - Cnf.CndSet("Dir::State", STATE_DIR + 1); -@@ -158,9 +159,9 @@ - Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg"); - Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d"); - Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods"); -- Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); -- Cnf.CndSet("Dir::Bin::planners::",LIBEXEC_DIR "/planners"); -- Cnf.CndSet("Dir::Media::MountPath","/media/apt"); -+ Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); -+ Cnf.CndSet("Dir::Bin::planners::", LIBEXEC_DIR "/planners"); -+ Cnf.CndSet("Dir::Media::MountPath","media/apt"); - - // State - Cnf.CndSet("Dir::Log", LOG_DIR + 1); -@@ -283,8 +284,6 @@ - return _error->Error(_("Unable to determine a suitable packaging system type")); - } - -- if (pkgInitArchTupleMap() == false) -- return false; - - return Sys->Initialize(Cnf); - } diff --git a/disabled-packages/apt/apt-private-private-download.cc.patch b/disabled-packages/apt/apt-private-private-download.cc.patch deleted file mode 100644 index 55e3d464..00000000 --- a/disabled-packages/apt/apt-private-private-download.cc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -u -r ../apt-1.2.12/apt-private/private-download.cc ./apt-private/private-download.cc ---- ../apt-1.2.12/apt-private/private-download.cc 2016-05-11 10:57:51.000000000 +0200 -+++ ./apt-private/private-download.cc 2017-07-01 00:31:32.131776100 +0200 -@@ -121,7 +121,6 @@ - /*}}}*/ - bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/ - { -- uint32_t const RAMFS_MAGIC = 0x858458f6; - /* Check for enough free space, but only if we are actually going to - download */ - if (_config->FindB("APT::Get::Print-URIs", false) == true || diff --git a/disabled-packages/apt/build.sh b/disabled-packages/apt/build.sh deleted file mode 100644 index 47685b55..00000000 --- a/disabled-packages/apt/build.sh +++ /dev/null @@ -1,41 +0,0 @@ -TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt -TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" -TERMUX_PKG_DEPENDS="libutil, libcurl, liblzma, dpkg, gpgv, libc++" -TERMUX_PKG_VERSION=1.4.7 -TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz -TERMUX_PKG_SHA256=ea2a2e8e08daf8ea11aeaa86928d943a42ce53989165a30cc828838d470b7719 -TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --DPERL_EXECUTABLE=`which perl` --DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX --DCOMMON_ARCH=$TERMUX_ARCH --DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg --DUSE_NLS=OFF --DWITH_DOC=OFF -" -TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION} -TERMUX_PKG_ESSENTIAL=yes -TERMUX_PKG_CONFFILES="etc/apt/sources.list" -TERMUX_PKG_CONFLICTS=apt-transport-https -TERMUX_PKG_REPLACES=apt-transport-https -TERMUX_PKG_RM_AFTER_INSTALL=" -bin/apt-cdrom -bin/apt-extracttemplates -bin/apt-mark -bin/apt-sortpkgs -etc/apt/apt.conf.d -lib/apt/apt-helper -lib/apt/methods/bzip2 -lib/apt/methods/cdrom -lib/apt/methods/mirror -lib/apt/methods/rred -lib/apt/planners/ -lib/apt/solvers/ -lib/dpkg/ -lib/libapt-inst.so -" - -termux_step_post_make_install() { - printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list - cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ - rm /data/data/com.termux/files/usr/include/apt-pkg -r -} diff --git a/disabled-packages/apt/cmdline-apt-key.in.patch b/disabled-packages/apt/cmdline-apt-key.in.patch deleted file mode 100644 index 91d86678..00000000 --- a/disabled-packages/apt/cmdline-apt-key.in.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in ---- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200 -+++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200 -@@ -16,10 +16,7 @@ - aptkey_echo() { echo "$@"; } - - requires_root() { -- if [ "$(id -u)" -ne 0 ]; then -- apt_error "This command can only be used by root." -- exit 1 -- fi -+continue - } - - command_available() { -@@ -260,7 +257,7 @@ - if accessible_file_exists "$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 - TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")" -@@ -542,7 +539,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 -@@ -612,7 +609,8 @@ - unset TMPDIR - fi - fi -- GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')" -+ # Use short options as busybox mktemp does not support long ones: -+ GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')" - CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;" - trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM - if [ -z "$GPGHOMEDIR" ]; then diff --git a/disabled-packages/apt/cmndline-no-strchrnul.patch b/disabled-packages/apt/cmndline-no-strchrnul.patch deleted file mode 100644 index 55a08727..00000000 --- a/disabled-packages/apt/cmndline-no-strchrnul.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc ./apt-pkg/contrib/cmndline.cc ---- ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./apt-pkg/contrib/cmndline.cc 2014-03-25 01:10:30.764711007 +0100 -@@ -27,6 +27,14 @@ - /*}}}*/ - using namespace std; - -+#if defined(__ANDROID__) -+static char* strchrnul(char const* s, int c) -+{ -+ char const* result = strchr(s, c); -+ return const_cast((result == NULL) ? (s + strlen(s)) : result); -+} -+#endif -+ - // CommandLine::CommandLine - Constructor /*{{{*/ - // --------------------------------------------------------------------- - /* */ diff --git a/disabled-packages/apt/debsrcrecords.patch b/disabled-packages/apt/debsrcrecords.patch deleted file mode 100644 index bedcbc09..00000000 --- a/disabled-packages/apt/debsrcrecords.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc ./apt-pkg/deb/debsrcrecords.cc ---- ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./apt-pkg/deb/debsrcrecords.cc 2014-03-25 01:23:30.652689687 +0100 -@@ -26,6 +26,14 @@ - #include - #include - /*}}}*/ -+#if defined(__ANDROID__) -+static char* strchrnul(char const* s, int c) -+{ -+ char const* result = strchr(s, c); -+ return const_cast((result == NULL) ? (s + strlen(s)) : result); -+} -+#endif -+ - - using std::max; - using std::string; diff --git a/disabled-packages/apt/methods-connect.cc.patch b/disabled-packages/apt/methods-connect.cc.patch deleted file mode 100644 index 2767a572..00000000 --- a/disabled-packages/apt/methods-connect.cc.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ../cache/apt-1.4.7/methods/connect.cc 2017-07-14 07:45:39.000000000 +1000 -+++ ./methods/connect.cc 2017-07-23 10:50:27.755510218 +1000 -@@ -129,7 +129,7 @@ - - // Check the socket for an error condition - unsigned int Err; -- unsigned int Len = sizeof(Err); -+ socklen_t Len = sizeof(Err); - if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) - return _error->Errno("getsockopt",_("Failed")); - -@@ -301,7 +301,10 @@ - if(LastHost != Host || LastPort != Port) - { - SrvRecords.clear(); -- if (_config->FindB("Acquire::EnableSrvRecords", true) == true) -+ /* Disable by default in Termux due to it breaking on (some) HTC -+ devices (https://github.com/termux/termux-packages/issues/99). */ -+ -+ if (_config->FindB("Acquire::EnableSrvRecords", false) == true) - { - GetSrvRecords(Host, DefPort, SrvRecords); - // RFC2782 defines that a lonely '.' target is an abort reason diff --git a/disabled-packages/apt/private-output-no-langinfo.patch b/disabled-packages/apt/private-output-no-langinfo.patch deleted file mode 100644 index 6bf02108..00000000 --- a/disabled-packages/apt/private-output-no-langinfo.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -u -r ../upstream.git/apt-private/private-output.cc ./apt-private/private-output.cc ---- ../upstream.git/apt-private/private-output.cc 2014-06-10 15:24:50.000000000 +0200 -+++ ./apt-private/private-output.cc 2014-06-15 02:40:10.539223656 +0200 -@@ -20,7 +20,11 @@ - #include - #include - #include --#include -+#ifdef __ANDROID__ -+# include -+# else -+# include -+#endif - #include - #include - #include -@@ -764,7 +768,7 @@ - regex_t Pattern; - int Res; - -- Res = regcomp(&Pattern, nl_langinfo(YESEXPR), -+ Res = regcomp(&Pattern, "^[yY]", - REG_EXTENDED|REG_ICASE|REG_NOSUB); - - if (Res != 0) { diff --git a/disabled-packages/apt/trusted.gpg b/disabled-packages/apt/trusted.gpg deleted file mode 100644 index 323fadb33660bbd60d7a699ce29c35563d8387b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1198 zcmV;f1X25$0SyFGjgguG2mrbP#2qPjnoTmT5lb_P)xhyi&PIgJnMcTyY|tgcAH_u%cOtl!XF7ljS!Kv2s~+QiV1K$Syz_#chn4^JpYI zNEC04+fwHTH_s|@qpiF4sjiPp)3DyFponmENZ5gdDBivU2I^zHl0RRECCq{B*WO8Y1AVzO;Zg*j9Y#=;la%E(4X=^}cZ*p#T zVQg$JZe?^ni2*nS69EDMA_W3djgguH8v_Ol2?z%R0tOWb0tpHW1Qr4V0RkQY0vCV) z3JDNr0JnZ^jSA?-+LGYcbc5a;wAiO@%K!a#wr|I?eh|f&jJxpk^i*(b z_PBn6_SpM6@#e85q$-!=>-jo?8`3vHB$P8dHFAzMk!5?<{wL5}ovX7ZA;z>;%{nSU zf55~dADgYe>1Q3Npknm)I#k5Mrxcw{YyTxuNJ`ttmH_v@B=yT=W_)e(xYa9C-O~JW zq9Vh>9DcjwG+#s;nTmbHxj@>%R3NKwFR53TM#UDm%vWraXuU2!VPw?QVfIk{&46Ah zYu0_~6QSvHU#y2}b-#ytchk?$N?)$*D~k{55%oLF1+`i#BV?V zk+QAp;dj9MZv2C=0ssTK0SyFGjgguG2msS{F|ne->BHljV_C;5G1>vT?=m>}+MNGl zcoOOPNHtBmP}l7c492rPaovP9mY@QVbBa!zJn`>8A;Ptxxbw{nPim$wG>@}rDAbOp zs^jB9K8FW(<3*KNRR;KGl8?w7fkox)HiI`*3-|XcfwwWAVZLxC^wqt27$3{UszcAb z3W77x2`Uyi(-zUc6BW9Py%%ekia6$H*|EQYxm1NDPnpsPw1!i!-V|i~xA;TnH58Jt zJEM4A*AK?ATNiC8ki@8b-@TIQ9cgQY=;lcNZ%W67PF|(FE1XdtA0%Swz)VirmPx&i zJzCgKh=&@7^aKB9)#+khwLCNzPZt0Y0RRDs0Urby0RjLC1p-rzk(vS<3;+rV5N80l zer=5k=g&$A0D@U=(IbZXdlxK;w>8Yv7)6^k>kR_qJ?6GT&3>1;oGBW~uhO;qhDR>o zPl7%-{molS(dk}O>dRvO~I%E2x@b28q+!(!9z!MCCJ%VS`=<0WJizZ-#y(@zEv>22wc3Z zTkRhRAOYF4xF*I?JYA{25N~oBy%VEswutwqQ3N|8RYf#8ci%2(2lot1Qjen`i MF%W%jEU*Fq0|eDB4gdfE diff --git a/disabled-packages/apt/vendor.patch b/disabled-packages/apt/vendor.patch deleted file mode 100644 index f8463644..00000000 --- a/disabled-packages/apt/vendor.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -u -r ../upstream.git/vendor/ubuntu/apt-vendor.ent ./vendor/ubuntu/apt-vendor.ent ---- ../upstream.git/vendor/ubuntu/apt-vendor.ent 2014-04-25 13:39:00.000000000 +0200 -+++ ./vendor/ubuntu/apt-vendor.ent 2014-06-03 11:53:11.535752314 +0200 -@@ -1,7 +1,7 @@ - -- --ubuntu-keyring"> --/usr/share/keyrings/ubuntu-archive-keyring.gpg"> --/usr/share/keyrings/ubuntu-archive-removed-keys.gpg"> -- -+ -+termux-keyring"> -+@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg"> -+@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg"> -+ - diff --git a/disabled-packages/apt/CMakeLists.txt.patch b/packages/apt/CMakeLists.txt.patch similarity index 100% rename from disabled-packages/apt/CMakeLists.txt.patch rename to packages/apt/CMakeLists.txt.patch diff --git a/packages/apt/Makefile.patch b/packages/apt/Makefile.patch deleted file mode 100644 index 171c008c..00000000 --- a/packages/apt/Makefile.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -u -r ../apt-1.1.3/Makefile ./Makefile ---- ../apt-1.1.3/Makefile 2015-11-30 03:08:24.000000000 -0500 -+++ ./Makefile 2015-12-04 05:05:01.447148671 -0500 -@@ -9,8 +9,8 @@ - .PHONY: default - default: startup all - --.PHONY: fast headers library clean veryclean all binary program doc test update-po --all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs: -+.PHONY: fast headers library clean veryclean all binary program doc update-po -+all headers library clean veryclean binary program doc manpages docbook update-po startup dirs: - $(MAKE) -C vendor $@ - $(MAKE) -C apt-pkg $@ - $(MAKE) -C apt-inst $@ -@@ -21,8 +21,6 @@ - $(MAKE) -C dselect $@ - $(MAKE) -C doc $@ - $(MAKE) -C po $@ -- # FIXME: -C test has issue swith parallel builds, investigate! -- -$(MAKE) -C test $@ - - fast: - $(MAKE) -C vendor all -@@ -32,9 +30,8 @@ - $(MAKE) -C methods all - $(MAKE) -C cmdline all - $(MAKE) -C ftparchive all -- $(MAKE) -C test all - --all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs -+all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs - - dirs: startup - diff --git a/disabled-packages/apt/apt-pkg-CMakeLists.txt.patch b/packages/apt/apt-pkg-CMakeLists.txt.patch similarity index 100% rename from disabled-packages/apt/apt-pkg-CMakeLists.txt.patch rename to packages/apt/apt-pkg-CMakeLists.txt.patch diff --git a/packages/apt/apt-pkg-aptconfiguration.cc.patch b/packages/apt/apt-pkg-aptconfiguration.cc.patch deleted file mode 100644 index 1cce5fea..00000000 --- a/packages/apt/apt-pkg-aptconfiguration.cc.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -u -r ../apt-1.2/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguration.cc ---- ../apt-1.2/apt-pkg/aptconfiguration.cc 2016-01-15 13:53:52.000000000 -0500 -+++ ./apt-pkg/aptconfiguration.cc 2016-01-25 06:12:27.102248821 -0500 -@@ -35,9 +35,9 @@ - // 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"); -- _config->CndSet("Dir::Bin::lz4", "/usr/bin/lz4"); -+ _config->CndSet("Dir::Bin::bzip2", "bin/bzip2"); -+ _config->CndSet("Dir::Bin::xz", "bin/xz"); -+ _config->CndSet("Dir::Bin::lz4", "bin/lz4"); - 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"); -@@ -50,7 +50,7 @@ - _config->Set("APT::Compressor::lzma::UncompressArg::", "-d"); - } - } else { -- _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma"); -+ _config->CndSet("Dir::Bin::lzma", "bin/lzma"); - if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) { - _config->Set("APT::Compressor::lzma::CompressArg::", "--suffix="); - _config->Set("APT::Compressor::lzma::CompressArg::", "-6"); -@@ -220,7 +220,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/disabled-packages/apt/apt-pkg-contrib-fileutl.patch b/packages/apt/apt-pkg-contrib-fileutl.patch similarity index 73% rename from disabled-packages/apt/apt-pkg-contrib-fileutl.patch rename to packages/apt/apt-pkg-contrib-fileutl.patch index 7f356fd1..5830eace 100644 --- a/disabled-packages/apt/apt-pkg-contrib-fileutl.patch +++ b/packages/apt/apt-pkg-contrib-fileutl.patch @@ -1,7 +1,17 @@ diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc --- ../apt-1.4.7/apt-pkg/contrib/fileutl.cc 2017-07-13 23:45:39.000000000 +0200 -+++ ./apt-pkg/contrib/fileutl.cc 2017-07-23 21:02:20.571611631 +0200 -@@ -2752,6 +2752,7 @@ ++++ ./apt-pkg/contrib/fileutl.cc 2017-09-17 20:46:39.567888481 +0200 +@@ -46,7 +46,9 @@ + #include + #include + #include ++#ifndef __ANDROID__ + #include ++#endif + #include + #include + +@@ -2752,6 +2754,7 @@ } /*}}}*/ @@ -9,7 +19,7 @@ diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc // Glob - wrapper around "glob()" /*{{{*/ std::vector Glob(std::string const &pattern, int flags) { -@@ -2777,6 +2778,7 @@ +@@ -2777,6 +2780,7 @@ globfree(&globbuf); return result; } @@ -19,7 +29,7 @@ diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc { diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.h ./apt-pkg/contrib/fileutl.h --- ../apt-1.4.7/apt-pkg/contrib/fileutl.h 2017-07-13 23:45:39.000000000 +0200 -+++ ./apt-pkg/contrib/fileutl.h 2017-07-23 21:02:02.051824374 +0200 ++++ ./apt-pkg/contrib/fileutl.h 2017-08-26 22:05:52.875932441 +0200 @@ -239,7 +239,9 @@ APT_HIDDEN std::string flNormalize(std::string file); diff --git a/packages/apt/apt-pkg-contrib-gpgv.cc.patch b/packages/apt/apt-pkg-contrib-gpgv.cc.patch deleted file mode 100644 index 785fe6c9..00000000 --- a/packages/apt/apt-pkg-contrib-gpgv.cc.patch +++ /dev/null @@ -1,12 +0,0 @@ -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-strutl.cc.patch b/packages/apt/apt-pkg-contrib-strutl.cc.patch index 8ff6807c..fdb5d242 100644 --- a/packages/apt/apt-pkg-contrib-strutl.cc.patch +++ b/packages/apt/apt-pkg-contrib-strutl.cc.patch @@ -1,25 +1,15 @@ -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 - #include -+#ifndef __ANDROID__ - #include -+#endif - - #include +diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc +--- ../apt-1.4.7/apt-pkg/contrib/strutl.cc 2017-07-13 23:45:39.000000000 +0200 ++++ ./apt-pkg/contrib/strutl.cc 2017-07-23 22:58:23.103247428 +0200 +@@ -100,6 +100,7 @@ + } + } /*}}}*/ -@@ -87,6 +89,7 @@ ++#ifndef __ANDROID__ // UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/ // --------------------------------------------------------------------- /* This is handy to use before display some information for enduser */ -+#ifndef __ANDROID__ - bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest) - { - iconv_t cd; -@@ -153,6 +156,7 @@ +@@ -169,6 +170,7 @@ return true; } @@ -27,40 +17,3 @@ diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ // --------------------------------------------------------------------- -@@ -392,14 +396,14 @@ - if (ASize < 100 && I != 0) - { - std::string S; -- strprintf(S, "%'.1f %c", ASize, Ext[I]); -+ strprintf(S, "%.1f %c", ASize, Ext[I]); - return S; - } - - if (ASize < 10000) - { - std::string S; -- strprintf(S, "%'.0f %c", ASize, Ext[I]); -+ strprintf(S, "%.0f %c", ASize, Ext[I]); - return S; - } - ASize /= 1000.0; -@@ -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 -- (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL && -+ (strptime(str, "%a, %d %b %Y %H:%M:%S", &Tm) == NULL && - // Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 -- strptime(str, "%A, %d-%b-%y %H:%M:%S %Z", &Tm) == NULL && -+ strptime(str, "%A, %d-%b-%y %H:%M:%S", &Tm) == NULL && - // Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format - strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL); - setlocale (LC_ALL,""); -- if (invalid == true) -+ if (invalid == true) { -+ if (str != NULL && strlen(str) > 1) printf("Invalid time str '%s'\n", str); - return false; -+ } - - time = timegm(&Tm); - return true; diff --git a/packages/apt/apt-pkg-deb-debindexfile.cc.patch b/packages/apt/apt-pkg-deb-debindexfile.cc.patch deleted file mode 100644 index 91a19e46..00000000 --- a/packages/apt/apt-pkg-deb-debindexfile.cc.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -u -r ../apt-1.2.3/apt-pkg/deb/debindexfile.cc ./apt-pkg/deb/debindexfile.cc ---- ../apt-1.2.3/apt-pkg/deb/debindexfile.cc 2016-02-10 12:02:45.000000000 -0500 -+++ ./apt-pkg/deb/debindexfile.cc 2016-02-18 02:44:56.707323056 -0500 -@@ -26,8 +26,10 @@ - - #include - #include -+#include - #include - #include -+#include - - #include - /*}}}*/ diff --git a/packages/apt/apt-pkg-init-dir.patch b/packages/apt/apt-pkg-init-dir.patch index e836304c..151aab49 100644 --- a/packages/apt/apt-pkg-init-dir.patch +++ b/packages/apt/apt-pkg-init-dir.patch @@ -1,26 +1,50 @@ -diff -u -r ../upstream.git/apt-pkg/init.cc ./apt-pkg/init.cc ---- ../upstream.git/apt-pkg/init.cc 2014-05-05 14:01:59.000000000 +0200 -+++ ./apt-pkg/init.cc 2014-06-04 13:57:49.848604233 +0200 -@@ -44,7 +44,8 @@ - Cnf.Set("APT::Build-Essential::", "build-essential"); +--- ../cache/apt-1.4.7/apt-pkg/init.cc 2017-07-14 07:45:39.000000000 +1000 ++++ ./apt-pkg/init.cc 2017-07-19 17:03:07.949752843 +1000 +@@ -51,7 +51,7 @@ + return vec; + } + +- ++#ifndef __ANDROID__ + // pkgInitArchTupleMap - Initialize the architecture tuple map /*{{{*/ + // --------------------------------------------------------------------- + /* This initializes */ +@@ -116,7 +116,7 @@ + + return true; + } +- /*}}}*/ ++#endif /*}}}*/ + + + // pkgInitConfig - Initialize the configuration class /*{{{*/ +@@ -133,6 +133,7 @@ Cnf.CndSet("APT::Install-Recommends", true); Cnf.CndSet("APT::Install-Suggests", false); -- Cnf.CndSet("Dir","/"); -+ Cnf.CndSet("Dir","@TERMUX_PREFIX@/"); + Cnf.CndSet("Dir","/"); + Cnf.CndSet("Acquire::Languages", "none"); // State - Cnf.CndSet("Dir::State","var/lib/apt/"); -@@ -71,9 +72,9 @@ - Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d"); + Cnf.CndSet("Dir::State", STATE_DIR + 1); +@@ -158,9 +159,9 @@ Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg"); Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d"); -- Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt/methods"); -- Cnf.CndSet("Dir::Bin::solvers::","/usr/lib/apt/solvers"); + Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods"); +- Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); +- Cnf.CndSet("Dir::Bin::planners::",LIBEXEC_DIR "/planners"); - Cnf.CndSet("Dir::Media::MountPath","/media/apt"); -+ Cnf.CndSet("Dir::Bin::methods","lib/apt/methods"); -+ Cnf.CndSet("Dir::Bin::solvers::","lib/apt/solvers"); ++ Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers"); ++ Cnf.CndSet("Dir::Bin::planners::", LIBEXEC_DIR "/planners"); + Cnf.CndSet("Dir::Media::MountPath","media/apt"); - // State - Cnf.CndSet("Dir::Log","var/log/apt"); + // State + Cnf.CndSet("Dir::Log", LOG_DIR + 1); +@@ -283,8 +284,6 @@ + return _error->Error(_("Unable to determine a suitable packaging system type")); + } + +- if (pkgInitArchTupleMap() == false) +- return false; + + return Sys->Initialize(Cnf); + } diff --git a/packages/apt/apt-pkg-makefile.patch b/packages/apt/apt-pkg-makefile.patch deleted file mode 100644 index 4c3df8d1..00000000 --- a/packages/apt/apt-pkg-makefile.patch +++ /dev/null @@ -1,12 +0,0 @@ -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/apt-transport-https.subpackage.sh b/packages/apt/apt-transport-https.subpackage.sh deleted file mode 100644 index ce021e3a..00000000 --- a/packages/apt/apt-transport-https.subpackage.sh +++ /dev/null @@ -1,3 +0,0 @@ -TERMUX_SUBPKG_INCLUDE="lib/apt/methods/https" -TERMUX_SUBPKG_DESCRIPTION="Https download support for APT" -TERMUX_SUBPKG_DEPENDS="apt, libcurl" diff --git a/packages/apt/build.sh b/packages/apt/build.sh index 48cc9082..47685b55 100644 --- a/packages/apt/build.sh +++ b/packages/apt/build.sh @@ -1,52 +1,41 @@ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager" -TERMUX_PKG_DEPENDS="liblzma, dpkg, gpgv, libc++" -# Wait with updating to later version until the NDK supports std::to_string() and other -# 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=3 -# 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_SHA256=e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6 -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-create" +TERMUX_PKG_DEPENDS="libutil, libcurl, liblzma, dpkg, gpgv, libc++" +TERMUX_PKG_VERSION=1.4.7 +TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz +TERMUX_PKG_SHA256=ea2a2e8e08daf8ea11aeaa86928d943a42ce53989165a30cc828838d470b7719 +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-DPERL_EXECUTABLE=`which perl` +-DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX +-DCOMMON_ARCH=$TERMUX_ARCH +-DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg +-DUSE_NLS=OFF +-DWITH_DOC=OFF +" TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION} -TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_ESSENTIAL=yes TERMUX_PKG_CONFFILES="etc/apt/sources.list" - -termux_step_pre_configure () { - # 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" - - cp $TERMUX_SCRIPTDIR/scripts/config.{guess,sub} $TERMUX_PKG_SRCDIR/buildlib - perl -p -i -e "s/TERMUX_ARCH/$TERMUX_ARCH/" $TERMUX_PKG_SRCDIR/configure - - rm $TERMUX_PKG_SRCDIR/apt-pkg/{cdrom.cc,indexcopy.cc} - - export ac_cv_lib_bz2_BZ2_bzopen=no -} - -termux_step_make_install () { - 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/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,rsh,store} $TERMUX_PREFIX/lib/apt/methods - (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip xz) - (cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s rsh ssh) - - 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/ - - mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/ - cp $TERMUX_PKG_SRCDIR/completions/bash/apt \ - $TERMUX_PREFIX/etc/bash_completion.d/ +TERMUX_PKG_CONFLICTS=apt-transport-https +TERMUX_PKG_REPLACES=apt-transport-https +TERMUX_PKG_RM_AFTER_INSTALL=" +bin/apt-cdrom +bin/apt-extracttemplates +bin/apt-mark +bin/apt-sortpkgs +etc/apt/apt.conf.d +lib/apt/apt-helper +lib/apt/methods/bzip2 +lib/apt/methods/cdrom +lib/apt/methods/mirror +lib/apt/methods/rred +lib/apt/planners/ +lib/apt/solvers/ +lib/dpkg/ +lib/libapt-inst.so +" + +termux_step_post_make_install() { + printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list + cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/ + rm /data/data/com.termux/files/usr/include/apt-pkg -r } diff --git a/packages/apt/cmdline-apt-key.in.patch b/packages/apt/cmdline-apt-key.in.patch index 3f6a859c..91d86678 100644 --- a/packages/apt/cmdline-apt-key.in.patch +++ b/packages/apt/cmdline-apt-key.in.patch @@ -1,51 +1,28 @@ -diff -u -r ../apt-1.1.6/cmdline/apt-key.in ./cmdline/apt-key.in ---- ../apt-1.1.6/cmdline/apt-key.in 2015-12-24 11:14:15.000000000 -0500 -+++ ./cmdline/apt-key.in 2015-12-25 17:58:37.186396718 -0500 +diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in +--- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200 ++++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200 @@ -16,10 +16,7 @@ aptkey_echo() { echo "$@"; } requires_root() { - if [ "$(id -u)" -ne 0 ]; then -- echo >&2 "ERROR: This command can only be used by root." +- apt_error "This command can only be used by root." - exit 1 - fi -+ continue ++continue } command_available() { -@@ -231,7 +228,7 @@ - if [ -s "$TRUSTEDFILE" ]; then +@@ -260,7 +257,7 @@ + if accessible_file_exists "$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) -@@ -301,11 +298,11 @@ - # if a --keyring was given, just use this one - if [ -n "$FORCED_KEYRING" ]; then - if [ -s "$FORCED_KEYRING" ]; then -- cp --dereference "$FORCED_KEYRING" "$PUBRING" -+ cp "$FORCED_KEYRING" "$PUBRING" - 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 -@@ -316,7 +313,7 @@ - done - } > "$PUBRING" 2>/dev/null - elif [ -s "$TRUSTEDFILE" ]; then -- cp --dereference "$TRUSTEDFILE" "$PUBRING" -+ cp "$TRUSTEDFILE" "$PUBRING" - fi - fi - -@@ -460,7 +457,7 @@ + TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")" +@@ -542,7 +539,7 @@ done if [ -z "$TRUSTEDFILE" ]; then @@ -54,3 +31,13 @@ diff -u -r ../apt-1.1.6/cmdline/apt-key.in ./cmdline/apt-key.in eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring) eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f) fi +@@ -612,7 +609,8 @@ + unset TMPDIR + fi + fi +- GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')" ++ # Use short options as busybox mktemp does not support long ones: ++ GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')" + CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;" + trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + if [ -z "$GPGHOMEDIR" ]; then diff --git a/packages/apt/cmdline-makefile.patch b/packages/apt/cmdline-makefile.patch deleted file mode 100644 index 9c490c5a..00000000 --- a/packages/apt/cmdline-makefile.patch +++ /dev/null @@ -1,26 +0,0 @@ -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 20:09:21.860089855 -0500 -@@ -33,13 +33,6 @@ - SOURCE = apt-config.cc - include $(PROGRAM_H) - --# The apt-cdrom program --PROGRAM=apt-cdrom --SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) --LIB_MAKES = apt-pkg/makefile apt-private/makefile --SOURCE = apt-cdrom.cc --include $(PROGRAM_H) -- - # The apt-mark program - PROGRAM=apt-mark - SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -@@ -49,7 +42,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/completions-bash-apt.patch b/packages/apt/completions-bash-apt.patch deleted file mode 100644 index 059a63a3..00000000 --- a/packages/apt/completions-bash-apt.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -u -r ../apt-1.2/completions/bash/apt ./completions/bash/apt ---- ../apt-1.2/completions/bash/apt 2016-01-15 13:53:52.000000000 -0500 -+++ ./completions/bash/apt 2016-01-25 06:15:46.747246153 -0500 -@@ -2,7 +2,7 @@ - - _apt() - { -- local sourcesdir="/etc/apt/sources.list.d" -+ local sourcesdir="@TERMUX_PREFIX@/etc/apt/sources.list.d" - local cur prev words cword - _init_completion || return - -@@ -66,14 +66,9 @@ - if [[ -n $command ]]; then - case $command in - remove|purge|autoremove) -- if [[ -f /etc/debian_version ]]; then - # Debian system - COMPREPLY=( $( \ - _xfunc dpkg _comp_dpkg_installed_packages $cur ) ) -- else -- # assume RPM based -- _xfunc rpm _rpm_installed_packages -- fi - return 0 - ;; - show|list) diff --git a/packages/apt/configure.patch b/packages/apt/configure.patch deleted file mode 100644 index 5cf86d88..00000000 --- a/packages/apt/configure.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -u -r ../apt-1.2.12/configure ./configure ---- ../apt-1.2.12/configure 2016-05-11 10:58:04.000000000 +0200 -+++ ./configure 2017-03-03 13:31:05.373948035 +0100 -@@ -569,7 +569,7 @@ - ac_clean_files= - ac_config_libobj_dir=. - LIBOBJS= --cross_compiling=no -+cross_compiling=yes - subdirs= - MFLAGS= - MAKEFLAGS= -@@ -4611,7 +4611,7 @@ - return 0; - } - _ACEOF --if ac_fn_c_try_link "$LINENO"; then : -+if false; then : - $as_echo "#define HAVE_BDB 1" >>confdefs.h - - BDBLIB="-ldb" -@@ -5056,7 +5056,7 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking debian architecture" >&5 - $as_echo_n "checking debian architecture... " >&6; } --archset="`dpkg-architecture -qDEB_HOST_ARCH`" -+archset=TERMUX_ARCH - if test "x$archset" = "x"; then - as_fn_error $? "failed: use --host= or output from dpkg-architecture" "$LINENO" 5 - fi diff --git a/packages/apt/contrib-fileutl.cc.patch b/packages/apt/contrib-fileutl.cc.patch deleted file mode 100644 index 60464945..00000000 --- a/packages/apt/contrib-fileutl.cc.patch +++ /dev/null @@ -1,51 +0,0 @@ -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-04 07:11:09.531546721 -0500 -@@ -46,7 +46,9 @@ - #include - #include - #include -+#ifndef __ANDROID__ - #include -+#endif - #include - #include - -@@ -100,7 +102,7 @@ - _exit(100); - } - -- if (chdir("/tmp/") != 0) -+ if (chdir("@TERMUX_PREFIX@/tmp/") != 0) - _exit(100); - - unsigned int Count = 1; -@@ -2102,6 +2104,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 +2124,7 @@ - result.push_back(string(globbuf.gl_pathv[i])); - - globfree(&globbuf); -+#endif - return result; - } - /*}}}*/ -@@ -2136,10 +2140,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/debsystem-paths.patch b/packages/apt/debsystem-paths.patch deleted file mode 100644 index e10f6f61..00000000 --- a/packages/apt/debsystem-paths.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsystem.cc ./apt-pkg/deb/debsystem.cc ---- ../apt-0.9.16.1/apt-pkg/deb/debsystem.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./apt-pkg/deb/debsystem.cc 2014-03-27 13:39:56.648378401 +0100 -@@ -187,8 +187,8 @@ - which is yet to be determined. The functions in pkgcachegen should - be the only users of these */ - Cnf.CndSet("Dir::State::extended_states", "extended_states"); -- Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status"); -- Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg"); -+ Cnf.CndSet("Dir::State::status","@TERMUX_PREFIX@/var/lib/dpkg/status"); -+ Cnf.CndSet("Dir::Bin::dpkg","@TERMUX_PREFIX@/bin/dpkg"); - - if (d->StatusFile) { - delete d->StatusFile; -@@ -216,9 +216,9 @@ - signed debSystem::Score(Configuration const &Cnf) - { - signed Score = 0; -- if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true) -+ if (FileExists(Cnf.FindFile("Dir::State::status","@TERMUX_PREFIX@/var/lib/dpkg/status")) == true) - Score += 10; -- if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true) -+ if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@TERMUX_PREFIX@/bin/dpkg")) == true) - Score += 10; - if (FileExists("/etc/debian_version") == true) - Score += 10; diff --git a/packages/apt/doc-makefile.patch b/packages/apt/doc-makefile.patch deleted file mode 100644 index a0cc7191..00000000 --- a/packages/apt/doc-makefile.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -u -r ../apt-1.2.12/doc/makefile ./doc/makefile ---- ../apt-1.2.12/doc/makefile 2016-05-11 08:57:51.000000000 +0000 -+++ ./doc/makefile 2016-05-24 20:14:30.535233236 +0000 -@@ -10,7 +10,7 @@ - LC = en - include $(DOCBOOK_H) - --doc: manpages docbook -+doc: manpages - - examples/sources.list: ../vendor/current/sources.list - ln -sf '$(abspath $^)' $@ - diff --git a/packages/apt/ftp-use-socklen_t.patch b/packages/apt/ftp-use-socklen_t.patch deleted file mode 100644 index f65da48f..00000000 --- a/packages/apt/ftp-use-socklen_t.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../apt-0.9.16.1/methods/ftp.cc ./methods/ftp.cc ---- ../apt-0.9.16.1/methods/ftp.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./methods/ftp.cc 2014-03-25 01:31:05.464677254 +0100 -@@ -711,7 +711,7 @@ - if (WaitFd(DataFd,true,TimeOut) == false) - return _error->Error(_("Could not connect data socket, connection timed out")); - unsigned int Err; -- unsigned int Len = sizeof(Err); -+ socklen_t Len = sizeof(Err); - if (getsockopt(DataFd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) - return _error->Errno("getsockopt",_("Failed")); - if (Err != 0) diff --git a/disabled-packages/apt/methods-cmakelist.patch b/packages/apt/methods-cmakelist.patch similarity index 100% rename from disabled-packages/apt/methods-cmakelist.patch rename to packages/apt/methods-cmakelist.patch diff --git a/packages/apt/methods-connect.cc.patch b/packages/apt/methods-connect.cc.patch index 3275ac8c..2767a572 100644 --- a/packages/apt/methods-connect.cc.patch +++ b/packages/apt/methods-connect.cc.patch @@ -1,7 +1,6 @@ -diff -u -r ../apt-1.1.5/methods/connect.cc ./methods/connect.cc ---- ../apt-1.1.5/methods/connect.cc 2015-12-14 10:57:32.000000000 -0500 -+++ ./methods/connect.cc 2015-12-25 17:51:38.055723065 -0500 -@@ -114,7 +114,7 @@ +--- ../cache/apt-1.4.7/methods/connect.cc 2017-07-14 07:45:39.000000000 +1000 ++++ ./methods/connect.cc 2017-07-23 10:50:27.755510218 +1000 +@@ -129,7 +129,7 @@ // Check the socket for an error condition unsigned int Err; @@ -10,14 +9,15 @@ diff -u -r ../apt-1.1.5/methods/connect.cc ./methods/connect.cc if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0) return _error->Errno("getsockopt",_("Failed")); -@@ -277,7 +277,9 @@ +@@ -301,7 +301,10 @@ if(LastHost != Host || LastPort != Port) { SrvRecords.clear(); - if (_config->FindB("Acquire::EnableSrvRecords", true) == true) + /* Disable by default in Termux due to it breaking on (some) HTC + devices (https://github.com/termux/termux-packages/issues/99). */ -+ if (_config->FindB("Acquire::EnableSrvRecords", false) == true) ++ ++ if (_config->FindB("Acquire::EnableSrvRecords", false) == true) + { GetSrvRecords(Host, DefPort, SrvRecords); - } - // we have no SrvRecords for this host, connect right away + // RFC2782 defines that a lonely '.' target is an abort reason diff --git a/packages/apt/methods-makefile.patch b/packages/apt/methods-makefile.patch deleted file mode 100644 index 265d9d4c..00000000 --- a/packages/apt/methods-makefile.patch +++ /dev/null @@ -1,46 +0,0 @@ -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 20:07:25.853599149 -0500 -@@ -37,30 +37,23 @@ - SOURCE = gpgv.cc - include $(PROGRAM_H) - --# The cdrom method --PROGRAM=cdrom --SLIBS = -lapt-pkg $(INTLLIBS) --LIB_MAKES = apt-pkg/makefile --SOURCE = cdrom.cc --include $(PROGRAM_H) -- - # 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 +74,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/netrc.patch b/packages/apt/netrc.patch deleted file mode 100644 index 4c76c639..00000000 --- a/packages/apt/netrc.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/netrc.cc ./apt-pkg/contrib/netrc.cc ---- ../apt-0.9.16.1/apt-pkg/contrib/netrc.cc 2014-03-15 17:23:45.000000000 +0100 -+++ ./apt-pkg/contrib/netrc.cc 2014-03-25 01:01:34.692725662 +0100 -@@ -84,6 +84,7 @@ - int state_our_login = false; /* With specific_login, - found *our* login name */ - -+#ifndef __ANDROID__ - while (!done && getline(&netrcbuffer, &netrcbuffer_size, file) != -1) { - tok = strtok_r (netrcbuffer, " \t\n", &tok_buf); - while (!done && tok) { -@@ -142,6 +143,7 @@ - tok = strtok_r (NULL, " \t\n", &tok_buf); - } /* while(tok) */ - } /* while getline() */ -+#endif - - free(netrcbuffer); - fclose(file); diff --git a/packages/apt/test-interactive-helper-makefile-no-libpthread.patch b/packages/apt/test-interactive-helper-makefile-no-libpthread.patch deleted file mode 100644 index 5977bea5..00000000 --- a/packages/apt/test-interactive-helper-makefile-no-libpthread.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../apt-0.9.16.1/test/interactive-helper/makefile ./test/interactive-helper/makefile ---- ../apt-0.9.16.1/test/interactive-helper/makefile 2014-01-05 20:06:21.000000000 +0100 -+++ ./test/interactive-helper/makefile 2014-03-25 01:33:54.600672630 +0100 -@@ -41,7 +41,7 @@ - - # Program for testing udevcdrom - PROGRAM=aptwebserver --SLIBS = -lapt-pkg -lpthread -+SLIBS = -lapt-pkg - LIB_MAKES = apt-pkg/makefile - SOURCE = aptwebserver.cc - include $(PROGRAM_H) -- 2.11.0