blob: 192aec46bfd9b83f3072595d4607ac50e4e87e60 [file] [log] [blame]
Andrew Geissler4ed12e12020-06-05 18:00:41 -05001SUMMARY = "Advanced front-end for dpkg"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "APT is the Advanced Package Tool, an advanced interface to the Debian packaging system which provides the apt-get program."
3HOMEPAGE = "https://packages.debian.org/jessie/apt"
Andrew Geissler4ed12e12020-06-05 18:00:41 -05004LICENSE = "GPLv2.0+"
5SECTION = "base"
6
7# Triehash script taken from https://github.com/julian-klode/triehash
8SRC_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 Geissler95ac1b82021-03-31 14:34:31 -050013 file://0001-srvrec-Keep-support-for-older-resolver.patch \
14 file://0001-cmake-Do-not-build-po-files.patch \
Andrew Geisslerc926e172021-05-07 16:11:35 -050015 file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050016 "
Andrew Geissler95ac1b82021-03-31 14:34:31 -050017
Andrew Geissler4ed12e12020-06-05 18:00:41 -050018SRC_URI_append_class-native = " \
19 file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
20 file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050021 "
22
Andrew Geisslerd1e89492021-02-12 15:35:20 -060023SRC_URI_append_class-nativesdk = " \
24 file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
25 file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060026 "
27
Andrew Geissler95ac1b82021-03-31 14:34:31 -050028SRC_URI[sha256sum] = "c5449a4c2126a12497a9949cd10209926005d329f6ce7942a3781fa2fcf50487"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050029LIC_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
33UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
34
Andrew Geisslerd1e89492021-02-12 15:35:20 -060035inherit cmake perlnative bash-completion upstream-version-is-even useradd
Andrew Geissler4ed12e12020-06-05 18:00:41 -050036
Andrew Geisslerd1e89492021-02-12 15:35:20 -060037# User is added to allow apt to drop privs, will runtime warn without
38USERADD_PACKAGES = "${PN}"
39USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
40
41BBCLASSEXTEND = "native nativesdk"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050042
Andrew Geissler95ac1b82021-03-31 14:34:31 -050043DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050044
Andrew Geisslerd1e89492021-02-12 15:35:20 -060045EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050046 -DDPKG_DATADIR=${datadir}/dpkg \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060047 -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050048 -DCMAKE_DISABLE_FIND_PACKAGE_ZSTD=True \
Andrew Geisslerc926e172021-05-07 16:11:35 -050049 -DCMAKE_DISABLE_FIND_PACKAGE_SECCOMP=True \
Andrew Geissler95ac1b82021-03-31 14:34:31 -050050 -DWITH_TESTS=False \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060051"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050052
53do_configure_prepend () {
54 echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake
55
56}
57
58# Unfortunately apt hardcodes this all over the place
59FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
60RDEPENDS_${PN} += "bash perl dpkg"
61
Andrew Geisslerd1e89492021-02-12 15:35:20 -060062customize_apt_conf_sample() {
Andrew Geissler4ed12e12020-06-05 18:00:41 -050063 cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
64Dir "${STAGING_DIR_NATIVE}/"
65{
66 State "var/lib/apt/"
67 {
68 Lists "#APTCONF#/lists/";
69 status "#ROOTFS#/var/lib/dpkg/status";
70 };
71 Cache "var/cache/apt/"
72 {
73 Archives "archives/";
74 pkgcache "";
75 srcpkgcache "";
76 };
77 Bin "${STAGING_BINDIR_NATIVE}/"
78 {
79 methods "${STAGING_LIBDIR}/apt/methods/";
80 gzip "/bin/gzip";
81 dpkg "dpkg";
82 dpkg-source "dpkg-source";
83 dpkg-buildpackage "dpkg-buildpackage";
84 apt-get "apt-get";
85 apt-cache "apt-cache";
86 };
87 Etc "#APTCONF#"
88 {
89 Preferences "preferences";
90 };
91 Log "var/log/apt";
92};
93
94APT
95{
96 Install-Recommends "true";
97 Immediate-Configure "false";
98 Architecture "i586";
99 Get
100 {
101 Assume-Yes "true";
102 };
103};
104
105Acquire
106{
107 AllowInsecureRepositories "true";
108};
109
110DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
111DPkg::Path "";
112EOF
113}
114
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600115do_install_append_class-native() {
116 customize_apt_conf_sample
117}
118
119do_install_append_class-nativesdk() {
120 customize_apt_conf_sample
121}
122
123
Andrew Geissler4ed12e12020-06-05 18:00:41 -0500124do_install_append_class-target() {
125 #Write the correct apt-architecture to apt.conf
126 APT_CONF=${D}/etc/apt/apt.conf
127 echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
128}
129
130# Avoid non-reproducible -src package
131do_install_append () {
132 sed -i -e "s,${B},,g" \
133 ${B}/apt-pkg/tagfile-keys.cc
134}