commit:     e5119f64b321b101843486a27ae1bd7135f06242
Author:     Adel KARA SLIMANE <adel.ks <AT> zegrapher <DOT> com>
AuthorDate: Sat Apr 16 17:30:19 2022 +0000
Commit:     Adel KARA SLIMANE <adel <AT> karaslimane <DOT> com>
CommitDate: Sat Apr 16 17:32:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e5119f64

games-util/mangohud: new package

The imgui dependency that is bundled in GURU needs some work
before it can be used as a dependency, bundle it for now

Bug: https://bugs.gentoo.org/838850

Signed-off-by: Adel KARA SLIMANE <adel.ks <AT> zegrapher.com>

 games-util/mangohud/Manifest                       |  3 +
 .../files/mangonhud-0.6.6-meson-build.patch        | 14 ++++
 games-util/mangohud/mangohud-0.6.6.1.ebuild        | 94 ++++++++++++++++++++++
 games-util/mangohud/metadata.xml                   | 15 ++++
 4 files changed, 126 insertions(+)

diff --git a/games-util/mangohud/Manifest b/games-util/mangohud/Manifest
new file mode 100644
index 000000000..c00c83d44
--- /dev/null
+++ b/games-util/mangohud/Manifest
@@ -0,0 +1,3 @@
+DIST imgui-1.81-1-meson-wrap.zip 1850 BLAKE2B 
325f84fd57a896ec9aceb83a54752e8dba52499c3540cc389ab51b929f1dd65c4a599ab71f7f06fa082f31572d8cdaf2f9d7bfdd8cf6ca96a529318bd53f0a06
 SHA512 
c97fa4cb5ab31c040951e6da04bb1b9659f0105adf54becc35c60ad376c6d4f9e4dcd2a5a554dc5430cfc69527ef5d8570f39fbbf91a23d15f51740f06fb7c3c
+DIST imgui-1.81.tar.gz 1413443 BLAKE2B 
6f2e63777821b2767da92d9f40f4de7b4313c38817413e959e612c0ce67701645cf29f0748a3b86cfbd41e0b4b2c8099e9a0ca786c637ca1661fffd7b0de0629
 SHA512 
d7a2b66dea77359f78068a595607d7668e09ddd0b91910f67fc6463cb920b91b0cc1855984bd4d41e6a880b69ca7cd5e3adc064dcf461c0629b9f8c845a4fc3e
+DIST mangohud-0.6.6.1.tar.gz 14839055 BLAKE2B 
e0e27e62bf688b80611461ecab1bf4cf2c39f8359a9dc2cc1362555bfca55db30a72684da4e07e03970d8e5dee1d26f1d7a1fa30ff47aa86ec653dba273f24cf
 SHA512 
c097dede7e534641f12a9c7f0a2ce049611e17732c7d232251b38d5c50bbcee53b2b22e548ff27f514fa57a45c563d883a1a9382c2c0ee9ac6832a2775e8f221

diff --git a/games-util/mangohud/files/mangonhud-0.6.6-meson-build.patch 
b/games-util/mangohud/files/mangonhud-0.6.6-meson-build.patch
new file mode 100644
index 000000000..c6aa9e6fd
--- /dev/null
+++ b/games-util/mangohud/files/mangonhud-0.6.6-meson-build.patch
@@ -0,0 +1,14 @@
+# We provide media-libs/imgui in guru
+
+--- a/meson.build
++++ b/meson.build
+@@ -251,8 +251,7 @@ elif sizeof_ptr == 4
+   pre_args += '-DMANGOHUD_ARCH="32bit"'
+ endif
+
+-dearimgui_sp = subproject('imgui', default_options: imgui_options)
+-dearimgui_dep = dearimgui_sp.get_variable('imgui_dep')
++dearimgui_dep = dependency('imgui', default_options: imgui_options, fallback 
: ['imgui', 'imgui_dep'])
+
+ spdlog_dep = cpp.find_library('spdlog', required: 
get_option('use_system_spdlog'))
+ if not spdlog_dep.found()

diff --git a/games-util/mangohud/mangohud-0.6.6.1.ebuild 
b/games-util/mangohud/mangohud-0.6.6.1.ebuild
new file mode 100644
index 000000000..ae6a20b76
--- /dev/null
+++ b/games-util/mangohud/mangohud-0.6.6.1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1 meson-multilib
+
+MY_PV=$(ver_cut 1-3)
+[ -n "$(ver_cut 4)" ] && MY_PV_REV="-$(ver_cut 4)"
+
+IMGUI_VER="1.81"
+IMGUI_MESON_WRAP_VER="1"
+
+DESCRIPTION="A Vulkan and OpenGL overlay for monitoring FPS, temperatures, 
CPU/GPU load and more."
+HOMEPAGE="https://github.com/flightlessmango/MangoHud";
+
+SRC_URI="
+       
https://github.com/flightlessmango/MangoHud/archive/v${MY_PV}${MY_PV_REV}.tar.gz
 -> ${P}.tar.gz
+       https://github.com/ocornut/imgui/archive/v${IMGUI_VER}.tar.gz -> 
imgui-${IMGUI_VER}.tar.gz
+       
https://wrapdb.mesonbuild.com/v2/imgui_${IMGUI_VER}-${IMGUI_MESON_WRAP_VER}/get_patch
 -> imgui-${IMGUI_VER}-${IMGUI_MESON_WRAP_VER}-meson-wrap.zip
+"
+
+KEYWORDS="-* ~amd64 ~x86"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="+dbus debug +X xnvctrl wayland video_cards_nvidia"
+
+REQUIRED_USE="
+       || ( X wayland )
+       xnvctrl? ( video_cards_nvidia )"
+
+BDEPEND="
+       app-arch/unzip
+       dev-python/mako[${PYTHON_USEDEP}]
+       dev-libs/spdlog
+       dev-util/glslang
+       >=dev-util/vulkan-headers-1.2
+       media-libs/vulkan-loader[${MULTILIB_USEDEP}]
+       media-libs/libglvnd[$MULTILIB_USEDEP]
+       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}] )
+"
+
+RDEPEND="${BDEPEND}"
+
+S="${WORKDIR}/MangoHud-${PV}"
+
+src_unpack() {
+       default
+       [ -n "${MY_PV_REV}" ] && ( mv ${WORKDIR}/MangoHud-${MY_PV}${MY_PV_REV} 
${WORKDIR}/MangoHud-${PV} || die )
+
+       unpack imgui-${IMGUI_VER}.tar.gz
+       unpack imgui-${IMGUI_VER}-${IMGUI_MESON_WRAP_VER}-meson-wrap.zip
+       mv ${WORKDIR}/imgui-${IMGUI_VER} ${S}/subprojects/imgui || die
+}
+
+src_prepare() {
+       default
+       eapply "${FILESDIR}/mangonhud-0.6.6-meson-build.patch"
+}
+
+multilib_src_configure() {
+       local emesonargs=(
+               -Dappend_libdir_mangohud=false
+               -Duse_system_spdlog=enabled
+               -Duse_system_vulkan=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
+}

diff --git a/games-util/mangohud/metadata.xml b/games-util/mangohud/metadata.xml
new file mode 100644
index 000000000..da9d5549c
--- /dev/null
+++ b/games-util/mangohud/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Adel KARA SLIMANE</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>
+       </use>
+</pkgmetadata>

Reply via email to