summaryrefslogtreecommitdiff
blob: 4b3f96db0d10093b59037b9ec60b5ded80e69507 (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..12} )
CMAKE_BUILD_TYPE=Release

inherit cmake linux-info python-single-r1

DESCRIPTION="Record and Replay Framework"
HOMEPAGE="https://rr-project.org/"
SRC_URI="https://github.com/rr-debugger/${PN}/archive/${PV}.tar.gz -> mozilla-${P}.tar.gz"

# rr itself is MIT and BSD-2, but there's various bits under third-party too.
LICENSE="MIT BSD-2 GPL-2 ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="multilib test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="
	${PYTHON_DEPS}
	dev-libs/capnproto:=
	sys-libs/zlib:=
"
RDEPEND="
	${DEPEND}
	dev-debug/gdb[xml]
"
# Add all the deps needed only at build/test time.
DEPEND+="
	test? (
		$(python_gen_cond_dep '
			dev-python/pexpect[${PYTHON_USEDEP}]
		')
		dev-debug/gdb[xml]
	)"

QA_FLAGS_IGNORED="
	usr/lib.*/rr/librrpage.so
	usr/lib.*/rr/librrpage_32.so
"

RESTRICT="test" # toolchain and kernel version dependent

PATCHES=(
	"${FILESDIR}"/${PN}-5.7.0-no-force-lto.patch
)

pkg_setup() {
	if use kernel_linux; then
		CONFIG_CHECK="SECCOMP"
		linux-info_pkg_setup
	fi
	python-single-r1_pkg_setup
}

src_prepare() {
	cmake_src_prepare

	sed -i 's:-Werror::' CMakeLists.txt || die #609192
}

src_test() {
	if has usersandbox ${FEATURES} ; then
		ewarn "Test suite fails under FEATURES=usersandbox (bug #632394). Skipping."
		return 0
	fi

	cmake_src_test
}

src_configure() {
	local mycmakeargs=(
		-DBUILD_TESTS=$(usex test)
		-Ddisable32bit=$(usex !multilib) #636786
	)

	cmake_src_configure
}

src_install() {
	cmake_src_install

	python_fix_shebang "${ED}"/usr/bin/rr-collect-symbols.py
	python_newscript scripts/zen_workaround.py rr-zen_workaround.py
}