dev-util/clion: add use flag for jdk selection
authorChristian Strahl <c.a.strahl@gmail.com>
Mon, 6 Aug 2018 09:11:31 +0000 (11:11 +0200)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Mon, 6 Aug 2018 15:46:37 +0000 (08:46 -0700)
dev-util/clion/clion-2018.2.ebuild
dev-util/clion/metadata.xml

index f7113f1c19cb538d9cc080461d3dd728c29f675b..d000021e40fe6a108fc11f3c5c545646943d9b1a 100644 (file)
@@ -14,12 +14,14 @@ LICENSE="IDEA
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 RESTRICT="splitdebug"
+IUSE="-custom-jdk"
 
 # RDEPENDS may cause false positives in repoman.
 # clion requires cmake and gdb at runtime to build and debug C/C++ projects
 RDEPEND="
        sys-devel/gdb
-       dev-util/cmake"
+       dev-util/cmake
+       !custom-jdk? ( virtual/jdk )"
 
 QA_PREBUILT="opt/${P}/*"
 
@@ -40,6 +42,8 @@ src_prepare() {
        use ppc || remove_me+=( plugins/tfsIntegration/lib/native/linux/ppc )
        use x86 || remove_me+=( plugins/tfsIntegration/lib/native/linux/x86 )
 
+       use custom-jdk || remove_me+=( jre64 )
+
        rm -rv "${remove_me[@]}" || die
 }
 
@@ -50,6 +54,12 @@ src_install() {
        doins -r *
        fperms 755 "${dir}"/bin/{clion.sh,fsnotifier{,64},clang/linux/clang{d,-tidy}}
 
+       if use custom-jdk; then
+               if [[ -d jre64 ]]; then
+               fperms 755 "${dir}"/jre64/bin/{java,jjs,keytool,orbd,pack200,policytool,rmid,rmiregistry,servertool,tnameserv,unpack200}
+               fi
+       fi
+
        make_wrapper "${PN}" "${dir}/bin/${PN}.sh"
        newicon "bin/${PN}.svg" "${PN}.svg"
        make_desktop_entry "${PN}" "clion" "${PN}" "Development;IDE;"
index 4f7225e07bb7f692da58ee8614c819f34d2a6844..fd24c2d5ef8b4e60eedfebb2e9f8c9d004a8f220 100644 (file)
@@ -12,4 +12,7 @@
        <longdescription lang="en">
                Fully Integrated C/C++ Development Environment.
        </longdescription>
+       <use>
+               <flag name="custom-jdk">Install and use IntelliJ's custom JRE.</flag>
+       </use>
 </pkgmetadata>