aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdel KARA SLIMANE <adel.ks@zegrapher.com>2023-11-27 20:22:51 +0100
committerAdel KARA SLIMANE <adel.ks@zegrapher.com>2023-11-27 20:25:53 +0100
commit26e006d1e03f7670231d0a83cf8b69fda9af5d44 (patch)
treefebf56c68d9c3b0863df310077e9d4abf8c69211 /games-util
parentgames-util/mangohud: add 0.7.0, drop 0.6.9.1 (diff)
downloadguru-26e006d1e03f7670231d0a83cf8b69fda9af5d44.tar.gz
guru-26e006d1e03f7670231d0a83cf8b69fda9af5d44.tar.bz2
guru-26e006d1e03f7670231d0a83cf8b69fda9af5d44.zip
games-util/mangohud: add 9999
Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
Diffstat (limited to 'games-util')
-rw-r--r--games-util/mangohud/Manifest2
-rw-r--r--games-util/mangohud/files/implot-v0.16-fix-imgui-dep.patch16
-rw-r--r--games-util/mangohud/files/implot-v0.16-imgui-include-fix.patch45
-rw-r--r--games-util/mangohud/mangohud-9999.ebuild150
4 files changed, 213 insertions, 0 deletions
diff --git a/games-util/mangohud/Manifest b/games-util/mangohud/Manifest
index cc06a9c609..d9d337f7d4 100644
--- a/games-util/mangohud/Manifest
+++ b/games-util/mangohud/Manifest
@@ -1,3 +1,5 @@
+DIST implot-0.16-1-meson-wrap.zip 1226 BLAKE2B 4725661fe2c7f7f05e1702c3a871f9feb9fdefdc2a840cdf8a3d56e7e180e950533f830192f9ad19cba97e8094ab53cf73adda2ed6712a83384d4160f6c06b18 SHA512 6e54beebef8ac4ec0b3e85d30d7570c9a987d69c03b6a564bc67d105d19d2cec45cb3ab8921ebcbda51e7139d93c3c6dae359fa30b3fcce748cdec8953aabbf7
+DIST implot-0.16.tar.gz 137983 BLAKE2B aca328e2fe6049b72601f25a409f313e99971f606e68ca780a1594f8ca42b1606831090add8039fefd013cfb6c057900f0add347d1b80c466a05bd18e455b8d7 SHA512 117cb08122d900e7db857897bfec4c9ac3300a1d429c8f0303415bc693840baa9bbbb91ca3f13853d8efd3a6ebf538b7114401d4fbfe0d067256e58cbdbd4919
DIST mangohud-0.7.0.tar.gz 14892372 BLAKE2B 436a7834743aac3f95d55031194fddd79861061010cf5eb25e81cf5eceacf4015b607a191931a85715ca0d58c8e314841d536ce83e7767a39869ab789d376c7a SHA512 1ed43c2ba8a97c8934895450bf1ce152970031e5a5654db91df02d7b44f5eeacb32167f219735d2f0fb3c8ba24fc4386a8af4da99a3cd736af0b0d50ef2fedd7
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
diff --git a/games-util/mangohud/files/implot-v0.16-fix-imgui-dep.patch b/games-util/mangohud/files/implot-v0.16-fix-imgui-dep.patch
new file mode 100644
index 0000000000..68f5768760
--- /dev/null
+++ b/games-util/mangohud/files/implot-v0.16-fix-imgui-dep.patch
@@ -0,0 +1,16 @@
+# We provide media-libs/imgui in guru
+
+diff --git a/meson.build b/meson.build.new
+index b628fe0..16b11de 100644
+--- a/meson.build
++++ b/meson.build
+@@ -5,8 +5,7 @@ project(
+ version : '0.16',
+ )
+
+-imgui_sp = subproject('imgui')
+-imgui_dep = imgui_sp.get_variable('imgui_dep')
++imgui_dep = dependency('imgui')
+
+ implot_inc = include_directories('.')
+ implot_src = files(
diff --git a/games-util/mangohud/files/implot-v0.16-imgui-include-fix.patch b/games-util/mangohud/files/implot-v0.16-imgui-include-fix.patch
new file mode 100644
index 0000000000..7da397ce44
--- /dev/null
+++ b/games-util/mangohud/files/implot-v0.16-imgui-include-fix.patch
@@ -0,0 +1,45 @@
+diff --git a/.github/example_implot.cpp b/.github/example_implot.cpp
+index 9339bab..13bcf8c 100644
+--- a/.github/example_implot.cpp
++++ b/.github/example_implot.cpp
+@@ -1,12 +1,12 @@
+ // Sample app built with Dear ImGui and ImPlot
+ // This app uses implot and imgui, but does not output to any backend! It only serves as a proof that an app can be built, linked, and run.
+
+-#include "imgui.h"
++#include "imgui/imgui.h"
+ #include "implot.h"
+ #include "stdio.h"
+
+ int main(int, char**)
+-{
++{
+ printf("sample_implot: start\n");
+
+ IMGUI_CHECKVERSION();
+diff --git a/implot.h b/implot.h
+index 36c0d40..5dabc9d 100644
+--- a/implot.h
++++ b/implot.h
+@@ -45,7 +45,7 @@
+ // [SECTION] Obsolete API
+
+ #pragma once
+-#include "imgui.h"
++#include "imgui/imgui.h"
+
+ //-----------------------------------------------------------------------------
+ // [SECTION] Macros and Defines
+diff --git a/implot_internal.h b/implot_internal.h
+index fb01204..4e58767 100644
+--- a/implot_internal.h
++++ b/implot_internal.h
+@@ -32,7 +32,7 @@
+ #pragma once
+
+ #include <time.h>
+-#include "imgui_internal.h"
++#include "imgui/imgui_internal.h"
+
+ #ifndef IMPLOT_VERSION
+ #error Must include implot.h before implot_internal.h
diff --git a/games-util/mangohud/mangohud-9999.ebuild b/games-util/mangohud/mangohud-9999.ebuild
new file mode 100644
index 0000000000..7632ae6556
--- /dev/null
+++ b/games-util/mangohud/mangohud-9999.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit python-any-r1 meson
+
+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"
+
+IMPLOT_VER="0.16"
+IMPLOT_MESON_WRAP_VER="1"
+
+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
+ https://github.com/epezent/implot/archive/refs/tags/v${IMPLOT_VER}.tar.gz
+ -> implot-${IMPLOT_VER}.tar.gz
+ https://wrapdb.mesonbuild.com/v2/implot_${IMPLOT_VER}-${IMPLOT_MESON_WRAP_VER}/get_patch
+ -> implot-${IMPLOT_VER}-${IMPLOT_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 video_cards_nvidia video_cards_amdgpu"
+
+REQUIRED_USE="
+ || ( X wayland )
+ xnvctrl? ( video_cards_nvidia )"
+
+BDEPEND="
+ app-arch/unzip
+ $(python_gen_any_dep 'dev-python/mako[${PYTHON_USEDEP}]')
+"
+
+python_check_deps() {
+ python_has_version "dev-python/mako[${PYTHON_USEDEP}]" ||
+ python_has_version "dev-python/matplotlib[gtk3,${PYTHON_USEDEP}]" ||
+ python_has_version "dev-python/matplotlib[qt5,${PYTHON_USEDEP}]" ||
+ python_has_version "dev-python/matplotlib[wxwidgets,${PYTHON_USEDEP}]"
+}
+
+DEPEND="
+ ~media-libs/imgui-1.81[opengl,vulkan]
+ dev-cpp/nlohmann_json
+ dev-libs/spdlog
+ dev-util/glslang
+ media-fonts/lato
+ media-libs/vulkan-loader
+ media-libs/libglvnd
+ x11-libs/libdrm
+ dbus? ( sys-apps/dbus )
+ X? ( x11-libs/libX11 )
+ video_cards_nvidia? (
+ x11-drivers/nvidia-drivers
+ xnvctrl? ( x11-drivers/nvidia-drivers[static-libs] )
+ )
+ wayland? ( dev-libs/wayland )
+ || (
+ $(python_gen_any_dep '
+ dev-python/matplotlib[gtk3,${PYTHON_USEDEP}]
+ dev-python/matplotlib[qt5,${PYTHON_USEDEP}]
+ dev-python/matplotlib[wxwidgets,${PYTHON_USEDEP}]
+ ')
+ )
+"
+
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/mangohud-v0.7.0-meson-fix-imgui-dep.patch"
+ "${FILESDIR}/mangohud-v0.7.0-imgui-include-fix.patch"
+)
+
+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
+
+ unpack implot-${IMPLOT_VER}.tar.gz
+ unpack implot-${IMPLOT_VER}-${IMPLOT_MESON_WRAP_VER}-meson-wrap.zip
+ mv "${WORKDIR}/implot-${IMPLOT_VER}" "${S}/subprojects/" || die
+
+ cd "${S}/subprojects/implot-${IMPLOT_VER}" || die
+ eapply "${FILESDIR}/implot-v0.16-fix-imgui-dep.patch"
+ eapply "${FILESDIR}/implot-v0.16-imgui-include-fix.patch"
+}
+
+src_prepare() {
+ default
+ # replace all occurences of "#include <imgui.h>" to "#include <imgui/imgui.h>"
+ find . -type f -exec sed -i 's/#include <imgui.h>/#include <imgui\/imgui.h>/g' {} \;
+ find . -type f -exec sed -i 's/#include "imgui.h"/#include <imgui\/imgui.h>/g' {} \;
+}
+
+src_configure() {
+ local emesonargs=(
+ -Dappend_libdir_mangohud=false
+ -Duse_system_spdlog=enabled
+ -Dinclude_doc=false
+ $(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_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
+}