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

EAPI=8

LLVM_COMPAT=( 18 )

inherit cmake llvm-r1

DESCRIPTION="A set of tools to translate CUDA source code into portable HIP C++"
HOMEPAGE="https://github.com/ROCm/HIPIFY"
SRC_URI="https://github.com/ROCm/HIPIFY/archive/rocm-${PV}.tar.gz -> HIPIFY-${PV}.tar.gz"
S="${WORKDIR}/HIPIFY-rocm-${PV}"

LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"

BDEPEND=">=dev-build/cmake-3.22"
DEPEND="
	$(llvm_gen_dep '
		sys-devel/clang:${LLVM_SLOT}=
		sys-devel/llvm:${LLVM_SLOT}=
	')
"

PATCHES=(
	"${FILESDIR}/${PN}-5.7.1-fix-clang-libs.patch"
)

src_prepare() {
	cmake_src_prepare
	sed -i 's:/../libexec/hipify::' \
		bin/hipconvertinplace.sh bin/hipconvertinplace-perl.sh \
		bin/hipexamine-perl.sh bin/hipexamine.sh || die
}

src_configure() {
	local mycmakeargs=(
		-DCMAKE_PREFIX_PATH="$(get_llvm_prefix)/$(get_libdir)/cmake/llvm"
	)

	cmake_src_configure
}

src_install() {
	cmake_src_install

	# rm unwanted copy
	rm -rf "${ED}/usr/hip" || die
}