1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit desktop wrapper
12 opt/${PN}/jbr/lib/jli/*
13 opt/${PN}/jbr/lib/server/*
14 opt/${PN}/lib/pty4j-native/linux/*/*
15 opt/${PN}/plugins/android/resources/installer/*/*
16 opt/${PN}/plugins/android/resources/native/*
17 opt/${PN}/plugins/android/resources/perfetto/*/*
18 opt/${PN}/plugins/android/resources/screen-sharing-agent/*/*
19 opt/${PN}/plugins/android/resources/simpleperf/*/*
20 opt/${PN}/plugins/android/resources/trace_processor_daemon/*
21 opt/${PN}/plugins/android/resources/transport/*/*
22 opt/${PN}/plugins/android/resources/transport/native/agent/*/*
23 opt/${PN}/plugins/android-ndk/resources/lldb/android/*/*
24 opt/${PN}/plugins/android-ndk/resources/lldb/bin/*
25 opt/${PN}/plugins/android-ndk/resources/lldb/lib/python3.9/lib-dynload/*
26 opt/${PN}/plugins/android-ndk/resources/lldb/lib64/*
27 opt/${PN}/plugins/design-tools/resources/layoutlib/data/linux/lib64/*
28 opt/${PN}/plugins/c-clangd/bin/clang/linux/*/*
29 opt/${PN}/plugins/webp/lib/libwebp/linux/*
32 DESCRIPTION
="Android development environment based on IntelliJ IDEA"
33 HOMEPAGE
="https://developer.android.com/studio"
34 SRC_URI
="https://redirector.gvt1.com/edgedl/android/studio/ide-zips/${PV}/${P}-linux.tar.gz"
36 LICENSE
="Apache-2.0 android BSD BSD-2 CDDL-1.1 CPL-0.5
37 EPL-1.0 GPL-2 GPL-2+ JDOM IJG LGPL-2.1 MIT
38 MPL-1.1 MPL-2.0 NPL-1.1 OFL-1.1 ZLIB"
42 RESTRICT
="bindist mirror strip"
45 selinux? ( sec-policy/selinux-android )
46 >=app-arch/bzip2-1.0.8-r4
47 >=dev-libs/expat-2.5.0
48 >=dev-libs/libffi-3.4.4
49 >=media-libs/fontconfig-2.14.0-r1
50 >=media-libs/freetype-2.12.1-r1
51 >=media-libs/libpng-1.6.39
52 >=media-libs/mesa-22.2.5[X(+)]
53 || ( gnome-extra/zenity kde-apps/kdialog x11-apps/xmessage x11-libs/libnotify )
54 sys-libs/ncurses-compat:5[tinfo]
55 >=sys-libs/zlib-1.2.13-r1
56 >=x11-libs/libX11-1.8.1
57 >=x11-libs/libXau-1.0.11
58 >=x11-libs/libXdamage-1.1.6
59 >=x11-libs/libXdmcp-1.1.4-r2
60 >=x11-libs/libXext-1.3.5
61 >=x11-libs/libXfixes-6.0.0
62 >=x11-libs/libXrender-0.9.11
63 >=x11-libs/libXxf86vm-1.1.5
64 >=x11-libs/libdrm-2.4.114
65 >=x11-libs/libxcb-1.15-r1
66 >=x11-libs/libxshmfence-1.3.2
74 rm "${S}"/plugins
/android
/resources
/installer
/{arm64-v8a
,armeabi-v7a
,x86
}/*
75 rm "${S}"/plugins
/android
/resources
/perfetto
/{arm64-v8a
,armeabi-v7a
,x86
}/*
76 rm "${S}"/plugins
/android
/resources
/process-tracker-agent
/native
/{arm64-v8a
,armeabi-v7a
,x86
}/*
77 rm "${S}"/plugins
/android
/resources
/screen-sharing-agent
/{arm64-v8a
,armeabi-v7a
,x86
}/*
78 rm "${S}"/plugins
/android
/resources
/transport
/{arm64-v8a
,armeabi-v7a
,x86
}/*
79 rm "${S}"/plugins
/android
/resources
/transport
/native
/agent
/{arm64-v8a
,armeabi-v7a
,x86
}/*
81 cat <<-EOF >> bin/idea.properties || die
82 #-----------------------------------------------------------------------
83 # Disable automatic updates as these are handled through Gentoo's
85 #-----------------------------------------------------------------------
86 ide.no.platform.update=Gentoo
95 local dir
="/opt/${PN}"
99 fperms
755 "${dir}"/bin
/{fsnotifier
,format.sh
,game-tools.sh
,inspect.sh
,ltedit.sh
,profiler.sh
,studio.sh
,studio_safe.sh
}
100 fperms
-R 755 "${dir}"/bin
/{helpers
,lldb
}
101 fperms
-R 755 "${dir}"/jbr
/bin
102 fperms
755 "${dir}"/jbr
/lib
/{jexec
,jspawnhelper
}
103 fperms
-R 755 "${dir}"/plugins
/Kotlin
/kotlinc
/bin
104 fperms
-R 755 "${dir}"/plugins
/android
/resources
/installer
105 fperms
-R 755 "${dir}"/plugins
/android
/resources
/perfetto
106 fperms
-R 755 "${dir}"/plugins
/android
/resources
/simpleperf
107 fperms
-R 755 "${dir}"/plugins
/android
/resources
/trace_processor_daemon
108 fperms
-R 755 "${dir}"/plugins
/android
/resources
/transport
/{arm64-v8a
,armeabi-v7a
,x86
,x86_64
}
109 fperms
-R 755 "${dir}"/plugins
/android-ndk
/resources
/lldb
/{android
,bin
,lib
,shared
}
110 fperms
755 "${dir}"/plugins
/c-clangd-plugin
/bin
/clang
/linux
/x64
/clangd
111 fperms
-R 755 "${dir}"/plugins
/terminal
/shell-integrations
/{,fish
}
113 newicon
"bin/studio.png" "${PN}.png"
114 make_wrapper
${PN} ${dir}/bin
/studio.sh
115 make_desktop_entry
${PN} "Android Studio" ${PN} "Development;IDE" "StartupWMClass=jetbrains-studio"
117 # recommended by: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
118 mkdir
-p "${D}/etc/sysctl.d/" || die
119 echo "fs.inotify.max_user_watches = 524288" > "${D}/etc/sysctl.d/30-android-studio-inotify-watches.conf" || die
123 elog
"Android Studio data files were not removed."
124 elog
"If there will be no other programs using them anymore"
125 elog
"(especially another flavor of Android Studio)"
126 elog
"remove manually following folders:"
129 elog
" ~/.config/Google/AndroidStudio*/"
130 elog
" ~/.local/share/Google/AndroidStudio*/"
133 elog
"Also, if there are no other programs using Gradle, remove:"