mangohud unancored imgui version and some hypr

This commit is contained in:
TheK0tYaRa 2024-12-31 05:22:40 +02:00
parent 9e036bd35d
commit 36ddb1cccf
7 changed files with 195 additions and 3 deletions

View file

@ -0,0 +1,3 @@
DIST mangohud-0.7.2.tar.gz 14906751 BLAKE2B a88e6497d8a8bcd899fc41d555dec429a69c864a10476c1d549acead58a7fc7c5f5d14d901b75bd2aed1d8c8088a027417a74480b89501d947333d665d0567c0 SHA512 edc3e380f9f58b65ae04c970e84eec9ff3458eafb2d89b2208c0afa6978a745a634aab6b0e025996175981e80c66475ef92ffe326d31a67055895b8fd1213e63
DIST vulkan-headers-1.2.158-2-meson-wrap.zip 1107 BLAKE2B 35e4bb1f7410a009243fe7d4a4ba6cede7f01e0b56ad6ff72ad30c00c2452bd6d2a4fb44ab92c296147e2506a92acc6de1f817cb5433b96d66652cbcd8885595 SHA512 30cbbb90580399839e1bba8881b9b8cc33fdeead93f37d5f3398c9d53fb3ab050ca2562fd68f376fa4ee0825ee3787f560d70d55a170c780dd575ff2eeb66efd
DIST vulkan-headers-1.2.158.tar.gz 831647 BLAKE2B 792d7e895e27c4a8fbc93fc4d9c9e696d2ceb946e745709c050c0693b77afbeb6411a4267fc59508ddeb58167d469349fedc1c5d4b4a7415b590c97248b244bc SHA512 f7aa9222f9deb1316d22deacc2c6cd85c409f0f2b2d37ecd55e0fc8466d381bbe3bed287881b993a01c5f33736e1607014f820980b7a54a3721fab6980960c91

View file

@ -0,0 +1,151 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
inherit flag-o-matic python-single-r1 meson-multilib
MY_PV=$(ver_cut 1-3)
[[ -n "$(ver_cut 4)" ]] && MY_PV_REV="-$(ver_cut 4)"
DESCRIPTION="Vulkan and OpenGL overlay for monitoring FPS, sensors, system load and more"
HOMEPAGE="https://github.com/flightlessmango/MangoHud"
VK_HEADERS_VER="1.2.158"
VK_HEADERS_MESON_WRAP_VER="2"
SRC_URI="
https://github.com/KhronosGroup/Vulkan-Headers/archive/v${VK_HEADERS_VER}.tar.gz
-> vulkan-headers-${VK_HEADERS_VER}.tar.gz
https://wrapdb.mesonbuild.com/v2/vulkan-headers_${VK_HEADERS_VER}-${VK_HEADERS_MESON_WRAP_VER}/get_patch
-> vulkan-headers-${VK_HEADERS_VER}-${VK_HEADERS_MESON_WRAP_VER}-meson-wrap.zip
"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/flightlessmango/MangoHud.git"
else
SRC_URI+="
https://github.com/flightlessmango/MangoHud/archive/v${MY_PV}${MY_PV_REV}.tar.gz
-> ${P}.tar.gz
"
KEYWORDS="~amd64"
S="${WORKDIR}/MangoHud-${PV}"
fi
LICENSE="MIT"
SLOT="0"
IUSE="+dbus debug +X xnvctrl wayland mangoapp mangohudctl mangoplot video_cards_nvidia video_cards_amdgpu test"
RESTRICT="!test? ( test )"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
|| ( X wayland )
xnvctrl? ( video_cards_nvidia )
"
BDEPEND="
app-arch/unzip
dev-util/glslang
test? ( dev-util/cmocka )
$(python_gen_cond_dep 'dev-python/mako[${PYTHON_USEDEP}]')
"
DEPEND="
${PYTHON_DEPS}
=media-libs/imgui-1*:=[opengl,vulkan,${MULTILIB_USEDEP}]
=media-libs/implot-0.16*:=[${MULTILIB_USEDEP}]
dev-libs/spdlog:=[${MULTILIB_USEDEP}]
dev-libs/libfmt:=[${MULTILIB_USEDEP}]
dev-cpp/nlohmann_json
x11-libs/libxkbcommon
dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
X? ( x11-libs/libX11[${MULTILIB_USEDEP}] )
video_cards_nvidia? (
x11-drivers/nvidia-drivers[${MULTILIB_USEDEP}]
xnvctrl? ( x11-drivers/nvidia-drivers[static-libs] )
)
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
mangoapp? (
=media-libs/imgui-1.89.9*[glfw]
media-libs/glfw[X(+)?,wayland(+)?]
media-libs/glew
)
"
RDEPEND="
${DEPEND}
media-libs/libglvnd[${MULTILIB_USEDEP}]
media-libs/vulkan-loader[${MULTILIB_USEDEP}]
mangoplot? (
media-fonts/lato
$(python_gen_cond_dep '
|| (
dev-python/matplotlib[gtk3,${PYTHON_USEDEP}]
dev-python/matplotlib[qt5(-),${PYTHON_USEDEP}]
dev-python/matplotlib[qt6(-),${PYTHON_USEDEP}]
dev-python/matplotlib[wxwidgets,${PYTHON_USEDEP}]
)
')
)
"
src_unpack() {
default
[[ -n "${MY_PV_REV}" ]] && ( mv "${WORKDIR}/MangoHud-${MY_PV}${MY_PV_REV}" "${WORKDIR}/MangoHud-${PV}" || die )
if [[ $PV == 9999 ]]; then
git-r3_src_unpack
fi
unpack vulkan-headers-${VK_HEADERS_VER}.tar.gz
unpack vulkan-headers-${VK_HEADERS_VER}-${VK_HEADERS_MESON_WRAP_VER}-meson-wrap.zip
mv "${WORKDIR}/Vulkan-Headers-${VK_HEADERS_VER}" "${S}/subprojects/" || die
}
src_prepare() {
default
# replace all occurences of "#include <imgui.h>" to "#include <imgui/imgui.h>"
find . -type f -exec sed -i 's|<imgui.h>|<imgui/imgui.h>|g' {} \; || die
find . -type f -exec sed -i 's|"imgui.h"|<imgui/imgui.h>|g' {} \; || die
find . -type f -exec sed -i 's|<imgui_internal.h>|<imgui/imgui_internal.h>|g' {} \; || die
find . -type f -exec sed -i 's|"imgui_internal.h"|<imgui/imgui_internal.h>|g' {} \; || die
find . -type f -exec sed -i 's|"imgui_impl_glfw.h"|<imgui/imgui_impl_glfw.h>|g' {} \; || die
find . -type f -exec sed -i 's|"imgui_impl_opengl3.h"|<imgui/imgui_impl_opengl3.h>|g' {} \; || die
}
multilib_src_configure() {
# workaround for lld
# https://github.com/flightlessmango/MangoHud/issues/1240
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local emesonargs=(
-Dappend_libdir_mangohud=false
-Dinclude_doc=false
-Duse_system_spdlog=enabled
$(meson_feature video_cards_nvidia with_nvml)
$(meson_feature xnvctrl with_xnvctrl)
$(meson_feature X with_x11)
$(meson_feature wayland with_wayland)
$(meson_feature dbus with_dbus)
$(meson_use mangoapp mangoapp)
$(meson_use mangoapp mangoapp_layer)
$(meson_use mangohudctl mangohudctl)
$(meson_feature mangoplot mangoplot)
)
meson_src_configure
}
pkg_postinst() {
if ! use xnvctrl; then
einfo ""
einfo "If mangohud can't get GPU load, or other GPU information,"
einfo "and you have an older Nvidia device."
einfo ""
einfo "Try enabling the 'xnvctrl' useflag."
einfo ""
fi
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>adel.ks@zegrapher.com</email>
<name>Adel KARA SLIMANE</name>
</maintainer>
<maintainer type="person">
<email>gonegrier.duarte@gmail.com</email>
<name>Gonçalo Negrier Duarte</name>
</maintainer>
<upstream>
<remote-id type="github">flightlessmango/MangoHud</remote-id>
<bugs-to>https://github.com/flightlessmango/MangoHud/issues</bugs-to>
</upstream>
<use>
<flag name="xnvctrl">Use XNVctrl as fall back for older Nvidia devices.</flag>
<flag name="test">Run mangohud tests</flag>
<flag name="mangoapp">Build and install mangoapp and mangoapp layer</flag>
<flag name="mangohudctl">Build and install mangohudctl</flag>
<flag name="mangoplot">Install mangoplot python script</flag>
</use>
</pkgmetadata>