Diff pycharm-professional-2023.2 with a pycharm-professional-2024.3.2

/usr/portage/dev-util/pycharm-professional/pycharm-professional-2024.3.2.ebuild 2025-07-29 16:22:14.252455004 +0300
1
# Copyright 1999-2023 Gentoo Authors
1
# Copyright 1999-2025 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
inherit desktop readme.gentoo-r1 wrapper xdg-utils
6
inherit desktop readme.gentoo-r1 wrapper xdg
7 7

  
8
MY_PN=${PN/-professional/}
9 8
DESCRIPTION="Intelligent Python IDE with unique code assistance and analysis"
9

  
10
# NOTE upstream release info
11
# https://data.services.jetbrains.com/products?code=PCP,PCC&release.type=release
12
# https://data.services.jetbrains.com/products?code=PCP,PCC&release.type=release&fields=name,releases
13

  
10 14
HOMEPAGE="https://www.jetbrains.com/pycharm/"
11
SRC_URI="https://download.jetbrains.com/python/${P}.tar.gz"
12
S="${WORKDIR}/${MY_PN}-${PV}"
15
SRC_URI="
16
	amd64? (
17
		https://download.jetbrains.com/python/${P}.tar.gz
18
	)
19
	arm64? (
20
		https://download.jetbrains.com/python/${P}-aarch64.tar.gz
21
	)
22
	x86? (
23
		https://download.jetbrains.com/python/${P}.tar.gz
24
	)
25
"
26

  
27
if [[ ${PN} == *-professional ]]; then
28
	S="${WORKDIR}/${PN/%-professional/}-${PV}"
29
	LICENSE="|| ( JetBrains-business JetBrains-classroom JetBrains-educational JetBrains-individual )
30
	Apache-2.0 BSD BSD-2 CC0-1.0 CC-BY-2.5 CC-BY-3.0 CC-BY-4.0 CPL-1.0 CDDL CDDL-1.1 EPL-1.0 EPL-2.0
31
	GPL-2 GPL-2-with-classpath-exception ISC JDOM LGPL-2.1 LGPL-3 MIT MPL-1.1 MPL-2.0 OFL-1.1
32
	PYTHON Unicode-DFS-2016 Unlicense UPL-1.0 ZLIB"
33
else
34
	LICENSE="|| ( JetBrains-business JetBrains-classroom JetBrains-educational JetBrains-individual )
35
	Apache-2.0 BSD BSD-2 CC0-1.0 CC-BY-2.5 CC-BY-3.0 CPL-1.0 CDDL-1.1 EPL-1.0 GPL-2
36
	GPL-2-with-classpath-exception ISC JDOM JSON LGPL-2+ LGPL-2.1 LGPL-3 MIT MPL-1.1 MPL-2.0
37
	OFL-1.1 UPL-1.0 ZLIB"
38
fi
13 39

  
14
LICENSE="PyCharm_Academic PyCharm_Classroom PyCharm PyCharm_OpenSource PyCharm_Preview"
15 40
SLOT="0"
16
KEYWORDS="amd64 x86"
41
KEYWORDS="-* amd64 ~arm64 x86"
17 42
IUSE="+bundled-jdk"
18 43

  
19
BDEPEND="dev-util/patchelf"
44
if [[ ${PN} == *-professional ]]; then
45
	IUSE+=" +bundled-xvfb"
46
fi
20 47

  
21
RDEPEND="!bundled-jdk? ( >=virtual/jre-1.8 )
22
	app-accessibility/at-spi2-core:2
23
	dev-libs/expat
24
	dev-libs/glib:2
25
	dev-libs/nspr
26
	dev-libs/nss
27
	dev-python/pip
28
	media-fonts/dejavu
29
	media-libs/alsa-lib
30
	media-libs/freetype:2=
31
	media-libs/mesa
32
	net-print/cups
33
	sys-apps/dbus
34
	sys-libs/zlib
35
	x11-libs/libX11
36
	x11-libs/libxcb
37
	x11-libs/libXext
38
	x11-libs/libXi
39
	x11-libs/libXrandr
40
	x11-libs/libXrender
41
	x11-libs/libXtst
42
	x11-libs/pango
43
	x11-libs/cairo
44
	x11-libs/libdrm
45
	x11-libs/libXcomposite
46
	x11-libs/libXcursor
47
	x11-libs/libXdamage
48
	x11-libs/libXfixes
49
	x11-libs/libxkbcommon
50
	x11-libs/libXxf86vm
48
BDEPEND="dev-util/debugedit
49
	dev-util/patchelf
51 50
"
52 51

  
53
RESTRICT="mirror"
52
# NOTE
53
#  The remote-dev-server present in pycharm-professional contains most of the
54
#  libraries need for the bundled jdk. These are not in the RUNPATH of the jdk.
55
#  So the dependencies are actually needed.
56
RDEPEND="
57
	!bundled-jdk? (
58
		>=virtual/jre-17:*
59
	)
60
	bundled-jdk? (
61
		app-accessibility/at-spi2-core:2
62
		dev-libs/expat
63
		dev-libs/glib:2
64
		dev-libs/nspr
65
		dev-libs/nss
66
		dev-libs/wayland
67
		media-libs/alsa-lib
68
		media-libs/freetype
69
		media-libs/mesa
70
		net-print/cups
71
		sys-apps/dbus
72
		sys-libs/zlib
73
		x11-libs/cairo
74
		x11-libs/libX11
75
		x11-libs/libXcomposite
76
		x11-libs/libXcursor
77
		x11-libs/libXdamage
78
		x11-libs/libXext
79
		x11-libs/libXfixes
80
		x11-libs/libXi
81
		x11-libs/libXrandr
82
		x11-libs/libXrender
83
		x11-libs/libXtst
84
		x11-libs/libXxf86vm
85
		x11-libs/libdrm
86
		x11-libs/libxcb
87
		x11-libs/libxkbcommon
88
		x11-libs/pango
89
	)
90
"
91

  
92
if [[ ${PN} == *-professional ]]; then
93
RDEPEND+="
94
	bundled-xvfb? (
95
		dev-libs/libpcre2
96
		sys-libs/pam
97
		sys-process/audit
98
	)
99
	!bundled-xvfb? (
100
		x11-base/xorg-server[xvfb]
101
	)
102
"
103
fi
54 104

  
55
QA_PREBUILT="opt/${P}/*"
105
QA_PREBUILT="opt/${PN}/*"
56 106

  
57 107
src_prepare() {
58 108
	default
59
	local remove_me=(
60
		help/ReferenceCardForMac.pdf
61
		plugins/remote-dev-server/selfcontained
62
		plugins/python/helpers/pydev/pydevd_attach_to_process/attach_linux_x86.so
63
		plugins/python/helpers/pydev/pydevd_attach_to_process/attach_linux_amd64.so
64
		plugins/python/helpers/pydev/pydevd_attach_to_process/attach_linux_aarch64.so
65
		plugins/cwm-plugin/quiche-native/linux-aarch64
66
		plugins/tailwindcss  # Relies on masked package sys-libs/musl
67
)
68 109

  
69
	rm -rv "${remove_me[@]}" || die
110
	rm -v  "${S}"/help/ReferenceCardForMac.pdf || die
111

  
112
	rm -v "${S}"/plugins/python-ce/helpers/pydev/_pydevd_{bundle,frame_eval}/*{darwin,win32}* || die
113

  
114
	if ! use amd64; then
115
		rm -v  "${S}"/plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_linux_amd64.so || die
116
		if [[ -d "${S}"/lib/async-profiler/ ]]; then
117
			rm -v  "${S}"/lib/async-profiler/amd64/libasyncProfiler.so || die
118
		fi
119
	fi
120
	if ! use arm64; then
121
		rm -v  "${S}"/plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_linux_aarch64.so || die
122
		if [[ -d "${S}"/lib/async-profiler/ ]]; then
123
			rm -v  "${S}"/lib/async-profiler/aarch64/libasyncProfiler.so || die
124
		fi
125
	fi
126
	if ! use x86; then
127
		rm -v  "${S}"/plugins/python-ce/helpers/pydev/pydevd_attach_to_process/attach_linux_x86.so || die
128
	fi
70 129

  
71 130
	sed -i \
72 131
		-e "\$a\\\\" \
......
74 133
		-e "\$a# Disable automatic updates as these are handled through Gentoo's" \
75 134
		-e "\$a# package manager. See bug #704494" \
76 135
		-e "\$a#-----------------------------------------------------------------------" \
77
		-e "\$aide.no.platform.update=Gentoo" \
78
		bin/idea.properties || die
136
		-e "\$aide.no.platform.update=Gentoo" bin/idea.properties
79 137

  
80
	local file
81
	for file in jbr/lib/{libjcef.so,jcef_helper}; do
82
		if [[ -f ${file} ]]; then
83
			patchelf --set-rpath '$ORIGIN' ${file} || die
138
	# removing debug symbols and relocating debug files as per #876295
139
	find . -type f -exec sh -c 'file "{}" | grep -qE "ELF (32|64)-bit" && \
140
		objcopy --remove-section .note.gnu.build-id "{}" && \
141
		debugedit -b "${EPREFIX}/opt/${PN}" -d "/usr/lib/debug" -i "{}"' \;
142

  
143
	if use bundled-jdk; then
144
		patchelf --set-rpath '$ORIGIN/../lib' "jbr/bin/"* || die
145
		patchelf --set-rpath '$ORIGIN' "jbr/lib/"{libjcef.so,jcef_helper} || die
146
		patchelf --set-rpath '$ORIGIN:$ORIGIN/server' jbr/lib/lib*.so* || die
147
	else
148
		rm -r "jbr" || die
149
	fi
150

  
151
	if [[ ${PN} == *-professional ]]; then
152
		if use bundled-xvfb; then
153
			patchelf --set-rpath '$ORIGIN/../lib' "${S}"/plugins/remote-dev-server/selfcontained/bin/{Xvfb,xkbcomp} || die
154
			patchelf --set-rpath '$ORIGIN' "${S}"/plugins/remote-dev-server/selfcontained/lib/lib*.so* || die
155
		else
156
			rm -vr "${S}"/plugins/remote-dev-server/selfcontained || die
157
			sed '/export REMOTE_DEV_SERVER_IS_NATIVE_LAUNCHER/a export REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=1' \
158
			  -i bin/remote-dev-server.sh || die
84 159
		fi
85
	done
160
	fi
161
}
162

  
163
src_configure() {
164
	:;
165
}
166

  
167
src_compile() {
168
	:;
86 169
}
87 170

  
88 171
src_install() {
89
	local dir="/opt/${PN}"
90
	local jre_dir="jbr"
172
	local DIR="/opt/${PN}"
173
	local JRE_DIR="jbr"
91 174

  
92
	insinto ${dir}
93
	doins -r *
175
	insinto "${DIR}"
176
	doins -r ./*
94 177

  
95
	if ! use bundled-jdk; then
96
		rm -r "${jre_dir}" || die
97
	fi
178
	fperms 755 "${DIR}"/bin/{format.sh,fsnotifier,inspect.sh,jetbrains_client.sh,ltedit.sh,pycharm,pycharm.sh,restarter}
98 179

  
99
	fperms 755 ${dir}/bin/{format.sh,fsnotifier,inspect.sh,ltedit.sh,pycharm.sh,restart.py}
180
	if use bundled-jdk; then
181
		fperms 755 "${DIR}/${JRE_DIR}"/bin/{java,javac,javadoc,jcmd,jdb,jfr,jhsdb,jinfo,jmap,jps,jrunscript,jstack,jstat,jwebserver,keytool,rmiregistry,serialver}
182
		fperms 755 "${DIR}"/"${JRE_DIR}"/lib/{cef_server,chrome-sandbox,jcef_helper,jexec,jspawnhelper}
183
	fi
100 184

  
101
	fperms 755 "${dir}"/"${jre_dir}"/bin/{java,javac,javadoc,jcmd,jdb,jfr,jhsdb,jinfo,jmap,jps,jrunscript,jstack,jstat,keytool,rmiregistry,serialver}
102
	fperms 755 "${dir}"/"${jre_dir}"/lib/{chrome-sandbox,jcef_helper,jexec,jspawnhelper}
185
	if [[ ${PN} == *-professional ]]; then
186
		if use bundled-xvfb; then
187
			fperms 755 "${DIR}"/plugins/remote-dev-server/selfcontained/bin/{Xvfb,xkbcomp}
188
		fi
189
		fperms 755 "${DIR}" "${DIR}"/bin/remote-dev-server{,.sh}
190
	fi
103 191

  
104
	make_wrapper ${PN} ${dir}/bin/pycharm.sh
105
	newicon bin/${MY_PN}.png ${PN}.png
106
	make_desktop_entry ${PN} ${PN} ${PN}
192
	make_wrapper "${PN}" "${DIR}/bin/pycharm"
193
	newicon "bin/${PN/%-*/}.png" "${PN}.png"
194
	make_desktop_entry "${PN}" "${PN}" "${PN}"
107 195

  
108 196
	readme.gentoo_create_doc
109 197

  
110 198
	# recommended by: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
111
	insinto /usr/lib/sysctl.d
112
	newins - 30-idea-inotify-watches.conf <<<"fs.inotify.max_user_watches = 524288"
113
}
114

  
115
pkg_postinst() {
116
	readme.gentoo_print_elog
117
	xdg_icon_cache_update
199
	dodir /usr/lib/sysctl.d
200
	cat > "${ED}/usr/lib/sysctl.d/30-${PN}-inotify-watches.conf" <<-EOF || die
201
		fs.inotify.max_user_watches = 524288
202
	EOF
118 203
}
Thank you!