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