From fc043006502585cb7903facf879ace5461a48ca8 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Wed, 27 Dec 2023 13:35:59 +0100 Subject: [PATCH] games-util/mangohud add live and 0.6.9 --- games-util/mangohud/Manifest | 1 + games-util/mangohud/mangohud-0.6.9.ebuild | 117 ++++++++++++++++++++ games-util/mangohud/mangohud-9999-r6.ebuild | 117 ++++++++++++++++++++ games-util/mangohud/metadata.xml | 11 ++ 4 files changed, 246 insertions(+) create mode 100644 games-util/mangohud/Manifest create mode 100644 games-util/mangohud/mangohud-0.6.9.ebuild create mode 100644 games-util/mangohud/mangohud-9999-r6.ebuild create mode 100644 games-util/mangohud/metadata.xml diff --git a/games-util/mangohud/Manifest b/games-util/mangohud/Manifest new file mode 100644 index 0000000..64285d8 --- /dev/null +++ b/games-util/mangohud/Manifest @@ -0,0 +1 @@ +DIST mangohud-0.6.9.tar.xz 16508064 BLAKE2B 421b691444df1080eab8cf45f6260006caa421bf2c3e8fc633202b335377f19469d4559b28a3b18a81951b5c04c66bbb300e48c3296d0df41c30724c590ba90c SHA512 305597ed49b48664aa559bd6199db8517c08f0631fedce8c0df526cc85b97f3ab5e7f4602b67f12e1e0365b972cd877b79fdd95811cbc2fbcb541d274f4c431e diff --git a/games-util/mangohud/mangohud-0.6.9.ebuild b/games-util/mangohud/mangohud-0.6.9.ebuild new file mode 100644 index 0000000..8df13b1 --- /dev/null +++ b/games-util/mangohud/mangohud-0.6.9.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{9..11} ) + +inherit meson distutils-r1 multilib-minimal flag-o-matic + +DESCRIPTION="A Vulkan/OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more." +HOMEPAGE="https://github.com/flightlessmango/MangoHud" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/flightlessmango/MangoHud.git" + RESTRICT="network-sandbox" # for imgui subproject + KEYWORDS="" +else + SRC_URI=" + https://github.com/flightlessmango/MangoHud/releases/download/v${PV}/MangoHud-v${PV}-Source.tar.xz -> ${P}.tar.xz + " + KEYWORDS="-* ~amd64 ~x86" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="+dbus debug tools +X xnvctrl wayland video_cards_nvidia" + +REQUIRED_USE=" + xnvctrl? ( video_cards_nvidia )" + +BDEPEND="dev-python/mako[${PYTHON_USEDEP}]" + +DEPEND=" + dev-util/glslang + >=dev-util/vulkan-headers-1.2 + media-libs/vulkan-loader[${MULTILIB_USEDEP}] + dev-libs/spdlog[${MULTILIB_USEDEP}] + media-libs/libglvnd[${MULTILIB_USEDEP}] + dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) + tools? ( + media-libs/glfw + ) + 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}] )" + +RDEPEND="${DEPEND}" + +if ! [[ ${PV} == "9999" ]]; then + S="${WORKDIR}"/MangoHud-v${PV} +fi + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + fi + default +} + +multilib_src_configure() { + local emesonargs=( + -Dappend_libdir_mangohud=false + -Duse_system_spdlog=enabled + -Dinclude_doc=false + -Dwith_nvml=$(usex video_cards_nvidia enabled disabled) + -Dwith_xnvctrl=$(usex xnvctrl enabled disabled) + -Dwith_x11=$(usex X enabled disabled) + -Dwith_wayland=$(usex wayland enabled disabled) + -Dwith_dbus=$(usex dbus enabled disabled) + ) + if [[ ${PV} == "9999" ]]; then + emesonargs+=( + --wrap-mode default + ) + fi + if multilib_is_native_abi; then + emesonargs+=( + -Dmangoapp=$(usex tools true false) + -Dmangohudctl=$(usex tools true false) + -Dmangoapp_layer=$(usex tools true false) + ) + fi + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile +} + +multilib_src_install() { + meson_src_install +} + +multilib_src_install_all() { + dodoc "${S}/data/MangoHud.conf" + doman "${S}/data/mangohud.1" + if use tools; then + doman "${S}/data/mangoapp.1" + fi + + einstalldocs +} + +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 +} diff --git a/games-util/mangohud/mangohud-9999-r6.ebuild b/games-util/mangohud/mangohud-9999-r6.ebuild new file mode 100644 index 0000000..8df13b1 --- /dev/null +++ b/games-util/mangohud/mangohud-9999-r6.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{9..11} ) + +inherit meson distutils-r1 multilib-minimal flag-o-matic + +DESCRIPTION="A Vulkan/OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more." +HOMEPAGE="https://github.com/flightlessmango/MangoHud" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/flightlessmango/MangoHud.git" + RESTRICT="network-sandbox" # for imgui subproject + KEYWORDS="" +else + SRC_URI=" + https://github.com/flightlessmango/MangoHud/releases/download/v${PV}/MangoHud-v${PV}-Source.tar.xz -> ${P}.tar.xz + " + KEYWORDS="-* ~amd64 ~x86" +fi + +LICENSE="MIT" +SLOT="0" +IUSE="+dbus debug tools +X xnvctrl wayland video_cards_nvidia" + +REQUIRED_USE=" + xnvctrl? ( video_cards_nvidia )" + +BDEPEND="dev-python/mako[${PYTHON_USEDEP}]" + +DEPEND=" + dev-util/glslang + >=dev-util/vulkan-headers-1.2 + media-libs/vulkan-loader[${MULTILIB_USEDEP}] + dev-libs/spdlog[${MULTILIB_USEDEP}] + media-libs/libglvnd[${MULTILIB_USEDEP}] + dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) + tools? ( + media-libs/glfw + ) + 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}] )" + +RDEPEND="${DEPEND}" + +if ! [[ ${PV} == "9999" ]]; then + S="${WORKDIR}"/MangoHud-v${PV} +fi + +src_unpack() { + if [[ ${PV} == "9999" ]]; then + git-r3_src_unpack + fi + default +} + +multilib_src_configure() { + local emesonargs=( + -Dappend_libdir_mangohud=false + -Duse_system_spdlog=enabled + -Dinclude_doc=false + -Dwith_nvml=$(usex video_cards_nvidia enabled disabled) + -Dwith_xnvctrl=$(usex xnvctrl enabled disabled) + -Dwith_x11=$(usex X enabled disabled) + -Dwith_wayland=$(usex wayland enabled disabled) + -Dwith_dbus=$(usex dbus enabled disabled) + ) + if [[ ${PV} == "9999" ]]; then + emesonargs+=( + --wrap-mode default + ) + fi + if multilib_is_native_abi; then + emesonargs+=( + -Dmangoapp=$(usex tools true false) + -Dmangohudctl=$(usex tools true false) + -Dmangoapp_layer=$(usex tools true false) + ) + fi + meson_src_configure +} + +multilib_src_compile() { + meson_src_compile +} + +multilib_src_install() { + meson_src_install +} + +multilib_src_install_all() { + dodoc "${S}/data/MangoHud.conf" + doman "${S}/data/mangohud.1" + if use tools; then + doman "${S}/data/mangoapp.1" + fi + + einstalldocs +} + +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 +} diff --git a/games-util/mangohud/metadata.xml b/games-util/mangohud/metadata.xml new file mode 100644 index 0000000..42a2c17 --- /dev/null +++ b/games-util/mangohud/metadata.xml @@ -0,0 +1,11 @@ + + + + + james@thegreatmcpain.xyz + + + "Installs the 'mangoapp' and 'mangohudctl' binaries." + "Use XNVctrl as fall back for older Nvidia devices." + +