apt_1.8.2.1.bb 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. SUMMARY = "Advanced front-end for dpkg"
  2. LICENSE = "GPLv2.0+"
  3. SECTION = "base"
  4. # Triehash script taken from https://github.com/julian-klode/triehash
  5. SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
  6. file://triehash \
  7. file://0001-Disable-documentation-directory-altogether.patch \
  8. file://0001-Fix-musl-build.patch \
  9. file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \
  10. file://0001-test-libapt-do-not-use-gtest-from-the-host.patch \
  11. "
  12. SRC_URI_append_class-native = " \
  13. file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
  14. file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
  15. file://0001-Do-not-configure-packages-on-installation.patch \
  16. "
  17. SRC_URI[sha256sum] = "6d447f2e9437ec24e78350b63bb0592bee1f050811d51990b0c783183b0983f8"
  18. LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
  19. # the package is taken from snapshots.debian.org; that source is static and goes stale
  20. # so we check the latest upstream from a directory that does get updated
  21. UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
  22. inherit cmake perlnative bash-completion upstream-version-is-even useradd
  23. BBCLASSEXTEND = "native"
  24. DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz"
  25. EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash"
  26. do_configure_prepend () {
  27. echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake
  28. }
  29. USERADD_PACKAGES = "${PN}"
  30. USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home --shell /bin/false --user-group _apt"
  31. # Unfortunately apt hardcodes this all over the place
  32. FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
  33. RDEPENDS_${PN} += "bash perl dpkg"
  34. do_install_append_class-native() {
  35. cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
  36. Dir "${STAGING_DIR_NATIVE}/"
  37. {
  38. State "var/lib/apt/"
  39. {
  40. Lists "#APTCONF#/lists/";
  41. status "#ROOTFS#/var/lib/dpkg/status";
  42. };
  43. Cache "var/cache/apt/"
  44. {
  45. Archives "archives/";
  46. pkgcache "";
  47. srcpkgcache "";
  48. };
  49. Bin "${STAGING_BINDIR_NATIVE}/"
  50. {
  51. methods "${STAGING_LIBDIR}/apt/methods/";
  52. gzip "/bin/gzip";
  53. dpkg "dpkg";
  54. dpkg-source "dpkg-source";
  55. dpkg-buildpackage "dpkg-buildpackage";
  56. apt-get "apt-get";
  57. apt-cache "apt-cache";
  58. };
  59. Etc "#APTCONF#"
  60. {
  61. Preferences "preferences";
  62. };
  63. Log "var/log/apt";
  64. };
  65. APT
  66. {
  67. Install-Recommends "true";
  68. Immediate-Configure "false";
  69. Architecture "i586";
  70. Get
  71. {
  72. Assume-Yes "true";
  73. };
  74. };
  75. Acquire
  76. {
  77. AllowInsecureRepositories "true";
  78. };
  79. DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
  80. DPkg::Path "";
  81. EOF
  82. }
  83. do_install_append_class-target() {
  84. #Write the correct apt-architecture to apt.conf
  85. APT_CONF=${D}/etc/apt/apt.conf
  86. echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
  87. }
  88. # Avoid non-reproducible -src package
  89. do_install_append () {
  90. sed -i -e "s,${B},,g" \
  91. ${B}/apt-pkg/tagfile-keys.cc
  92. }