Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/idea-community/
Date: Thu, 21 May 2020 23:15:30
Message-Id: 1590102913.3fbe72b216ce5ff1a993b26515931cce4df938b9.mpagano@gentoo
1 commit: 3fbe72b216ce5ff1a993b26515931cce4df938b9
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 21 23:15:13 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu May 21 23:15:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fbe72b2
7
8 dev-util/idea-community: Fix patchelf for lldb
9
10 Closes: https://bugs.gentoo.org/721878
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
13
14 .../idea-community-2020.1.1.201.7223.91-r2.ebuild | 142 +++++++++++++++++++++
15 1 file changed, 142 insertions(+)
16
17 diff --git a/dev-util/idea-community/idea-community-2020.1.1.201.7223.91-r2.ebuild b/dev-util/idea-community/idea-community-2020.1.1.201.7223.91-r2.ebuild
18 new file mode 100644
19 index 00000000000..3cbd1755d15
20 --- /dev/null
21 +++ b/dev-util/idea-community/idea-community-2020.1.1.201.7223.91-r2.ebuild
22 @@ -0,0 +1,142 @@
23 +# Copyright 1999-2020 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +inherit eutils desktop
28 +
29 +SLOT="0"
30 +PV_STRING="$(ver_cut 2-6)"
31 +MY_PV="$(ver_cut 1-3)"
32 +MY_PN="idea"
33 +# Using the most recent Jetbrains Runtime binaries available at the time of writing
34 +# As the exact bundled versions ( jre 11 build 159.30 and jre 8 build 1483.39 ) aren't
35 +# available separately
36 +JRE11_BASE="11_0_2"
37 +JRE11_VER="164"
38 +JRE_BASE="8u202"
39 +JRE_VER="1483.37"
40 +
41 +# distinguish settings for official stable releases and EAP-version releases
42 +if [[ "$(ver_cut 7)"x = "prex" ]]
43 +then
44 + # upstream EAP
45 + KEYWORDS=""
46 + SRC_URI="https://download.jetbrains.com/idea/${MY_PN}IC-${PV_STRING}.tar.gz"
47 +else
48 + # upstream stable
49 + KEYWORDS="~amd64 ~x86"
50 + SRC_URI="https://download.jetbrains.com/idea/${MY_PN}IC-${MY_PV}-no-jbr.tar.gz -> ${MY_PN}IC-${PV_STRING}_20200507.tar.gz
51 + jbr8? ( x86? ( https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrx-${JRE_BASE}-linux-i586-b${JRE_VER}.tar.gz -> jbrx-${JRE_BASE}-linux-i586-b${JRE_VER}.tar.gz )
52 + amd64? ( https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbrx-${JRE_BASE}-linux-x64-b${JRE_VER}.tar.gz -> jbrx-${JRE_BASE}-linux-x64-b${JRE_VER}.tar.gz ) )
53 + jbr11? ( amd64? ( https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbr-${JRE11_BASE}-linux-x64-b${JRE11_VER}.tar.gz -> jbr-${JRE11_BASE}-linux-x64-b${JRE11_VER}.tar.gz ) )"
54 +fi
55 +
56 +DESCRIPTION="A complete toolset for web, mobile and enterprise development"
57 +HOMEPAGE="https://www.jetbrains.com/idea"
58 +
59 +LICENSE="Apache-2.0 BSD BSD-2 CC0-1.0 CC-BY-2.5 CDDL-1.1
60 + codehaus-classworlds CPL-1.0 EPL-1.0 EPL-2.0 jbr8? ( GPL-2 )
61 + jbr11? ( GPL-2 ) GPL-2 GPL-2-with-classpath-exception ISC
62 + JDOM LGPL-2.1 LGPL-2.1+ LGPL-3-with-linking-exception MIT
63 + MPL-1.0 MPL-1.1 OFL ZLIB"
64 +
65 +#Splitting custom-jdk into jbr8 and jbr11 as upstream now offers downloads with
66 +#either (or neither) bundled
67 +#Defaulting to jbr8 to match upstream
68 +IUSE="+jbr8 -jbr11"
69 +REQUIRED_USE="jbr8? ( !jbr11 )"
70 +
71 +DEPEND="!dev-util/${PN}:14
72 + !dev-util/${PN}:15"
73 +RDEPEND="${DEPEND}
74 + >=virtual/jdk-1.7:*
75 + dev-java/jansi-native
76 + dev-libs/libdbusmenu
77 + dev-util/lldb"
78 +BDEPEND="dev-util/patchelf"
79 +RESTRICT="splitdebug"
80 +S="${WORKDIR}/${MY_PN}-IC-$(ver_cut 4-6)"
81 +
82 +QA_PREBUILT="opt/${PN}-${MY_PV}/*"
83 +
84 +# jbr11 binary doesn't unpack nicely into a single folder
85 +src_unpack() {
86 + default_src_unpack
87 + if use jbr11 ; then
88 + mkdir jre64 && cd jre64 && unpack jbr-${JRE11_BASE}-linux-x64-b${JRE11_VER}.tar.gz
89 + fi
90 +}
91 +
92 +src_prepare() {
93 + if use amd64; then
94 + JRE_DIR=jre64
95 + else
96 + JRE_DIR=jre
97 + fi
98 +
99 + if use jbr8; then
100 + mv "${WORKDIR}/jre" ./"${JRE_DIR}"
101 + PLUGIN_DIR="${S}/${JRE_DIR}/lib/${ARCH}"
102 + else
103 + PLUGIN_DIR="${S}/${JRE_DIR}/lib/"
104 + fi
105 +
106 + rm -vf ${PLUGIN_DIR}/libavplugin*
107 + rm -vf "${S}"/plugins/maven/lib/maven3/lib/jansi-native/*/libjansi*
108 + rm -vrf "${S}"/lib/pty4j-native/linux/ppc64le
109 + rm -vf "${S}"/bin/libdbm64*
110 +
111 + if [[ -d "${S}"/"${JRE_DIR}" ]]; then
112 + for file in "${PLUGIN_DIR}"/{libfxplugins.so,libjfxmedia.so}
113 + do
114 + if [[ -f "$file" ]]; then
115 + patchelf --set-rpath '$ORIGIN' $file || die
116 + fi
117 + done
118 + fi
119 +
120 + patchelf --set-rpath '$ORIGIN' "${S}"/plugins/Kotlin/bin/linux/LLDBFrontend || die
121 +
122 + sed -i \
123 + -e "\$a\\\\" \
124 + -e "\$a#-----------------------------------------------------------------------" \
125 + -e "\$a# Disable automatic updates as these are handled through Gentoo's" \
126 + -e "\$a# package manager. See bug #704494" \
127 + -e "\$a#-----------------------------------------------------------------------" \
128 + -e "\$aide.no.platform.update=Gentoo" bin/idea.properties
129 +
130 + eapply_user
131 +}
132 +
133 +src_install() {
134 + local dir="/opt/${PN}-${MY_PV}"
135 +
136 + insinto "${dir}"
137 + doins -r *
138 + fperms 755 "${dir}"/bin/{format.sh,idea.sh,inspect.sh,printenv.py,restart.py,fsnotifier{,64}}
139 + if use amd64; then
140 + JRE_DIR=jre64
141 + else
142 + JRE_DIR=jre
143 + fi
144 + if use jbr8 || use jbr11 ; then
145 + if use jbr8; then
146 + JRE_BINARIES="java jjs keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200"
147 + else
148 + JRE_BINARIES="jaotc java javapackager jjs jrunscript keytool pack200 rmid rmiregistry unpack200"
149 + fi
150 + if [[ -d ${JRE_DIR} ]]; then
151 + for jrebin in $JRE_BINARIES; do
152 + fperms 755 "${dir}"/"${JRE_DIR}"/bin/"${jrebin}"
153 + done
154 + fi
155 + fi
156 +
157 + make_wrapper "${PN}" "${dir}/bin/${MY_PN}.sh"
158 + newicon "bin/${MY_PN}.png" "${PN}.png"
159 + make_desktop_entry "${PN}" "IntelliJ Idea Community" "${PN}" "Development;IDE;"
160 +
161 + # recommended by: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
162 + mkdir -p "${D}/etc/sysctl.d/" || die
163 + echo "fs.inotify.max_user_watches = 524288" > "${D}/etc/sysctl.d/30-idea-inotify-watches.conf" || die
164 +}