diff options
Diffstat (limited to 'meta/recipes-devtools/apt')
11 files changed, 363 insertions, 191 deletions
diff --git a/meta/recipes-devtools/apt/apt/0001-Disable-documentation-directory-altogether.patch b/meta/recipes-devtools/apt/apt/0001-Disable-documentation-directory-altogether.patch index cc422b74dc..5443ff6caa 100644 --- a/meta/recipes-devtools/apt/apt/0001-Disable-documentation-directory-altogether.patch +++ b/meta/recipes-devtools/apt/apt/0001-Disable-documentation-directory-altogether.patch @@ -1,4 +1,4 @@ -From cd164b353ba7958d51b2f33f4079fb9787c983e2 Mon Sep 17 00:00:00 2001 +From f629d1c3fcfb560ed24efc3e73d4e4999b1eab33 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 10 May 2019 14:16:47 +0200 Subject: [PATCH] Disable documentation directory altogether @@ -13,11 +13,11 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 83334ba..2cd4f8e 100644 +index 668e2d762..62f441bfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -232,7 +232,7 @@ add_subdirectory(apt-private) - add_subdirectory(apt-inst) +@@ -246,7 +246,7 @@ add_subdirectory(apt-private) + endif() add_subdirectory(cmdline) add_subdirectory(completions) -add_subdirectory(doc) diff --git a/meta/recipes-devtools/apt/apt/0001-Do-not-configure-packages-on-installation.patch b/meta/recipes-devtools/apt/apt/0001-Do-not-configure-packages-on-installation.patch deleted file mode 100644 index 2322bd8e78..0000000000 --- a/meta/recipes-devtools/apt/apt/0001-Do-not-configure-packages-on-installation.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 1ad21140787a6b8b0f774f75b50444d2c30a56f6 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 21 May 2020 20:28:12 +0000 -Subject: [PATCH] Do not configure packages on installation - -This is done separately in do_rootfs(). - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - apt-pkg/packagemanager.cc | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc -index 156f7ad..0f6a87c 100644 ---- a/apt-pkg/packagemanager.cc -+++ b/apt-pkg/packagemanager.cc -@@ -1013,10 +1013,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c - return false; - - if (Immediate == true) { -+#if 0 - // Perform immediate configuration of the package. - if (SmartConfigure(Pkg, Depth + 1) == false) - _error->Error(_("Could not perform immediate configuration on '%s'. " - "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2); -+#endif - } - - return true; -@@ -1111,6 +1113,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() - } - } - -+#if 0 - // Final run through the configure phase - if (ConfigureAll() == false) - return Failed; -@@ -1125,7 +1128,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() - return Failed; - } - } -- -+#endif - return Completed; - } - // PM::DoInstallPostFork - compat /*{{{*/ diff --git a/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch b/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch index d3d3ab026d..37a3133010 100644 --- a/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch +++ b/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch @@ -1,4 +1,4 @@ -From b18d7aa7d71b53b86bac21cd1d8c3accabb28f2b Mon Sep 17 00:00:00 2001 +From b84280fec4e1d0d33eca78e76556023f8f8fe5b7 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 10 May 2019 16:47:38 +0200 Subject: [PATCH] Do not init tables from dpkg configuration @@ -13,7 +13,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc -index a619368..6e5a6cf 100644 +index b9d9b15d2..1725c5966 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -281,8 +281,8 @@ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys) diff --git a/meta/recipes-devtools/apt/apt/0001-Fix-musl-build.patch b/meta/recipes-devtools/apt/apt/0001-Fix-musl-build.patch index a6e8ef1e51..0cefbedd6d 100644 --- a/meta/recipes-devtools/apt/apt/0001-Fix-musl-build.patch +++ b/meta/recipes-devtools/apt/apt/0001-Fix-musl-build.patch @@ -1,22 +1,18 @@ -From 081c6be2f2f1cd77f399ea414f8d89c107826624 Mon Sep 17 00:00:00 2001 +From 6b8547161b902b01b639d05a4cdf849d7694556f Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Fri, 22 May 2020 15:29:23 +0000 -Subject: [PATCH] Fix musl build +Subject: [PATCH] apt-pkg/contrib/srvrec.h: Explicitly include sys/types.h -methods/connect.cc: Musl doesn't support AI_IDN flag in netdb.h -header so define it manually. -apt-pkg/contrib/srvrec.h: Add explicity include of sys/types.h -to avoid errors in types u_int_SIZE. +This avoids type errors with musl C library. -Upstream-Status: Pending +Upstream-Status: Submitted [https://salsa.debian.org/apt-team/apt/-/merge_requests/200] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- apt-pkg/contrib/srvrec.h | 1 + - methods/connect.cc | 5 +++++ - 2 files changed, 6 insertions(+) + 1 file changed, 1 insertion(+) diff --git a/apt-pkg/contrib/srvrec.h b/apt-pkg/contrib/srvrec.h -index e22b7a1..b1115f5 100644 +index e5d0f43..2010184 100644 --- a/apt-pkg/contrib/srvrec.h +++ b/apt-pkg/contrib/srvrec.h @@ -9,6 +9,7 @@ @@ -27,19 +23,6 @@ index e22b7a1..b1115f5 100644 #include <string> #include <vector> #include <arpa/nameser.h> -diff --git a/methods/connect.cc b/methods/connect.cc -index 1d6f891..122df35 100644 ---- a/methods/connect.cc -+++ b/methods/connect.cc -@@ -42,6 +42,11 @@ - #include "connect.h" - #include "rfc2553emu.h" - #include <apti18n.h> -+ -+#ifndef AI_IDN -+#define AI_IDN 0x0040 -+#endif -+ - /*}}}*/ - - static std::string LastHost; +-- +2.20.1 + diff --git a/meta/recipes-devtools/apt/apt/0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch b/meta/recipes-devtools/apt/apt/0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch new file mode 100644 index 0000000000..f1816836b5 --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch @@ -0,0 +1,48 @@ +From e849b161ce1d87ab369b921438abcf5b3a03e186 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 25 Apr 2021 08:57:03 -0700 +Subject: [PATCH] Hide fstatat64 and prlimit64 defines on musl + +musl defines fstatat64 and prlimit64 as macros which confuses the +seccomp sysall rewiring since there are syscalls with same names + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + methods/aptmethod.h | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/methods/aptmethod.h b/methods/aptmethod.h +index bd50e80..3085aed 100644 +--- a/methods/aptmethod.h ++++ b/methods/aptmethod.h +@@ -121,6 +121,12 @@ protected: + if (ctx == NULL) + return _error->FatalE("HttpMethod::Configuration", "Cannot init seccomp"); + ++#ifndef __GLIBC__ ++#pragma push_macro("fstatat64") ++#pragma push_macro("prlimit64") ++#undef fstatat64 ++#undef prlimit64 ++#endif + #define ALLOW(what) \ + if ((rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(what), 0))) \ + return _error->FatalE("HttpMethod::Configuration", "Cannot allow %s: %s", #what, strerror(-rc)); +@@ -320,9 +326,11 @@ protected: + if ((rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, seccomp_syscall_resolve_name(custom.c_str()), 0))) + return _error->FatalE("aptMethod::Configuration", "Cannot allow %s: %s", custom.c_str(), strerror(-rc)); + } +- + #undef ALLOW +- ++#ifndef __GLIBC__ ++#pragma pop_macro("fstatat64") ++#pragma pop_macro("prlimit64") ++#endif + rc = seccomp_load(ctx); + if (rc == -EINVAL) + { +-- +2.31.1 + diff --git a/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch b/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch new file mode 100644 index 0000000000..15b036b90d --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch @@ -0,0 +1,87 @@ +From e91fb0618ce0a5d42f239d0fca602544858f0819 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 16 Aug 2022 08:44:18 -0700 +Subject: [PATCH] Remove using std::binary_function + +std::binary_function and std::unary_function are deprecated since c++11 +and removed in c++17, therefore remove it and use lambda functions to get same +functionality implemented. + +Upstream-Status: Submitted [https://salsa.debian.org/apt-team/apt/-/merge_requests/253] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + ftparchive/apt-ftparchive.cc | 33 ++++++++++----------------------- + 1 file changed, 10 insertions(+), 23 deletions(-) + +diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc +index 0f6587281..0a253b12b 100644 +--- a/ftparchive/apt-ftparchive.cc ++++ b/ftparchive/apt-ftparchive.cc +@@ -48,6 +48,11 @@ + using namespace std; + unsigned Quiet = 0; + ++auto ContentsCompare = [](const auto &a, const auto &b) { return a.ContentsMTime < b.ContentsMTime; }; ++auto DBCompare = [](const auto &a, const auto &b) { return a.BinCacheDB < b.BinCacheDB; }; ++auto SrcDBCompare = [](const auto &a, const auto &b) { return a.SrcCacheDB < b.SrcCacheDB; }; ++ ++ + static struct timeval GetTimevalFromSteadyClock() /*{{{*/ + { + auto const Time = std::chrono::steady_clock::now().time_since_epoch(); +@@ -116,24 +121,6 @@ struct PackageMap + bool SrcDone; + time_t ContentsMTime; + +- struct ContentsCompare +- { +- inline bool operator() (const PackageMap &x,const PackageMap &y) +- {return x.ContentsMTime < y.ContentsMTime;}; +- }; +- +- struct DBCompare +- { +- inline bool operator() (const PackageMap &x,const PackageMap &y) +- {return x.BinCacheDB < y.BinCacheDB;}; +- }; +- +- struct SrcDBCompare +- { +- inline bool operator() (const PackageMap &x,const PackageMap &y) +- {return x.SrcCacheDB < y.SrcCacheDB;}; +- }; +- + void GetGeneral(Configuration &Setup,Configuration &Block); + bool GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats); + bool GenSources(Configuration &Setup,struct CacheDB::Stats &Stats); +@@ -869,7 +856,7 @@ static bool DoGenerateContents(Configuration &Setup, + else + I->ContentsMTime = A.st_mtime; + } +- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::ContentsCompare()); ++ stable_sort(PkgList.begin(),PkgList.end(),ContentsCompare); + + /* Now for Contents.. The process here is to do a make-like dependency + check. Each contents file is verified to be newer than the package files +@@ -941,8 +928,8 @@ static bool Generate(CommandLine &CmdL) + LoadBinDir(PkgList,Setup); + + // Sort by cache DB to improve IO locality. +- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare()); +- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare()); ++ stable_sort(PkgList.begin(),PkgList.end(),DBCompare); ++ stable_sort(PkgList.begin(),PkgList.end(),SrcDBCompare); + + // Generate packages + if (_config->FindB("APT::FTPArchive::ContentsOnly", false) == false) +@@ -993,8 +980,8 @@ static bool Clean(CommandLine &CmdL) + LoadBinDir(PkgList,Setup); + + // Sort by cache DB to improve IO locality. +- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare()); +- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare()); ++ stable_sort(PkgList.begin(),PkgList.end(),DBCompare); ++ stable_sort(PkgList.begin(),PkgList.end(),SrcDBCompare); + + string CacheDir = Setup.FindDir("Dir::CacheDir"); + diff --git a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch index 8c4cc04503..6f4d5b6e72 100644 --- a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch +++ b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch @@ -1,4 +1,4 @@ -From 742fbb243f99e940c3e6b31296f7f416f550a57a Mon Sep 17 00:00:00 2001 +From a2dd661484536492b47d4c88998f2bf516749bc8 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Thu, 21 May 2020 20:13:25 +0000 Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our @@ -20,10 +20,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc -index ffa880d..5875e86 100644 +index 93effa959..4375781d1 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc -@@ -1215,12 +1215,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() +@@ -1199,12 +1199,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() } } } @@ -35,8 +35,8 @@ index ffa880d..5875e86 100644 - ++PackagesTotal; } /*}}}*/ - bool pkgDPkgPM::Go(int StatusFd) /*{{{*/ -@@ -1716,7 +1710,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) + void pkgDPkgPM::StartPtyMagic() /*{{{*/ +@@ -1741,7 +1735,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) // support subpressing of triggers processing for special // cases like d-i that runs the triggers handling manually diff --git a/meta/recipes-devtools/apt/apt/0001-aptwebserver.cc-Include-array.patch b/meta/recipes-devtools/apt/apt/0001-aptwebserver.cc-Include-array.patch new file mode 100644 index 0000000000..2c1e617e55 --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-aptwebserver.cc-Include-array.patch @@ -0,0 +1,30 @@ +From 5985f366750a73c81c7d86893a2b959b4af062a5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 26 May 2021 22:12:46 -0700 +Subject: [PATCH] aptwebserver.cc: Include <array> + +This helps getting std::array definition + +Fixes +test/interactive-helper/aptwebserver.cc:36:55: error: constexpr variable cannot have non-literal type 'const std::array<std::array<const char *, 2>, 6>' + constexpr std::array<std::array<char const *,2>,6> htmlencode = {{ + +Upstream-Status: Submitted [https://github.com/Debian/apt/pull/133] +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + test/interactive-helper/aptwebserver.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc +index f4f8d95..361c7a9 100644 +--- a/test/interactive-helper/aptwebserver.cc ++++ b/test/interactive-helper/aptwebserver.cc +@@ -23,6 +23,7 @@ + + #include <array> + #include <algorithm> ++#include <array> + #include <fstream> + #include <iostream> + #include <list> diff --git a/meta/recipes-devtools/apt/apt/0001-cmake-Do-not-build-po-files.patch b/meta/recipes-devtools/apt/apt/0001-cmake-Do-not-build-po-files.patch new file mode 100644 index 0000000000..036ce35963 --- /dev/null +++ b/meta/recipes-devtools/apt/apt/0001-cmake-Do-not-build-po-files.patch @@ -0,0 +1,36 @@ +From 33347f9f8301633b01af4e208b7be5fdfcb0df0c Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 20 Mar 2021 14:45:18 -0700 +Subject: [PATCH] cmake: Do not build po files + +Fixes +| CMake Error at CMakeLists.txt:252 (add_dependencies): +| The dependency target "update-po4a" of target "update-po" does not exist. +| + +Upstream-Status: Inappropriate [Cross-compile specific] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + CMakeLists.txt | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be157a55f..54163ae6c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -252,15 +252,6 @@ add_subdirectory(ftparchive) + add_subdirectory(methods) + add_subdirectory(test) + +-if (USE_NLS) +-add_subdirectory(po) +-endif() +- +-if(TARGET update-po AND TARGET update-po4a) +-# Link update-po4a into the update-po target +-add_dependencies(update-po update-po4a) +-endif() +- + # Create our directories. + install_empty_directories( + ${CONF_DIR}/apt.conf.d diff --git a/meta/recipes-devtools/apt/apt_1.8.2.1.bb b/meta/recipes-devtools/apt/apt_1.8.2.1.bb deleted file mode 100644 index bd1f4f39c3..0000000000 --- a/meta/recipes-devtools/apt/apt_1.8.2.1.bb +++ /dev/null @@ -1,106 +0,0 @@ -SUMMARY = "Advanced front-end for dpkg" -LICENSE = "GPLv2.0+" -SECTION = "base" - -# Triehash script taken from https://github.com/julian-klode/triehash -SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ - file://triehash \ - file://0001-Disable-documentation-directory-altogether.patch \ - file://0001-Fix-musl-build.patch \ - file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \ - " - -SRC_URI_append_class-native = " \ - file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ - file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ - file://0001-Do-not-configure-packages-on-installation.patch \ - " - -SRC_URI[sha256sum] = "6d447f2e9437ec24e78350b63bb0592bee1f050811d51990b0c783183b0983f8" -LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -# the package is taken from snapshots.debian.org; that source is static and goes stale -# so we check the latest upstream from a directory that does get updated -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" - -inherit cmake perlnative bash-completion upstream-version-is-even - -BBCLASSEXTEND = "native" - -DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz" - -EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash" - -do_configure_prepend () { - echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake - -} - -# Unfortunately apt hardcodes this all over the place -FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" -RDEPENDS_${PN} += "bash perl dpkg" - -do_install_append_class-native() { - cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF -Dir "${STAGING_DIR_NATIVE}/" -{ - State "var/lib/apt/" - { - Lists "#APTCONF#/lists/"; - status "#ROOTFS#/var/lib/dpkg/status"; - }; - Cache "var/cache/apt/" - { - Archives "archives/"; - pkgcache ""; - srcpkgcache ""; - }; - Bin "${STAGING_BINDIR_NATIVE}/" - { - methods "${STAGING_LIBDIR}/apt/methods/"; - gzip "/bin/gzip"; - dpkg "dpkg"; - dpkg-source "dpkg-source"; - dpkg-buildpackage "dpkg-buildpackage"; - apt-get "apt-get"; - apt-cache "apt-cache"; - }; - Etc "#APTCONF#" - { - Preferences "preferences"; - }; - Log "var/log/apt"; -}; - -APT -{ - Install-Recommends "true"; - Immediate-Configure "false"; - Architecture "i586"; - Get - { - Assume-Yes "true"; - }; -}; - -Acquire -{ - AllowInsecureRepositories "true"; -}; - -DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; -DPkg::Path ""; -EOF -} - -do_install_append_class-target() { - #Write the correct apt-architecture to apt.conf - APT_CONF=${D}/etc/apt/apt.conf - echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} -} - -# Avoid non-reproducible -src package -do_install_append () { - sed -i -e "s,${B},,g" \ - ${B}/apt-pkg/tagfile-keys.cc -} diff --git a/meta/recipes-devtools/apt/apt_2.6.1.bb b/meta/recipes-devtools/apt/apt_2.6.1.bb new file mode 100644 index 0000000000..68bd7c5407 --- /dev/null +++ b/meta/recipes-devtools/apt/apt_2.6.1.bb @@ -0,0 +1,142 @@ +SUMMARY = "Advanced front-end for dpkg" +DESCRIPTION = "APT is the Advanced Package Tool, an advanced interface to the Debian packaging system which provides the apt-get program." +HOMEPAGE = "https://packages.debian.org/sid/apt" +LICENSE = "GPL-2.0-or-later" +SECTION = "base" + +# Triehash script taken from https://github.com/julian-klode/triehash +SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ + file://triehash \ + file://0001-Disable-documentation-directory-altogether.patch \ + file://0001-Fix-musl-build.patch \ + file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \ + file://0001-cmake-Do-not-build-po-files.patch \ + file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ + file://0001-aptwebserver.cc-Include-array.patch \ + file://0001-Remove-using-std-binary_function.patch \ + " + +SRC_URI:append:class-native = " \ + file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ + file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ + " + +SRC_URI:append:class-nativesdk = " \ + file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ + file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ + " + +SRC_URI[sha256sum] = "86b888c901fa2e78f1bf52a2aaa2f400ff82a472b94ff0ac6631939ee68fa6fd" +LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# the package is taken from snapshots.debian.org; that source is static and goes stale +# so we check the latest upstream from a directory that does get updated +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" +# apt seems to follow a peculiar version policy, where every *other* even version +# is considered stable, e.g. 1.0, 1.4, 1.8, 2.2, 2.6, etc. As there is no way +# to express 'divisible by 4 plus 2' in regex (that I know of), let's hardcode a few. +UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>((2\.2)|(2\.6)|(3\.0)|(3\.4)|(3\.8)|(4\.2))(\.\d+)+)\.tar" + +inherit cmake perlnative bash-completion useradd + +# User is added to allow apt to drop privs, will runtime warn without +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "--system --home /nonexistent --no-create-home _apt" + +BBCLASSEXTEND = "native nativesdk" + +DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash" + +EXTRA_OECMAKE:append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \ + -DDPKG_DATADIR=${datadir}/dpkg \ + -DTRIEHASH_EXECUTABLE=${UNPACKDIR}/triehash \ + -DCMAKE_DISABLE_FIND_PACKAGE_ZSTD=True \ + -DCMAKE_DISABLE_FIND_PACKAGE_SECCOMP=True \ + -DWITH_TESTS=False \ +" + +do_configure:prepend() { + echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake +} + +# Unfortunately apt hardcodes this all over the place +FILES:${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" +RDEPENDS:${PN} += "bash perl dpkg" + +customize_apt_conf_sample() { + cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF +Dir "${STAGING_DIR_NATIVE}/" +{ + State "var/lib/apt/" + { + Lists "#APTCONF#/lists/"; + status "#ROOTFS#/var/lib/dpkg/status"; + }; + Cache "var/cache/apt/" + { + Archives "archives/"; + pkgcache ""; + srcpkgcache ""; + }; + Bin "${STAGING_BINDIR_NATIVE}/" + { + methods "${STAGING_LIBDIR}/apt/methods/"; + gzip "/bin/gzip"; + dpkg "dpkg"; + dpkg-source "dpkg-source"; + dpkg-buildpackage "dpkg-buildpackage"; + apt-get "apt-get"; + apt-cache "apt-cache"; + }; + Etc "#APTCONF#" + { + Preferences "preferences"; + }; + Log "var/log/apt"; +}; + +APT +{ + Install-Recommends "true"; + Immediate-Configure "false"; + Architecture "i586"; + Get + { + Assume-Yes "true"; + }; +}; + +Acquire +{ + AllowInsecureRepositories "true"; +}; + +DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; +DPkg::Path ""; +EOF +} + +do_install:append:class-native() { + customize_apt_conf_sample +} + +do_install:append:class-nativesdk() { + customize_apt_conf_sample + rm -rf ${D}${localstatedir}/log +} + +do_install:append:class-target() { + # Write the correct apt-architecture to apt.conf + APT_CONF=${D}${sysconfdir}/apt/apt.conf + echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} + + # Remove /var/log/apt. /var/log is normally a link to /var/volatile/log + # and /var/volatile is a tmpfs mount. So anything created in /var/log + # will not be available when the tmpfs is mounted. + rm -rf ${D}${localstatedir}/log +} + +do_install:append() { + # Avoid non-reproducible -src package + sed -i -e "s,${B}/include/,,g" ${B}/apt-pkg/tagfile-keys.cc +} |