blob: af6f1b4370dd190adaf66988d1c339721bb89d1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit greadme udev
DESCRIPTION="Open Handset Alliance's Android SDK"
HOMEPAGE="https://developer.android.com/tools https://developer.android.com/studio#command-tools"
SRC_URI="https://dl.google.com/android/repository/commandlinetools-linux-$(ver_cut 3)_latest.zip"
S="${WORKDIR}/cmdline-tools"
LICENSE="android"
SLOT="0"
KEYWORDS="~amd64"
RESTRICT="bindist mirror"
DEPEND="acct-group/android"
RDEPEND="
${DEPEND}
virtual/jre
"
BDEPEND="app-arch/unzip"
src_install() {
local android_sdk_dir="/opt/android-sdk"
local target="${android_sdk_dir}/cmdline-tools/latest"
insinto "${target}"
doins -r .
fowners -R root:android "${android_sdk_dir}"
fperms -R 0775 "${android_sdk_dir}"
newenvd - "80${PN}" <<-EOF
PATH="${EPREFIX}${target}/bin"
ANDROID_HOME="${EPREFIX}${android_sdk_dir}"
EOF
udev_dorules "${FILESDIR}"/80-android-device.rules
greadme_stdin <<-EOF
The Android SDK now uses its own manager for the development environment.
Run 'sdkmanager' to download the full SDK, including some of the platform tools.
You must be in the android group to manage the development environment.
Just run 'gpasswd -a <USER> android', then have <USER> re-login.
EOF
}
pkg_postinst() {
greadme_pkg_postinst
if has_version dev-util/android-sdk-update-manager; then
ewarn "This package (${P}) superseeds dev-util/android-sdk-update-manager"
ewarn "Consider uninstalling dev-util/android-sdk-update-manager"
fi
}
|