summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-09-07 12:58:47 +0300
committerMartin Jansa <Martin.Jansa@gmail.com>2016-09-15 10:22:46 +0200
commita231c431a522ae1821fc484bb1a1f9997ecabf20 (patch)
tree0513730154c45ce23dc35393bcf1ec609590a23b /meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
parent4fad615950a92db633d2d46fddd3fc491a853e55 (diff)
downloadmeta-openembedded-a231c431a522ae1821fc484bb1a1f9997ecabf20.tar.gz
android-tools: add recipe from AOSP tag android-5.1.1_r37
Android tools offer filsystem tools for creating sparse images, so package them in package of its own. This recipe is re-worked and not a straight import from meta-shr. It's built from AOSP source. I've dropped the ubuntu-ism which will never be upstreamed. The intent is to be closer to the upstream AOSP source code and be able to update the recipe regularly. Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb')
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb136
1 files changed, 136 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
new file mode 100644
index 000000000..2dbddf157
--- /dev/null
+++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
@@ -0,0 +1,136 @@
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;md5=801f80980d171dd6425610833a22dbe6 \
7 file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=8bef8e6712b1be5aa76af1ebde9d6378 \
8 file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \
9"
10DEPENDS = "libbsd libpcre openssl zlib"
11
12ANDROID_TAG = "android-5.1.1_r37"
13ANDROID_MIRROR = "android.googlesource.com"
14CORE_REPO = "${ANDROID_MIRROR}/platform/system/core"
15EXTRAS_REPO = "${ANDROID_MIRROR}/platform/system/extras"
16LIBHARDWARE_REPO = "${ANDROID_MIRROR}/platform/hardware/libhardware"
17LIBSELINUX_REPO = "${ANDROID_MIRROR}/platform/external/libselinux"
18BUILD_REPO = "${ANDROID_MIRROR}/platform/build"
19
20SRC_URI = " \
21 git://${CORE_REPO};name=core;protocol=https;nobranch=1;destsuffix=git/system/core;tag=${ANDROID_TAG} \
22 git://${EXTRAS_REPO};name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras;tag=${ANDROID_TAG} \
23 git://${LIBHARDWARE_REPO};name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware;tag=${ANDROID_TAG} \
24 git://${LIBSELINUX_REPO};name=libselinux;protocol=https;nobranch=1;destsuffix=git/external/libselinux;tag=${ANDROID_TAG} \
25 git://${BUILD_REPO};name=build;protocol=https;nobranch=1;destsuffix=git/build;tag=${ANDROID_TAG} \
26 file://remove-selinux-android.patch;apply=yes \
27 file://use-capability.patch;apply=yes \
28 file://use-local-socket.patch;apply=yes \
29 file://preserve-ownership.patch;apply=yes \
30 file://mkbootimg-Add-dt-parameter-to-specify-DT-image.patch;apply=yes \
31 file://remove-bionic-android.patch;apply=yes \
32 file://define-shell-command.patch;apply=yes \
33 file://implicit-declaration-function-strlcat-strlcopy.patch;apply=yes \
34 file://android-tools-adbd.service \
35 file://.gitignore;subdir=git \
36 file://adb.mk;subdir=${BPN} \
37 file://adbd.mk;subdir=${BPN} \
38 file://ext4_utils.mk;subdir=${BPN} \
39 file://fastboot.mk;subdir=${BPN} \
40 file://mkbootimg.mk;subdir=${BPN} \
41"
42
43S = "${WORKDIR}/git"
44B = "${WORKDIR}/${BPN}"
45
46inherit systemd
47
48SYSTEMD_SERVICE_${PN} = "android-tools-adbd.service"
49
50# Get rid of files uneeded to build Android tools
51do_unpack_extra() {
52 cd ${S}
53 rm -rf \
54 system/core/.git \
55 system/extras/.git \
56 hardware/libhardware/.git \
57 external/libselinux/.git \
58 build/.git
59 git init
60 git add .
61 git commit -m \
62 "Initial import - committed ${ANDROID_TAG}"
63 git clean -fdx
64}
65
66addtask unpack_extra after do_unpack before do_patch
67
68do_compile() {
69 # Setting both variables below causing our makefiles to not work with
70 # implicit make rules
71 unset CFLAGS
72 unset CPPFLAGS
73
74 export SRCDIR=${S}
75
76 case "${HOST_ARCH}" in
77 arm)
78 export android_arch=linux-arm
79 ;;
80 aarch64)
81 export android_arch=linux-arm64
82 ;;
83 mips|mipsel)
84 export android_arch=linux-mips
85 ;;
86 powerpc|powerpc64)
87 export android_arch=linux-ppc
88 ;;
89 i586|x86_64)
90 export android_arch=linux-x86
91 ;;
92 esac
93
94 tools="adb fastboot ext4_utils mkbootimg adbd"
95 for tool in ${tools}; do
96 mkdir -p ${B}/${tool}
97 oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
98 done
99}
100
101do_install() {
102 install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
103 install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
104
105 install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
106 install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
107 install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
108 install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
109 install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
110 install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
111
112 install -m0755 ${B}/adb/adb ${D}${bindir}
113 install -m0755 ${B}/adbd/adbd ${D}${bindir}
114 install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
115 install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
116
117 install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
118 ${D}${systemd_unitdir}/system/android-tools-adbd.service
119}
120
121PACKAGES += "${PN}-fstools"
122
123RDEPENDS_${BPN} = "${BPN}-conf bash"
124
125FILES_${PN}-fstools = "\
126 ${bindir}/ext2simg \
127 ${bindir}/ext4fixup \
128 ${bindir}/img2simg \
129 ${bindir}/make_ext4fs \
130 ${bindir}/simg2img \
131 ${bindir}/simg2simg \
132 ${bindir}/simg_dump \
133 ${bindir}/mkuserimg \
134"
135
136BBCLASSEXTEND += "native"