summaryrefslogtreecommitdiff
path: root/dev-util/rust-rover/rust-rover-2026.2.1.ebuild
blob: 4d08619334c0ba64224d985cdd606cc4ee2d4142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop wrapper xdg-utils

DESCRIPTION="A feature-rich Rust IDE with timely support by JetBrains"
HOMEPAGE="https://www.jetbrains.com/rust/"
SRC_URI="https://download.jetbrains.com/rustrover/RustRover-${PV}.tar.gz"

S="${WORKDIR}/RustRover-${PV}"

LICENSE="|| ( JetBrains-business JetBrains-classroom JetBrains-educational JetBrains-individual )
	Apache-2.0
	BSD
	CC0-1.0
	CDDL
	CDDL-1.1
	EPL-1.0
	GPL-2
	GPL-2-with-classpath-exception
	ISC
	LGPL-2.1
	LGPL-3
	MIT
	MPL-1.1
	OFL-1.1
	ZLIB
"

SLOT="0"
KEYWORDS="-* ~amd64"
IUSE="+bundled-jdk nvidia"

RESTRICT="bindist mirror"

QA_PREBUILT="opt/RustRover/*"

BDEPEND="
	dev-util/patchelf
"

RDEPEND="
	!bundled-jdk? ( >=virtual/jre-1.8 )
	>=app-accessibility/at-spi2-core-2.46.0:2
	dev-debug/gdb
	dev-libs/openssl-compat:1.1.1
	dev-libs/expat
	dev-libs/glib:2
	dev-libs/nspr
	dev-libs/nss
	dev-libs/wayland
	media-libs/alsa-lib
	media-libs/freetype:2
	media-libs/mesa
	net-print/cups
	sys-apps/dbus
	virtual/zlib:=
	virtual/libcrypt:=
	x11-libs/cairo
	x11-libs/libdrm
	x11-libs/libX11
	x11-libs/libXcomposite
	x11-libs/libXcursor
	x11-libs/libXdamage
	x11-libs/libXext
	x11-libs/libXfixes
	x11-libs/libXi
	x11-libs/libXrandr
	x11-libs/libXrender
	x11-libs/libXtst
	x11-libs/libXxf86vm
	x11-libs/libxcb
	x11-libs/libxkbcommon
	x11-libs/pango
"

src_prepare() {
	default

	local remove_me=(
		Install-Linux-tar.txt
		bin/gdb
		plugins/remote-dev-server/selfcontained
		plugins/gateway-plugin/lib/remote-dev-workers/remote-dev-worker-linux-arm64
		plugins/nativeDebug-plugin/bin/lldb/linux/aarch64
		plugins/platform-ijent-bundledBinaries/ijent-aarch64-unknown-linux-musl-release
		lib/async-profiler/aarch64
	)

	rm -rv "${remove_me[@]}" || die

	sed -i \
		-e "\$a\\\\" \
		-e "\$a#-----------------------------------------------------------------------" \
		-e "\$a# Disable automatic updates as these are handled through Gentoo's" \
		-e "\$a# package manager. See bug #704494" \
		-e "\$a#-----------------------------------------------------------------------" \
		-e "\$aide.no.platform.update=Gentoo" \
		bin/idea.properties || die

	local file
	for file in "plugins/jcef-plugin/jcef"/{libjcef.so,jcef_helper}; do
		if [[ -f ${file} ]]; then
			patchelf --set-rpath '$ORIGIN' "${file}" || die
		fi
	done

	if use nvidia; then
		grep -q '^-Dide.browser.jcef.out-of-process.enabled=' \
			bin/rustrover64.vmoptions \
			|| echo "-Dide.browser.jcef.out-of-process.enabled=false" \
			>> bin/rustrover64.vmoptions \
			|| die
	fi
}

src_install() {
	local dir="/opt/RustRover"

	dodir "${dir}"
	cp -a "${S}/." "${ED}${dir}/" || die

	if ! use bundled-jdk; then
		rm -r "${ED}${dir}/jbr" || die
	fi

	make_wrapper "rustrover" "${dir}/bin/rustrover"

	newicon "bin/rustrover.svg" "rustrover.svg"
	make_desktop_entry \
		"rustrover" \
		"RustRover" \
		"rustrover" \
		"Development;IDE;"

	# Recommended for JetBrains IDE file watching.
	dodir /etc/sysctl.d
	echo "fs.inotify.max_user_watches = 524288" \
		> "${ED}/etc/sysctl.d/30-idea-inotify-watches.conf" \
		|| die
}

pkg_postinst() {
	xdg_icon_cache_update
}

pkg_postrm() {
	xdg_icon_cache_update
}