Diff roct-thunk-interface-6.1.2 with a binwalk-9999

/usr/portage/app-misc/binwalk/binwalk-9999.ebuild 2024-12-25 14:59:47.107270040 +0300
1
# Copyright 1999-2024 Gentoo Authors
1
# Copyright 2024 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
# Autogenerated by pycargoebuild 0.13.3
5

  
4 6
EAPI=8
5 7

  
6
LLVM_COMPAT=( 18 )
7
ROCM_SKIP_GLOBALS=1
8
inherit cmake linux-info llvm-r1 rocm
8
inherit cargo
9

  
10
DESCRIPTION="Analyzes data for embedded file types"
11
HOMEPAGE="https://github.com/ReFirmLabs/binwalk"
9 12

  
10
if [[ ${PV} == *9999 ]] ; then
11
	EGIT_REPO_URI="https://github.com/ROCm/ROCT-Thunk-Interface/"
13
if [[ ${PV} == 9999 ]] ; then
12 14
	inherit git-r3
15
	EGIT_REPO_URI="https://github.com/ReFirmLabs/binwalk.git"
13 16
else
14
	SRC_URI="https://github.com/ROCm/ROCT-Thunk-Interface/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz"
15
	S="${WORKDIR}/ROCT-Thunk-Interface-rocm-${PV}"
17
	SRC_URI="
18
		https://github.com/ReFirmLabs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
19
		${CARGO_CRATE_URIS}
20
	"
16 21
	KEYWORDS="~amd64"
17 22
fi
18 23

  
19
DESCRIPTION="Radeon Open Compute Thunk Interface"
20
HOMEPAGE="https://github.com/ROCm/ROCT-Thunk-Interface"
21
CONFIG_CHECK="~HSA_AMD ~HMM_MIRROR ~ZONE_DEVICE ~DRM_AMDGPU ~DRM_AMDGPU_USERPTR"
22 24
LICENSE="MIT"
23
SLOT="0/$(ver_cut 1-2)"
24

  
25
RDEPEND="sys-process/numactl
26
	x11-libs/libdrm[video_cards_amdgpu]"
27
DEPEND="${RDEPEND}
28
	test? (
29
		$(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}')
30
		dev-cpp/gtest
31
	)"
32

  
33
IUSE="test"
34
RESTRICT="!test? ( test )"
35

  
36
CMAKE_BUILD_TYPE=Release
37

  
38
PATCHES=(
39
	"${FILESDIR}/${PN}-5.7.1-musl.patch"
40
	"${FILESDIR}/${PN}-6.1.0-visibility.patch"
41
	"${FILESDIR}/kfdtest-6.1.0-linklibLLVM.patch"
42
	"${FILESDIR}/kfdtest-6.1.0-libpath.patch"
43
	"${FILESDIR}/kfdtest-6.1.0-skipIPCtest.patch"
44
)
45

  
46
test_wrapper() {
47
	local S="$1"
48
	shift 1
49
	local CMAKE_USE_DIR="${S}"
50
	local BUILD_DIR="${S}_build"
51
	cd "${S}" || die
52
	$@
53
}
54

  
55
src_prepare() {
56
	sed -e "s:get_version ( \"1.0.0\" ):get_version ( \"${PV}\" ):" -i CMakeLists.txt || die
57
	cmake_src_prepare
58
}
59

  
60
src_configure() {
61
	local mycmakeargs=(
62
		-DCPACK_PACKAGING_INSTALL_PREFIX="${EPREFIX}/usr"
63
	)
64
	cmake_src_configure
65

  
66
	if use test; then
67
		export LIBHSAKMT_PATH="${BUILD_DIR}"
68
		local mycmakeargs=(
69
			-DLLVM_DIR="$(get_llvm_prefix)"
70
		)
71
		test_wrapper "${S}/tests/kfdtest" cmake_src_configure
72
	fi
73
}
74

  
75
src_compile() {
76
	cmake_src_compile
77
	if use test; then
78
		LIBRARY_PATH="${BUILD_DIR}" test_wrapper "${S}/tests/kfdtest" cmake_src_compile
25
# Dependent crate licenses
26
LICENSE+=" Boost-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016"
27
SLOT="3"
28

  
29
src_unpack() {
30
	if [[ "${PV}" == *9999* ]]; then
31
		git-r3_src_unpack
32
		cargo_live_src_unpack
33
	else
34
		cargo_src_unpack
79 35
	fi
80 36
}
81 37

  
82
src_test() {
83
	check_amdgpu
84
	TESTDIR="${S}/tests/kfdtest_build/"
85
	cd "${TESTDIR}" || die
86
	PATH="${PATH}:${TESTDIR}" ./run_kfdtest.sh
38
src_install() {
39
	newbin "$(cargo_target_dir)/binwalk" binwalk3
87 40
}
Thank you!