blob: de0e150a2e3f40e61a0a0634f32552ea4b0404ac [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 \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060011 file://0001-test-libapt-do-not-use-gtest-from-the-host.patch \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050012 "
13
14SRC_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
20SRC_URI[sha256sum] = "6d447f2e9437ec24e78350b63bb0592bee1f050811d51990b0c783183b0983f8"
21LIC_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
25UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
26
27inherit cmake perlnative bash-completion upstream-version-is-even
28
29BBCLASSEXTEND = "native"
30
31DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz"
32
33EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash"
34
35do_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
41FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
42RDEPENDS_${PN} += "bash perl dpkg"
43
44do_install_append_class-native() {
45 cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
46Dir "${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
76APT
77{
78 Install-Recommends "true";
79 Immediate-Configure "false";
80 Architecture "i586";
81 Get
82 {
83 Assume-Yes "true";
84 };
85};
86
87Acquire
88{
89 AllowInsecureRepositories "true";
90};
91
92DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
93DPkg::Path "";
94EOF
95}
96
97do_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
104do_install_append () {
105 sed -i -e "s,${B},,g" \
106 ${B}/apt-pkg/tagfile-keys.cc
107}