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