dev-util/android-studio/android-studio-3.2.0.26.181.5014246.ebuild
changeset 221 c5f8d9947206
equal deleted inserted replaced
220:fca4a6de7c45 221:c5f8d9947206
       
     1 # Copyright 1999-2017 Gentoo Foundation
       
     2 # Distributed under the terms of the GNU General Public License v2
       
     3 
       
     4 EAPI=6
       
     5 inherit eutils java-pkg-2 versionator
       
     6 
       
     7 RESTRICT="strip"
       
     8 QA_PREBUILT="opt/${PN}/bin/libbreakgen*.so
       
     9 	opt/${PN}/bin/fsnotifier*
       
    10 	opt/${PN}/lib/libpty/linux/x86*/libpty.so
       
    11 	opt/${PN}/plugins/android/lib/libwebp_jni*.so
       
    12 	opt/${PN}/plugins/android/resources/perfa/*/libperfa.so
       
    13 	opt/${PN}/plugins/android/resources/perfd/*/perfd
       
    14 	opt/${PN}/plugins/android/resources/simpleperf/*/simpleperf"
       
    15 
       
    16 if [[ $(get_version_component_count) -eq 6 ]]; then
       
    17 	STUDIO_V=$(get_version_component_range 1-4)
       
    18 	BUILD_V=$(get_version_component_range 5-6)
       
    19 else
       
    20 	STUDIO_V=$(get_version_component_range 1-3)
       
    21 	BUILD_V=$(get_version_component_range 4-5)
       
    22 fi
       
    23 
       
    24 DESCRIPTION="A new Android development environment based on IntelliJ IDEA"
       
    25 HOMEPAGE="http://developer.android.com/sdk/installing/studio.html"
       
    26 SRC_URI="https://dl.google.com/dl/android/studio/ide-zips/${STUDIO_V}/${PN}-ide-${BUILD_V}-linux.zip"
       
    27 
       
    28 LICENSE="Apache-2.0"
       
    29 SLOT="0"
       
    30 IUSE="selinux"
       
    31 KEYWORDS="~amd64 ~x86"
       
    32 
       
    33 DEPEND="app-arch/zip
       
    34 	dev-java/commons-logging:0
       
    35 	dev-java/log4j:0"
       
    36 
       
    37 #	dev-java/guava:18
       
    38 RDEPEND=">=virtual/jdk-1.7
       
    39 	selinux? ( sec-policy/selinux-android )
       
    40 	>=app-arch/bzip2-1.0.6-r4
       
    41 	dev-java/commons-logging:0
       
    42 	dev-java/log4j:0
       
    43 	>=dev-libs/expat-2.1.0-r3
       
    44 	>=dev-libs/libffi-3.0.13-r1
       
    45 	>=media-libs/fontconfig-2.10.92
       
    46 	>=media-libs/freetype-2.5.5
       
    47 	>=media-libs/libpng-1.2.51
       
    48 	>=media-libs/mesa-10.2.8
       
    49 	|| ( gnome-extra/zenity kde-apps/kdialog x11-apps/xmessage x11-libs/libnotify )
       
    50 	>=sys-libs/ncurses-5.9-r3:5/5[tinfo]
       
    51 	>=sys-libs/zlib-1.2.8-r1
       
    52 	>=x11-libs/libX11-1.6.2
       
    53 	>=x11-libs/libXau-1.0.7-r1
       
    54 	>=x11-libs/libXdamage-1.1.4-r1
       
    55 	>=x11-libs/libXdmcp-1.1.1-r1
       
    56 	>=x11-libs/libXext-1.3.2
       
    57 	>=x11-libs/libXfixes-5.0.1
       
    58 	>=x11-libs/libXrender-0.9.8
       
    59 	>=x11-libs/libXxf86vm-1.1.3
       
    60 	>=x11-libs/libdrm-2.4.46
       
    61 	>=x11-libs/libxcb-1.9.1
       
    62 	>=x11-libs/libxshmfence-1.1"
       
    63 S=${WORKDIR}/${PN}
       
    64 
       
    65 src_prepare() {
       
    66 	eapply_user
       
    67 	# This is really a bundled jdk not a jre
       
    68 	rm -R "${S}/jre" || die "Could not remove bundled jdk"
       
    69 
       
    70 	# Replace bundled jars with system
       
    71 	# has problems with newer jdom:0 not updated to jdom:2
       
    72 	cd "${S}/lib" || die
       
    73 	local JARS="commons-logging log4j"
       
    74 	local j
       
    75 	for j in ${JARS}; do
       
    76 		rm -v ${j/:*/}*.jar || die
       
    77 		java-pkg_jar-from ${j}
       
    78 	done
       
    79 
       
    80 	cd "${S}" || die
       
    81 
       
    82 	# bug 629404
       
    83 	echo "-Djdk.util.zip.ensureTrailingSlash=false" >> bin/studio64.vmoptions || die
       
    84 	echo "-Djdk.util.zip.ensureTrailingSlash=false" >> bin/studio.vmoptions || die
       
    85 }
       
    86 
       
    87 src_compile() {
       
    88 	:
       
    89 }
       
    90 
       
    91 src_install() {
       
    92 	local dir="/opt/${PN}"
       
    93 
       
    94 	insinto "${dir}"
       
    95 	# Replaced bundled jre with system vm/jdk
       
    96 	# This is really a bundled jdk not a jre
       
    97 	doins -r *
       
    98 
       
    99 	rm -rf "${D}${dir}/jre" || die
       
   100 	dosym "/etc/java-config-2/current-system-vm" "${dir}/jre"
       
   101 
       
   102 	fperms 755 "${dir}/bin/studio.sh" "${dir}"/bin/fsnotifier{,64}
       
   103 	chmod 755 "${D}${dir}"/gradle/gradle-*/bin/gradle || die
       
   104 	chmod 755 "${D}${dir}"/bin/lldb/bin/* || die
       
   105 
       
   106 	newicon "bin/studio.png" "${PN}.png"
       
   107 	make_wrapper ${PN} ${dir}/bin/studio.sh
       
   108 	make_desktop_entry ${PN} "Android Studio" ${PN} "Development;IDE"
       
   109 }