summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb')
-rw-r--r--dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb205
1 files changed, 205 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb
new file mode 100644
index 0000000..aaec6b5
--- /dev/null
+++ b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb
@@ -0,0 +1,205 @@
1DESCRIPTION = "Different utilities from Android"
2SECTION = "console/utils"
3LICENSE = "Apache-2.0 & GPL-2.0 & BSD-2-Clause & BSD-3-Clause"
4LIC_FILES_CHKSUM = " \
5 file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10 \
6 file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6 \
7 file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=cb641bc04cda31daea161b1bc15da69f \
8 file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
9"
10DEPENDS = "libbsd libpcre zlib libcap libusb squashfs-tools p7zip libselinux"
11
12ANDROID_MIRROR = "android.googlesource.com"
13
14# matches with 10.0.0+r36
15SRCREV_boringssl = "ae2dd49c7cb74d04bdba7c1c9bd62c1e9cdf98f6"
16SRCREV_core = "5aa13b053182b758d7a19db0c83e1b9b5bf1ec2e"
17SRCREV_extras = "d31740f9d0399f8b938e88e58843d966e1cccab6"
18SRCREV_libhardware = "c6925520342a7d37758f85eb1cf3baa20a7b7a18"
19SRCREV_build = "28768b3120f751583a2743101b892f210d4715cf"
20SRCREV_libunwind = "03a963ecf6ea836b38b3537cbcda0ecfd7a77393"
21
22SRC_URI = " \
23 git://salsa.debian.org/android-tools-team/android-platform-external-boringssl;name=boringssl;protocol=https;nobranch=1;destsuffix=git/external/boringssl \
24 git://salsa.debian.org/android-tools-team/android-platform-system-core;name=core;protocol=https;nobranch=1;destsuffix=git/system/core \
25 git://salsa.debian.org/android-tools-team/android-platform-system-extras;name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \
26 git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \
27 git://salsa.debian.org/android-tools-team/android-platform-build.git;name=build;protocol=https;nobranch=1;destsuffix=git/build \
28 git://salsa.debian.org/android-tools-team/android-platform-external-libunwind.git;protocol=https;name=libunwind;nobranch=1;destsuffix=git/external/libunwind \
29 file://adb_mk_change_out_dir.patch \
30 file://libadb_mk_change_out_dir.patch \
31 file://fastboot_compile_remove_gtest.patch \
32 file://fastboot_mk_change_out_dir.patch \
33 file://fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch \
34 file://libbase_mk_change_out_dir.patch \
35 file://libext4_utils_mk_change_out_dir.patch \
36 file://libcrypto_mk_change_out_dir.patch \
37 file://libcrypto_utils_mk_change_out_dir.patch \
38 file://libcutils_mk_change_out_dir.patch \
39 file://libfec_mk_change_out_dir.patch \
40 file://img2simg_change_out_dir.patch \
41 file://simg2img_change_out_dir.patch \
42 file://liblog_mk_change_out_dir.patch \
43 file://libsparse_mk_change_out_dir.patch \
44 file://libziparchive_mk_change_out_dir.patch \
45 file://libbacktrace_mk_change_out_dir.patch \
46 file://libunwind_mk_change_out_dir.patch \
47 file://use_name_space_std_to_compile_libbacktrace.patch \
48 file://rules_yocto.mk;subdir=git \
49 file://android-tools-adbd.service \
50"
51
52S = "${WORKDIR}/git"
53B = "${WORKDIR}/${BPN}"
54
55#apply all the patches maintained in the debian version.
56do_unpack_and_patch_debian() {
57 cd ${S}/system/core
58 for i in `find ${S}/system/core/debian/patches -name "*.patch"`; do
59 patch -p1 < $i
60 done
61 #a patch with no .patch extention, lets apply that
62 patch -p1 < ${S}/system/core/debian/patches/Added-missing-headers
63 cd ${S}/external/libunwind
64 for i in `find ${S}/external/libunwind/debian/patches -name "*.patch"`; do
65 patch -p1 < $i
66 done
67}
68addtask unpack_and_patch_debian after do_unpack before do_patch
69
70# http://errors.yoctoproject.org/Errors/Details/1debian881/
71ARM_INSTRUCTION_SET_armv4 = "arm"
72ARM_INSTRUCTION_SET_armv5 = "arm"
73
74COMPATIBLE_HOST_powerpc = "(null)"
75COMPATIBLE_HOST_powerpc64 = "(null)"
76COMPATIBLE_HOST_powerpc64le = "(null)"
77
78inherit systemd clang
79
80TOOLCHAIN = "clang"
81DEPENDS += "\
82 clang-cross-${TARGET_ARCH} \
83"
84
85SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service"
86
87# Find libbsd headers during native builds
88CC:append_class-native = " -I${STAGING_INCDIR}"
89CC:append_class-nativesdk = " -I${STAGING_INCDIR}"
90
91PREREQUISITE_core = "libbase libsparse liblog libcutils"
92TOOLS_TO_BUILD = "libcrypto_utils libadb libziparchive fastboot adb img2simg simg2img libbacktrace"
93
94# Adb needs sys/capability.h, which is not available for native*
95TOOLS_class-native = "boringssl fastboot ext4_utils mkbootimg"
96TOOLS_class-nativesdk = "boringssl fastboot ext4_utils mkbootimg"
97
98do_compile() {
99
100 case "${HOST_ARCH}" in
101 arm)
102 export android_arch=linux-arm
103 cpu=arm
104 deb_host_arch=arm
105 ;;
106 aarch64)
107 export android_arch=linux-arm64
108 cpu=arm64
109 deb_host_arch=arm64
110 ;;
111 riscv64)
112 export android_arch=linux-riscv64
113 ;;
114 mips|mipsel)
115 export android_arch=linux-mips
116 cpu=mips
117 deb_host_arch=mips
118 ;;
119 mips64|mips64el)
120 export android_arch=linux-mips64
121 cpu=mips64
122 deb_host_arch=mips64
123 ;;
124 powerpc|powerpc64)
125 export android_arch=linux-ppc
126 ;;
127 i586|i686|x86_64)
128 export android_arch=linux-x86
129 cpu=x86_64
130 deb_host_arch=amd64
131 ;;
132 esac
133
134 export SRCDIR=${S}
135
136 oe_runmake -f ${S}/external/boringssl/debian/libcrypto.mk -C ${S}/external/boringssl
137 oe_runmake -f ${S}/external/libunwind/debian/libunwind.mk -C ${S}/external/libunwind CPU=${cpu}
138
139 for tool in ${PREREQUISITE_core}; do
140 oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core
141 done
142
143 for i in `find ${S}/system/extras/debian/ -name "*.mk"`; do
144 oe_runmake -f $i -C ${S}/system/extras
145 done
146
147 for tool in ${TOOLS_TO_BUILD}; do
148 if tool == "libbacktrace"; then
149 oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core DEB_HOST_ARCH=${deb_host_arch}
150 else
151 oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core
152 fi
153 done
154
155}
156
157do_install() {
158 if echo ${TOOLS_TO_BUILD} | grep -q "ext4_utils" ; then
159 install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
160 fi
161
162 if echo ${TOOLS_TO_BUILD} | grep -q "adb " ; then
163 install -d ${D}${bindir}
164 install -m0755 ${S}/debian/out/usr/lib/android/adb/adb ${D}${bindir}
165 fi
166
167 if echo ${TOOLS_TO_BUILD} | grep -q "adbd" ; then
168 install -d ${D}${bindir}
169 install -m0755 ${B}/adbd/adbd ${D}${bindir}
170 fi
171
172 # Outside the if statement to avoid errors during do_package
173 install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
174 ${D}${systemd_unitdir}/system/android-tools-adbd.service
175
176 if echo ${TOOLS_TO_BUILD} | grep -q "fastboot" ; then
177 install -d ${D}${bindir}
178 install -m0755 ${S}/debian/out/usr/bin/fastboot/fastboot ${D}${bindir}
179 fi
180
181 install -d ${D}${libdir}/android/
182 install -m0755 ${S}/debian/out/usr/lib/android/*.so.* ${D}${libdir}/android/
183 if echo ${TOOLS_TO_BUILD} | grep -q "mkbootimg" ; then
184 install -d ${D}${bindir}
185 install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
186 fi
187}
188
189PACKAGES += "${PN}-fstools"
190
191RDEPENDS_${BPN} = "${BPN}-conf p7zip"
192
193FILES_${PN}-fstools = "\
194 ${bindir}/ext2simg \
195 ${bindir}/ext4fixup \
196 ${bindir}/img2simg \
197 ${bindir}/make_ext4fs \
198 ${bindir}/simg2img \
199 ${bindir}/simg2simg \
200 ${bindir}/simg_dump \
201 ${bindir}/mkuserimg \
202"
203FILES:${PN} += "${libdir}/android ${libdir}/android/*"
204
205BBCLASSEXTEND = "native"