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