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 | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 13 | file://0001-srvrec-Keep-support-for-older-resolver.patch \ |
| 14 | file://0001-cmake-Do-not-build-po-files.patch \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 15 | " |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 16 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 17 | SRC_URI_append_class-native = " \ |
| 18 | file://0001-Do-not-init-tables-from-dpkg-configuration.patch \ |
| 19 | file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 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 \ |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 25 | " |
| 26 | |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 27 | SRC_URI[sha256sum] = "c5449a4c2126a12497a9949cd10209926005d329f6ce7942a3781fa2fcf50487" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 28 | LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 29 | |
| 30 | # the package is taken from snapshots.debian.org; that source is static and goes stale |
| 31 | # so we check the latest upstream from a directory that does get updated |
| 32 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" |
| 33 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 34 | inherit cmake perlnative bash-completion upstream-version-is-even useradd |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 35 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 36 | # User is added to allow apt to drop privs, will runtime warn without |
| 37 | USERADD_PACKAGES = "${PN}" |
| 38 | USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt" |
| 39 | |
| 40 | BBCLASSEXTEND = "native nativesdk" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 41 | |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 42 | DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 43 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 44 | EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 45 | -DDPKG_DATADIR=${datadir}/dpkg \ |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 46 | -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 47 | -DWITH_TESTS=False \ |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 48 | " |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 49 | |
| 50 | do_configure_prepend () { |
| 51 | echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake |
| 52 | |
| 53 | } |
| 54 | |
| 55 | # Unfortunately apt hardcodes this all over the place |
| 56 | FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" |
| 57 | RDEPENDS_${PN} += "bash perl dpkg" |
| 58 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 59 | customize_apt_conf_sample() { |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 60 | cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF |
| 61 | Dir "${STAGING_DIR_NATIVE}/" |
| 62 | { |
| 63 | State "var/lib/apt/" |
| 64 | { |
| 65 | Lists "#APTCONF#/lists/"; |
| 66 | status "#ROOTFS#/var/lib/dpkg/status"; |
| 67 | }; |
| 68 | Cache "var/cache/apt/" |
| 69 | { |
| 70 | Archives "archives/"; |
| 71 | pkgcache ""; |
| 72 | srcpkgcache ""; |
| 73 | }; |
| 74 | Bin "${STAGING_BINDIR_NATIVE}/" |
| 75 | { |
| 76 | methods "${STAGING_LIBDIR}/apt/methods/"; |
| 77 | gzip "/bin/gzip"; |
| 78 | dpkg "dpkg"; |
| 79 | dpkg-source "dpkg-source"; |
| 80 | dpkg-buildpackage "dpkg-buildpackage"; |
| 81 | apt-get "apt-get"; |
| 82 | apt-cache "apt-cache"; |
| 83 | }; |
| 84 | Etc "#APTCONF#" |
| 85 | { |
| 86 | Preferences "preferences"; |
| 87 | }; |
| 88 | Log "var/log/apt"; |
| 89 | }; |
| 90 | |
| 91 | APT |
| 92 | { |
| 93 | Install-Recommends "true"; |
| 94 | Immediate-Configure "false"; |
| 95 | Architecture "i586"; |
| 96 | Get |
| 97 | { |
| 98 | Assume-Yes "true"; |
| 99 | }; |
| 100 | }; |
| 101 | |
| 102 | Acquire |
| 103 | { |
| 104 | AllowInsecureRepositories "true"; |
| 105 | }; |
| 106 | |
| 107 | DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; |
| 108 | DPkg::Path ""; |
| 109 | EOF |
| 110 | } |
| 111 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 112 | do_install_append_class-native() { |
| 113 | customize_apt_conf_sample |
| 114 | } |
| 115 | |
| 116 | do_install_append_class-nativesdk() { |
| 117 | customize_apt_conf_sample |
| 118 | } |
| 119 | |
| 120 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 121 | do_install_append_class-target() { |
| 122 | #Write the correct apt-architecture to apt.conf |
| 123 | APT_CONF=${D}/etc/apt/apt.conf |
| 124 | echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} |
| 125 | } |
| 126 | |
| 127 | # Avoid non-reproducible -src package |
| 128 | do_install_append () { |
| 129 | sed -i -e "s,${B},,g" \ |
| 130 | ${B}/apt-pkg/tagfile-keys.cc |
| 131 | } |