blob: 39a83883d88258eaff4e819dfcb90f27dfdb18f7 (
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
|
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop fcaps wrapper xdg udev
DESCRIPTION="All-in-one stability, stress test, benchmark and monitoring tool"
HOMEPAGE="https://www.ocbase.com"
SRC_URI="https://www.ocbase.com/download/edition:Personal/os:Linux/version:${PV} -> ${P}.bin"
S="${WORKDIR}"
LICENSE="OCBASE-EULA"
SLOT="0"
KEYWORDS="~amd64"
IUSE="msr-user-access"
RESTRICT="bindist mirror strip"
QA_PREBUILT="/opt/occt/occt"
src_unpack() {
cp "${DISTDIR}"/"${P}".bin ./
}
src_install() {
newicon -s 256 "${FILESDIR}"/occt.png occt.png
insinto /opt/occt
newins "${P}".bin occt
# Disable automatic updates
touch "${ED}"/opt/occt/disable_update
# Don't use binary path as the config location
touch "${ED}"/opt/occt/use_home_config
fperms +x /opt/occt/occt
domenu "${FILESDIR}"/occt.desktop
make_wrapper occt /opt/occt/occt
use msr-user-access && udev_dorules "${FILESDIR}/90-occt-msr-access.rules"
}
pkg_postinst() {
# Allow benchmarks to run with higher priority and /dev/cpu/*/msr access
fcaps "cap_sys_nice,cap_sys_rawio=eip" opt/occt/occt
# Apply the udev rules
use msr-user-access && udev_reload && udevadm trigger --action=add --subsystem-match=msr
einfo ""
einfo "If you have a license, you need to copy it into the OCCT config directory:"
einfo ""
einfo " mkdir -p ~/.config/occt && cp license.okl ~/.config/occt/"
einfo ""
}
|