Created attachment 561866 [details] android-studio-3.3.0.20.182.5199772.ebuild Proposed ebuild adds custom-jdk flag, to enable a choice between system jdk and built-in jdk (like it is in Intellij IDEA). There is also some code tiding. --- /usr/portage/dev-util/android-studio/android-studio-3.2.1.0.181.5056338.ebuild 2018-12-09 17:09:29.000000000 +0100 +++ android-studio-3.3.0.20.182.5199772.ebuild 2019-01-17 19:58:26.192344779 +0100 @@ -29,7 +29,7 @@ LICENSE="Apache-2.0" SLOT="0" -IUSE="selinux" +IUSE="custom-jdk selinux" KEYWORDS="~amd64 ~x86" DEPEND="app-arch/zip @@ -70,10 +70,15 @@ eapply_user # This is really a bundled jdk not a jre - rm -rf "${S}/jre" || die "Could not remove bundled jdk" - + # If custom-jdk is not set bundled jre is replaced with system vm/jdk + if use custom-jdk; then + mv -f "${S}/jre" "${S}/custom-jdk" || die "Could not move bundled jdk" + else + rm -rf "${S}/jre" || die "Could not remove bundled jdk" + fi # Replace bundled jars with system # has problems with newer jdom:0 not updated to jdom:2 + cd "${S}/lib" || die local JARS="commons-logging log4j" local j @@ -99,14 +104,20 @@ insinto "${dir}" doins -r * - # Replaced bundled jre with system vm/jdk # This is really a bundled jdk not a jre - rm -rf "${ED%/}${dir}/jre" || die - dosym "../../etc/java-config-2/current-system-vm" "${dir}/jre" + # If custom-jdk is not set bundled jre is replaced with system vm/jdk + if use custom-jdk; then + dosym "${ED%/}${dir}/custom-jdk" "${dir}/jre" + else + dosym "../../etc/java-config-2/current-system-vm" "${dir}/jre" + fi - fperms 755 "${dir}/bin/studio.sh" "${dir}"/bin/fsnotifier{,64} + fperms 755 "${dir}"/bin/{fsnotifier{,64},printenv.py,restart.py,format.sh,inspect.sh,studio.sh} fperms -R 755 "${dir}"/bin/lldb/{android,bin} - chmod 755 "${ED%/}${dir}"/bin/*.py "${ED%/}${dir}"/bin/*.sh || die + if use custom-jdk; then + fperms -R 755 "${dir}"/jre/{bin,jre/bin} + fperms 755 ${dir}/jre/jre/lib/jexec + fi chmod 755 "${ED%/}${dir}"/gradle/gradle-*/bin/gradle || die newicon "bin/studio.png" "${PN}.png"
Comment on attachment 561866 [details] android-studio-3.3.0.20.182.5199772.ebuild --- android-studio-3.2.1.0.181.5056338.ebuild 2018-12-09 22:37:37.747911363 +0100 +++ - 2019-01-18 00:39:11.848517848 +0100 @@ -29,7 +29,7 @@ LICENSE="Apache-2.0" SLOT="0" -IUSE="selinux" +IUSE="custom-jdk selinux" KEYWORDS="~amd64 ~x86" DEPEND="app-arch/zip @@ -70,10 +70,15 @@ eapply_user # This is really a bundled jdk not a jre - rm -rf "${S}/jre" || die "Could not remove bundled jdk" - + # If custom-jdk is not set bundled jre is replaced with system vm/jdk + if use custom-jdk; then + mv -f "${S}/jre" "${S}/custom-jdk" || die "Could not move bundled jdk" + else + rm -rf "${S}/jre" || die "Could not remove bundled jdk" + fi # Replace bundled jars with system # has problems with newer jdom:0 not updated to jdom:2 + cd "${S}/lib" || die local JARS="commons-logging log4j" local j @@ -99,14 +104,20 @@ insinto "${dir}" doins -r * - # Replaced bundled jre with system vm/jdk # This is really a bundled jdk not a jre - rm -rf "${ED%/}${dir}/jre" || die - dosym "../../etc/java-config-2/current-system-vm" "${dir}/jre" + # If custom-jdk is not set bundled jre is replaced with system vm/jdk + if use custom-jdk; then + dosym "${ED%/}${dir}/custom-jdk" "${dir}/jre" + else + dosym "../../etc/java-config-2/current-system-vm" "${dir}/jre" + fi - fperms 755 "${dir}/bin/studio.sh" "${dir}"/bin/fsnotifier{,64} + fperms 755 "${dir}"/bin/{fsnotifier{,64},printenv.py,restart.py,format.sh,inspect.sh,studio.sh} fperms -R 755 "${dir}"/bin/lldb/{android,bin} - chmod 755 "${ED%/}${dir}"/bin/*.py "${ED%/}${dir}"/bin/*.sh || die + if use custom-jdk; then + fperms -R 755 "${dir}"/jre/{bin,jre/bin} + fperms 755 ${dir}/jre/jre/lib/jexec + fi chmod 755 "${ED%/}${dir}"/gradle/gradle-*/bin/gradle || die newicon "bin/studio.png" "${PN}.png"
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9316b4996a9bc0ec06c41f1e9a699ef328cc6c4 commit a9316b4996a9bc0ec06c41f1e9a699ef328cc6c4 Author: Jason Zaman <perfinion@gentoo.org> AuthorDate: 2019-05-11 20:39:50 +0000 Commit: Jason Zaman <perfinion@gentoo.org> CommitDate: 2019-05-11 22:29:37 +0000 dev-util/android-studio: bump 3.4.0 Also add custom-jdk Closes: https://bugs.gentoo.org/675734 Package-Manager: Portage-2.3.62, Repoman-2.3.11 Signed-off-by: Jason Zaman <perfinion@gentoo.org> dev-util/android-studio/Manifest | 1 + .../android-studio-3.4.0.18.183.5452501.ebuild | 131 +++++++++++++++++++++ dev-util/android-studio/metadata.xml | 3 + 3 files changed, 135 insertions(+)