mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-04 12:18:08 -07:00
Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/45826 Signed-off-by: Sam James <sam@gentoo.org>
68 lines
1.4 KiB
Bash
68 lines
1.4 KiB
Bash
# Copyright 1999-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
LLVM_COMPAT=( 22 )
|
|
inherit cmake llvm-r2
|
|
|
|
DESCRIPTION="Radeon Open Compute hipcc"
|
|
HOMEPAGE="https://github.com/ROCm/llvm-project/tree/amd-staging/amd/hipcc"
|
|
|
|
MY_P=llvm-project-rocm-${PV}
|
|
components=( "amd/hipcc" )
|
|
if [[ ${PV} == *9999 ]] ; then
|
|
EGIT_REPO_URI="https://github.com/ROCm/llvm-project"
|
|
inherit git-r3
|
|
S="${WORKDIR}/${P}/${components[0]}"
|
|
else
|
|
SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz"
|
|
S="${WORKDIR}/${MY_P}/${components[0]}"
|
|
KEYWORDS="~amd64"
|
|
fi
|
|
|
|
LICENSE="Apache-2.0 MIT"
|
|
SLOT="0/$(ver_cut 1-2)"
|
|
IUSE="debug"
|
|
|
|
DEPEND="
|
|
$(llvm_gen_dep "
|
|
llvm-runtimes/compiler-rt:\${LLVM_SLOT}=
|
|
llvm-core/llvm:\${LLVM_SLOT}=
|
|
llvm-core/clang:\${LLVM_SLOT}=
|
|
")
|
|
"
|
|
RDEPEND="${DEPEND}"
|
|
|
|
src_unpack() {
|
|
if [[ ${PV} == *9999 ]] ; then
|
|
git-r3_fetch
|
|
git-r3_checkout '' . '' "${components[@]}"
|
|
else
|
|
archive="${MY_P}.tar.gz"
|
|
ebegin "Unpacking from ${archive}"
|
|
tar -x -z -o \
|
|
-f "${DISTDIR}/${archive}" \
|
|
"${components[@]/#/${MY_P}/}" || die
|
|
eend ${?}
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
cmake_src_prepare
|
|
|
|
sed -e "s:lib/llvm/bin:lib/llvm/${LLVM_SLOT}/bin:" \
|
|
-e "s:/opt/rocm:/usr:g" \
|
|
-i src/hipBin_base.h \
|
|
-i src/hipBin_amd.h || die
|
|
|
|
sed -e "s:amdgcn/bitcode:lib/amdgcn/bitcode:g" \
|
|
-i src/hipBin_amd.h || die
|
|
}
|
|
|
|
src_install() {
|
|
cmake_src_install
|
|
# remove bat files...
|
|
rm -rf "${ED}/usr/hip" || die
|
|
}
|