another one

This commit is contained in:
TheK0tYaRa 2025-03-06 14:21:45 +02:00
parent 6d2a1aa55f
commit d8513cb724
3 changed files with 86 additions and 54 deletions

1
dev-util/umr/Manifest Normal file
View file

@ -0,0 +1 @@
DIST umr-1.0.10.tar.bz2 7531238 BLAKE2B 003e1390becf7115379e8e37cac47de85977c1d6ac3f111129265f2fbf32a0c440d9525cb43b2ce7c22ad4d9d96a033e4aadabb8267e8ed124f681aa7832bcba SHA512 da07e4f9d368d97865452cc1b7ea1fb0e3b0ec5ad4fda7de32252e7efffb529d2a860febb4039aaf2904fb9729308f40f781bdd34169cba533411e8fc4c896ba

View file

@ -1,56 +1,85 @@
# Copyright 1999-2024 Gentoo Authors
EAPI=7
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
inherit git-r3 cmake
EAPI=8
DESCRIPTION="User Mode Register Debugger for AMDGPU Hardware"
HOMEPAGE="https://gitlab.freedesktop.org/tomstdenis/umr"
# SRC_URI=""
EGIT_REPO_URI="https://gitlab.freedesktop.org/tomstdenis/umr.git"
EGIT_COMMIT="${PV}"
LLVM_COMPAT=( {18..20} )
LICENSE="MIT"
inherit cmake flag-o-matic linux-info llvm-r2
DESCRIPTION="umr is a userspace debugging and diagnostic tool for AMD GPUs"
HOMEPAGE="https://gitlab.freedesktop.org/tomstdenis/umr/"
SRC_URI="https://gitlab.freedesktop.org/tomstdenis/umr/-/archive/${PV}/${P}.tar.bz2"
LICENSE="MIT NCSA-AMD"
SLOT="0"
KEYWORDS="~amd64" # ~x86"
IUSE="+server"
KEYWORDS="~amd64"
#todo:
#* conditional building and installing of umrtest
#* optional gui
#* imgui creates files in working directory
BDEPEND="
dev-build/cmake
dev-build/ninja
sys-libs/ncurses
virtual/pkgconfig
x11-libs/libpciaccess
x11-libs/libdrm
dev-libs/libffi
sys-libs/zlib
app-arch/zstd
dev-libs/libxml2
media-libs/libglvnd
media-libs/mesa
dev-libs/nanomsg
"
DEPEND="
${BDEPEND}
dev-libs/nanomsg:=
media-libs/libglvnd
media-libs/libsdl2
media-libs/mesa[opengl]
sys-libs/ncurses:=
x11-libs/libdrm
x11-libs/libpciaccess
$(llvm_gen_dep '
llvm-core/llvm:${LLVM_SLOT}=
')
"
RDEPEND="${DEPEND}"
BDEPEND="
virtual/pkgconfig
"
# S="${WORKDIR}/umr"
pkg_setup() {
if kernel_is -lt 4 10; then
# from the readme
ewarn "It supports hardware from SI based hardware onwards and requires a v4.10 kernel"
ewarn "or newer to function correctly. Older kernels (not older than v4.8) may work"
ewarn "but with limited functionality/stability. Older kernels are not supported"
ewarn "officially so please refrain from submitting bug reports in relation to them."
fi
llvm-r2_pkg_setup
}
src_prepare() {
cmake_src_prepare
if [[ ${PV} != 9999 ]]; then
sed -i -e "s/^get_version_from_tag(\".*\")/get_version_from_tag(\"${PV}\")/" CMakeLists.txt || die
fi
}
src_configure() {
local mycmakeargs=()
if ! use server; then
mycmakeargs+=("-DUMR_NO_SERVER=ON")
fi
cmake_src_configure
# strict-aliasing violations
filter-lto
local mycmakeargs=(
-DBUILD_SHARED_LIBS=OFF
-DUMR_NO_DRM=OFF
-DUMR_NO_LLVM=OFF
-DUMR_STATIC_LLVM=OFF
-DUMR_NEED_RT=OFF
-DUMR_GUI=ON
-DUMR_SERVER=ON
-DOpenGL_GL_PREFERENCE=GLVND
-DCMAKE_DISABLE_FIND_PACKAGE_bash-completion=ON
)
cmake_src_configure
}
src_compile() {
cmake_src_compile
}
src_test() {
local -x UMRTESTPATH="${BUILD_DIR}/src/test/umrtest"
local -x UMRAPPPATH="${BUILD_DIR}/src/app/umr"
src_install() {
cmake_src_install
dolib.so "${S}_build/src/lib/libumrcore.so"
dolib.so "${S}_build/src/app/libumrapp.so"
dolib.so "${S}_build/src/lib/lowlevel/linux/libumrlow.so"
set -- bash test/runtest.sh norebuild
einfo "${@}"
"${@}" || die
}