summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt_2.2.2.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/apt/apt_2.2.2.bb')
-rw-r--r--meta/recipes-devtools/apt/apt_2.2.2.bb129
1 files changed, 129 insertions, 0 deletions
diff --git a/meta/recipes-devtools/apt/apt_2.2.2.bb b/meta/recipes-devtools/apt/apt_2.2.2.bb
new file mode 100644
index 0000000000..b838495da8
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt_2.2.2.bb
@@ -0,0 +1,129 @@
1SUMMARY = "Advanced front-end for dpkg"
2DESCRIPTION = "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"
4LICENSE = "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 \
13 "
14
15SRC_URI_append_class-native = " \
16 file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
17 file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
18 "
19
20SRC_URI_append_class-nativesdk = " \
21 file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
22 file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
23 "
24
25SRC_URI[sha256sum] = "c5449a4c2126a12497a9949cd10209926005d329f6ce7942a3781fa2fcf50487"
26LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
27
28# the package is taken from snapshots.debian.org; that source is static and goes stale
29# so we check the latest upstream from a directory that does get updated
30UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
31
32inherit cmake perlnative bash-completion upstream-version-is-even useradd
33
34# User is added to allow apt to drop privs, will runtime warn without
35USERADD_PACKAGES = "${PN}"
36USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
37
38BBCLASSEXTEND = "native nativesdk"
39
40DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash"
41
42EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \
43 -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg \
44 -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \
45 -DWITH_TESTS=False \
46"
47
48do_configure_prepend () {
49 echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake
50
51}
52
53# Unfortunately apt hardcodes this all over the place
54FILES_${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt"
55RDEPENDS_${PN} += "bash perl dpkg"
56
57customize_apt_conf_sample() {
58 cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF
59Dir "${STAGING_DIR_NATIVE}/"
60{
61 State "var/lib/apt/"
62 {
63 Lists "#APTCONF#/lists/";
64 status "#ROOTFS#/var/lib/dpkg/status";
65 };
66 Cache "var/cache/apt/"
67 {
68 Archives "archives/";
69 pkgcache "";
70 srcpkgcache "";
71 };
72 Bin "${STAGING_BINDIR_NATIVE}/"
73 {
74 methods "${STAGING_LIBDIR}/apt/methods/";
75 gzip "/bin/gzip";
76 dpkg "dpkg";
77 dpkg-source "dpkg-source";
78 dpkg-buildpackage "dpkg-buildpackage";
79 apt-get "apt-get";
80 apt-cache "apt-cache";
81 };
82 Etc "#APTCONF#"
83 {
84 Preferences "preferences";
85 };
86 Log "var/log/apt";
87};
88
89APT
90{
91 Install-Recommends "true";
92 Immediate-Configure "false";
93 Architecture "i586";
94 Get
95 {
96 Assume-Yes "true";
97 };
98};
99
100Acquire
101{
102 AllowInsecureRepositories "true";
103};
104
105DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
106DPkg::Path "";
107EOF
108}
109
110do_install_append_class-native() {
111 customize_apt_conf_sample
112}
113
114do_install_append_class-nativesdk() {
115 customize_apt_conf_sample
116}
117
118
119do_install_append_class-target() {
120 #Write the correct apt-architecture to apt.conf
121 APT_CONF=${D}/etc/apt/apt.conf
122 echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
123}
124
125# Avoid non-reproducible -src package
126do_install_append () {
127 sed -i -e "s,${B},,g" \
128 ${B}/apt-pkg/tagfile-keys.cc
129}