android-sdk-update-manager-24.4.1-r2.ebuild (3140B)
1 # Copyright 1999-2021 Gentoo Authors 2 # Distributed under the terms of the GNU General Public License v2 3 4 EAPI=7 5 6 inherit desktop udev 7 8 ANDROID_SDK_DIR="/opt/android-sdk-update-manager" 9 MY_P="android-sdk_r${PV}-linux" 10 11 DESCRIPTION="Open Handset Alliance's Android SDK" 12 HOMEPAGE="https://developer.android.com" 13 SRC_URI="https://dl.google.com/android/${MY_P}.tgz" 14 15 LICENSE="android" 16 SLOT="0" 17 KEYWORDS="~amd64" 18 RESTRICT="mirror" 19 20 DEPEND="acct-group/android" 21 RDEPEND=" 22 ${DEPEND} 23 dev-java/ant-core 24 >=virtual/jdk-1.8 25 X? ( 26 dev-java/swt:4.10[cairo] 27 sys-libs/ncurses-compat:5[abi_x86_32(-)] 28 sys-libs/zlib[abi_x86_32(-)] 29 ) 30 " 31 32 S="${WORKDIR}/android-sdk-linux" 33 34 QA_PREBUILT="*" 35 36 IUSE="+X" 37 38 src_prepare() { 39 default 40 rm -rf tools/lib/x86* || die 41 } 42 43 src_install() { 44 dodoc tools/NOTICE.txt "SDK Readme.txt" 45 rm -f tools/NOTICE.txt "SDK Readme.txt" || die 46 47 dodir "${ANDROID_SDK_DIR}/tools" 48 cp -pPR tools/* "${ED}${ANDROID_SDK_DIR}/tools" || die 49 50 # Maybe this is needed for the tools directory too. 51 dodir "${ANDROID_SDK_DIR}"/{add-ons,build-tools,docs,extras,platforms,platform-tools,samples,sources,system-images,temp} 52 53 fowners -R root:android "${ANDROID_SDK_DIR}"/{.,add-ons,build-tools,docs,extras,platforms,platform-tools,samples,sources,system-images,temp,tools} 54 fperms -R 0775 "${ANDROID_SDK_DIR}"/{.,add-ons,build-tools,docs,extras,platforms,platform-tools,samples,sources,system-images,temp,tools} 55 56 echo "PATH=\"${EPREFIX}${ANDROID_SDK_DIR}/tools:${EPREFIX}${ANDROID_SDK_DIR}/platform-tools\"" > "${T}/80${PN}" || die 57 58 if use X ; then 59 SWT_PATH= 60 SWT_VERSIONS="3.7 3.6" 61 for version in $SWT_VERSIONS; do 62 # redirecting stderr to /dev/null 63 # not sure if this is best, but avoids misleading error messages 64 SWT_PATH="`dirname \`java-config -p swt-\$version 2>/dev/null\` 2>/dev/null`" 65 if [ $SWT_PATH ]; then 66 einfo "SWT_PATH=$SWT_PATH selecting version $version of SWT." 67 break 68 fi 69 done 70 else 71 SWT_PATH="/tmp" 72 fi 73 74 echo "ANDROID_SWT=\"${SWT_PATH}\"" >> "${T}/80${PN}" || die 75 echo "ANDROID_HOME=\"${EPREFIX}${ANDROID_SDK_DIR}\"" >> "${T}/80${PN}" || die 76 77 doenvd "${T}/80${PN}" || die 78 79 echo "SEARCH_DIRS_MASK=\"${EPREFIX}${ANDROID_SDK_DIR}\"" > "${T}/80${PN}" || die 80 81 insinto "/etc/revdep-rebuild" && doins "${T}/80${PN}" || die 82 83 udev_dorules "${FILESDIR}"/80-android.rules || die 84 domenu "${FILESDIR}"/android-sdk-update-manager.desktop || die 85 } 86 87 pkg_postinst() { 88 elog "The Android SDK now uses its own manager for the development environment." 89 elog "Run 'android' to download the full SDK, including some of the platform tools." 90 elog "You must be in the android group to manage the development environment." 91 elog "Just run 'gpasswd -a <USER> android', then have <USER> re-login." 92 elog "See https://developer.android.com/sdk/adding-components.html for more" 93 elog "information." 94 elog "If you have problems downloading the SDK, see https://code.google.com/p/android/issues/detail?id=4406" 95 elog "You need to run env-update and source /etc/profile in any open shells" 96 elog "if you get an SWT error." 97 use X || ewarn "You specified -X use-flag, the programs emulator and ddms will not work." 98 }