Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 1 | SUMMARY = "Advanced front-end for dpkg" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame^] | 2 | DESCRIPTION = "APT is the Advanced Package Tool, an advanced interface to the Debian packaging system which provides the apt-get program." |
| 3 | HOMEPAGE = "https://packages.debian.org/jessie/apt" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 4 | LICENSE = "GPLv2.0+" |
| 5 | SECTION = "base" |
| 6 | |
| 7 | # Triehash script taken from https://github.com/julian-klode/triehash |
| 8 | SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ |
| 9 | file://triehash \ |
| 10 | file://0001-Disable-documentation-directory-altogether.patch \ |
| 11 | file://0001-Fix-musl-build.patch \ |
| 12 | file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 13 | file://0001-test-libapt-do-not-use-gtest-from-the-host.patch \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 14 | " |
| 15 | |
| 16 | SRC_URI_append_class-native = " \ |
| 17 | file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ |
| 18 | file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ |
| 19 | file://0001-Do-not-configure-packages-on-installation.patch \ |
| 20 | " |
| 21 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 22 | SRC_URI_append_class-nativesdk = " \ |
| 23 | file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ |
| 24 | file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ |
| 25 | file://0001-Do-not-configure-packages-on-installation.patch \ |
| 26 | " |
| 27 | |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame^] | 28 | SRC_URI[sha256sum] = "f5030de22a5cc80db6fe0d42373b5df25d7dc56e94d9155f2eaa80dbd65e82fa" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 29 | LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 30 | |
| 31 | # the package is taken from snapshots.debian.org; that source is static and goes stale |
| 32 | # so we check the latest upstream from a directory that does get updated |
| 33 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" |
| 34 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 35 | inherit cmake perlnative bash-completion upstream-version-is-even useradd |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 36 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 37 | # User is added to allow apt to drop privs, will runtime warn without |
| 38 | USERADD_PACKAGES = "${PN}" |
| 39 | USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt" |
| 40 | |
| 41 | BBCLASSEXTEND = "native nativesdk" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 42 | |
| 43 | DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz" |
| 44 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 45 | EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \ |
| 46 | -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg \ |
| 47 | -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \ |
| 48 | -DCMAKE_DISABLE_FIND_PACKAGE_Zstd=True \ |
| 49 | " |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 50 | |
| 51 | do_configure_prepend () { |
| 52 | echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake |
| 53 | |
| 54 | } |
| 55 | |
| 56 | # Unfortunately apt hardcodes this all over the place |
| 57 | FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" |
| 58 | RDEPENDS_${PN} += "bash perl dpkg" |
| 59 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 60 | customize_apt_conf_sample() { |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 61 | cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF |
| 62 | Dir "${STAGING_DIR_NATIVE}/" |
| 63 | { |
| 64 | State "var/lib/apt/" |
| 65 | { |
| 66 | Lists "#APTCONF#/lists/"; |
| 67 | status "#ROOTFS#/var/lib/dpkg/status"; |
| 68 | }; |
| 69 | Cache "var/cache/apt/" |
| 70 | { |
| 71 | Archives "archives/"; |
| 72 | pkgcache ""; |
| 73 | srcpkgcache ""; |
| 74 | }; |
| 75 | Bin "${STAGING_BINDIR_NATIVE}/" |
| 76 | { |
| 77 | methods "${STAGING_LIBDIR}/apt/methods/"; |
| 78 | gzip "/bin/gzip"; |
| 79 | dpkg "dpkg"; |
| 80 | dpkg-source "dpkg-source"; |
| 81 | dpkg-buildpackage "dpkg-buildpackage"; |
| 82 | apt-get "apt-get"; |
| 83 | apt-cache "apt-cache"; |
| 84 | }; |
| 85 | Etc "#APTCONF#" |
| 86 | { |
| 87 | Preferences "preferences"; |
| 88 | }; |
| 89 | Log "var/log/apt"; |
| 90 | }; |
| 91 | |
| 92 | APT |
| 93 | { |
| 94 | Install-Recommends "true"; |
| 95 | Immediate-Configure "false"; |
| 96 | Architecture "i586"; |
| 97 | Get |
| 98 | { |
| 99 | Assume-Yes "true"; |
| 100 | }; |
| 101 | }; |
| 102 | |
| 103 | Acquire |
| 104 | { |
| 105 | AllowInsecureRepositories "true"; |
| 106 | }; |
| 107 | |
| 108 | DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; |
| 109 | DPkg::Path ""; |
| 110 | EOF |
| 111 | } |
| 112 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 113 | do_install_append_class-native() { |
| 114 | customize_apt_conf_sample |
| 115 | } |
| 116 | |
| 117 | do_install_append_class-nativesdk() { |
| 118 | customize_apt_conf_sample |
| 119 | } |
| 120 | |
| 121 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 122 | do_install_append_class-target() { |
| 123 | #Write the correct apt-architecture to apt.conf |
| 124 | APT_CONF=${D}/etc/apt/apt.conf |
| 125 | echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} |
| 126 | } |
| 127 | |
| 128 | # Avoid non-reproducible -src package |
| 129 | do_install_append () { |
| 130 | sed -i -e "s,${B},,g" \ |
| 131 | ${B}/apt-pkg/tagfile-keys.cc |
| 132 | } |