|
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 |
|
13 if [[ $(get_version_component_count) -eq 6 ]]; then |
|
14 STUDIO_V=$(get_version_component_range 1-4) |
|
15 BUILD_V=$(get_version_component_range 5-6) |
|
16 else |
|
17 STUDIO_V=$(get_version_component_range 1-3) |
|
18 BUILD_V=$(get_version_component_range 4-5) |
|
19 fi |
|
20 |
|
21 DESCRIPTION="A new Android development environment based on IntelliJ IDEA" |
|
22 HOMEPAGE="http://developer.android.com/sdk/installing/studio.html" |
|
23 SRC_URI="https://dl.google.com/dl/android/studio/ide-zips/${STUDIO_V}/${PN}-ide-${BUILD_V}-linux.zip" |
|
24 |
|
25 LICENSE="Apache-2.0" |
|
26 SLOT="0" |
|
27 IUSE="selinux" |
|
28 KEYWORDS="~amd64 ~x86" |
|
29 |
|
30 DEPEND="app-arch/zip |
|
31 dev-java/commons-logging:0 |
|
32 dev-java/log4j:0" |
|
33 |
|
34 # dev-java/guava:18 |
|
35 RDEPEND=">=virtual/jdk-1.7 |
|
36 selinux? ( sec-policy/selinux-android ) |
|
37 >=app-arch/bzip2-1.0.6-r4 |
|
38 dev-java/commons-logging:0 |
|
39 dev-java/log4j:0 |
|
40 >=dev-libs/expat-2.1.0-r3 |
|
41 >=dev-libs/libffi-3.0.13-r1 |
|
42 >=media-libs/fontconfig-2.10.92 |
|
43 >=media-libs/freetype-2.5.5 |
|
44 >=media-libs/libpng-1.2.51 |
|
45 >=media-libs/mesa-10.2.8 |
|
46 || ( gnome-extra/zenity kde-apps/kdialog x11-apps/xmessage x11-libs/libnotify ) |
|
47 || ( >=sys-libs/ncurses-5.9-r3:5/5[tinfo] >=sys-libs/ncurses-5.9-r3:0/5[tinfo] ) |
|
48 >=sys-libs/zlib-1.2.8-r1 |
|
49 >=x11-libs/libX11-1.6.2 |
|
50 >=x11-libs/libXau-1.0.7-r1 |
|
51 >=x11-libs/libXdamage-1.1.4-r1 |
|
52 >=x11-libs/libXdmcp-1.1.1-r1 |
|
53 >=x11-libs/libXext-1.3.2 |
|
54 >=x11-libs/libXfixes-5.0.1 |
|
55 >=x11-libs/libXrender-0.9.8 |
|
56 >=x11-libs/libXxf86vm-1.1.3 |
|
57 >=x11-libs/libdrm-2.4.46 |
|
58 >=x11-libs/libxcb-1.9.1 |
|
59 >=x11-libs/libxshmfence-1.1" |
|
60 S=${WORKDIR}/${PN} |
|
61 |
|
62 src_prepare() { |
|
63 eapply_user |
|
64 # This is really a bundled jdk not a jre |
|
65 rm -R "${S}/jre" || die "Could not remove bundled jdk" |
|
66 |
|
67 # Replace bundled jars with system |
|
68 # has problems with newer jdom:0 not updated to jdom:2 |
|
69 cd "${S}/lib" |
|
70 local JARS="commons-logging log4j" |
|
71 local j |
|
72 for j in ${JARS}; do |
|
73 rm -v ${j/:*/}*.jar |
|
74 java-pkg_jar-from ${j} |
|
75 done |
|
76 } |
|
77 |
|
78 src_compile() { |
|
79 : |
|
80 } |
|
81 |
|
82 src_install() { |
|
83 local dir="/opt/${PN}" |
|
84 |
|
85 if use x86 ; then |
|
86 rm "bin/fsnotifier64" || die |
|
87 elif use amd64 ; then |
|
88 rm "bin/fsnotifier" || die |
|
89 fi |
|
90 insinto "${dir}" |
|
91 # Replaced bundled jre with system vm/jdk |
|
92 # This is really a bundled jdk not a jre |
|
93 doins -r * |
|
94 |
|
95 rm -rf "${D}${dir}/jre" || die |
|
96 dosym "/etc/java-config-2/current-system-vm" "${dir}/jre" |
|
97 |
|
98 fperms 755 "${dir}/bin/studio.sh" |
|
99 if use x86 ; then |
|
100 fperms 755 "${dir}/bin/fsnotifier" |
|
101 elif use amd64 ; then |
|
102 fperms 755 "${dir}/bin/fsnotifier64" |
|
103 fi |
|
104 chmod 755 "${D}${dir}"/gradle/gradle-*/bin/gradle || 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 } |