From patchwork Sun Feb 27 01:14:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Kehayias X-Patchwork-Id: 37485 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 105BC27BBEA; Sun, 27 Feb 2022 01:16:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7533C27BBE9 for ; Sun, 27 Feb 2022 01:16:13 +0000 (GMT) Received: from localhost ([::1]:56212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nO8AW-0000pd-8V for patchwork@mira.cbaines.net; Sat, 26 Feb 2022 20:16:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO8AM-0000pA-HR for guix-patches@gnu.org; Sat, 26 Feb 2022 20:16:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34352) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO8AM-00076i-8t for guix-patches@gnu.org; Sat, 26 Feb 2022 20:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nO8AL-0001sx-Uu for guix-patches@gnu.org; Sat, 26 Feb 2022 20:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53015] [PATCH v3] Add mangohud. Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Feb 2022 01:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53015 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: "53015@debbugs.gnu.org" <53015@debbugs.gnu.org>, Nicolas Goaziou Received: via spool by 53015-submit@debbugs.gnu.org id=B53015.16459245097161 (code B ref 53015); Sun, 27 Feb 2022 01:16:01 +0000 Received: (at 53015) by debbugs.gnu.org; 27 Feb 2022 01:15:09 +0000 Received: from localhost ([127.0.0.1]:56482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO89R-0001rK-8L for submit@debbugs.gnu.org; Sat, 26 Feb 2022 20:15:09 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:14866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO89P-0001qU-BI for 53015@debbugs.gnu.org; Sat, 26 Feb 2022 20:15:04 -0500 Date: Sun, 27 Feb 2022 01:14:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1645924495; bh=GOfBuktjIWJ56AKl+MLJISaj8Tbh2FmX2ow0psQg+O4=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=Imas6K7AgCOvK47tImAMcSVwHC5WaZUgH8j2PnsYDH/I+MwuvQV3v1+7l7S+FvkCC VwtYPWrudf2xVNGio6AmDFyc6SpWevjSwGLYUSm8Q3VxNFx1f8zj7GDuzlyJSAsOoP sxKuD/rbURgt/gpbTWGKrGLtxCAPeUqN39rXId+faZmJHUyDHkSsy0ybdaE/A78VL9 RiX8q3FSotkBAnJL82DPbCvGTLk1jYYyZjFRguYiXThkw8dRegxekHFaim3YLtsiu9 b4vNkOeXwCHAGvOU7Z3AFJp1blVBlqDKOZYpLeqIbH8dFiFWllkRGitgo46Ae0xC15 3SHpN9weVWE2A== Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: John Kehayias X-ACL-Warn: , John Kehayias via Guix-patches X-Patchwork-Original-From: John Kehayias via Guix-patches via From: John Kehayias X-getmail-retrieved-from-mailbox: Patches > > Attached is an update to this patch series, reduced to just one patch. This relies on the hwdata package added in https://issues.guix.gnu.org/54069#2 and the update to imgui I sent in https://issues.guix.gnu.org/54132 > > With that, mangohud just uses imgui-1.86 (the newer version has a breaking change). The modifications to the meson.build is handled in a build phase substitute* rather than a patch, as it needs the imgui location. > > I've checked this builds and works. Let me know if any other modifications are needed, other than the hwdata and imgui fixes referenced. > Attached is a revised patch to use the new hwdata package with inputs, so the correct input is now `(,hwdata "pci"). I checked that it applied and built on master. John From 73babfb8747916fb8bd0584cffb7fcd4a2c469c7 Mon Sep 17 00:00:00 2001 From: John Kehayias Date: Wed, 23 Feb 2022 17:29:39 -0500 Subject: [PATCH] gnu: Add mangohud. * gnu/packages/graphics.scm (mangohud): New variable. --- gnu/packages/graphics.scm | 86 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 04f92e2b07..40ed72b323 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -28,6 +28,7 @@ ;;; Copyright © 2021 Ekaitz Zarraga ;;; Copyright © 2021, 2022 Vinicius Monego ;;; Copyright © 2022 Michael Rohleder +;;; Copyright © 2022 John Kehayias ;;; ;;; This file is part of GNU Guix. ;;; @@ -80,11 +81,13 @@ (define-module (gnu packages graphics) #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) + #:use-module (gnu packages logging) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) #:use-module (gnu packages maths) #:use-module (gnu packages mp3) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages pciutils) #:use-module (gnu packages pdf) #:use-module (gnu packages perl) #:use-module (gnu packages photo) @@ -117,6 +120,7 @@ (define-module (gnu packages graphics) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix hg-download) #:use-module ((guix licenses) #:prefix license:) @@ -863,6 +867,88 @@ (define-public alembic distills complex, animated scenes into a set of baked geometric results.") (license license:bsd-3))) +(define-public mangohud + (package + (name "mangohud") + (version "0.6.6-1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/flightlessmango/MangoHud/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0ka004wxkajmvs5vy60r4ckm7f169c61rrd46w6gywkaqf5yp1ab")))) + (build-system meson-build-system) + (arguments + (list + #:build-type "release" + #:configure-flags + #~(list "-Duse_system_vulkan=enabled" + "-Duse_system_spdlog=enabled" + "-Dwith_xnvctrl=disabled" + "-Dappend_libdir_mangohud=false" + (string-append "-Dvulkan_datadir=" + #$(this-package-input "vulkan-headers") + "/share")) + #:phases + #~(modify-phases %standard-phases + ;; Mangohud tries to build the imgui library as a meson submodule, + ;; so we change the dependency to the imgui input instead. + (add-after 'unpack 'unbundle-imgui + (lambda _ + (substitute* "meson.build" + (("dearimgui_sp = .*") + "") + (("dearimgui_sp.get_variable\\('imgui_dep'\\)") + (string-append "declare_dependency(dependencies: " + "cpp.find_library('imgui'), include_directories: '" + #$(this-package-input "imgui") "/include/imgui')"))))) + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/meson.build" + (("\\\\\\$LIB") + "lib")) + (substitute* "src/loaders/loader_libdrm.cpp" + (("libdrm.so.2") + (search-input-file inputs "/lib/libdrm.so.2")) + (("libdrm_amdgpu.so.1") + (search-input-file inputs "/lib/libdrm_amdgpu.so.1"))) + (substitute* "src/overlay.cpp" + (("glxinfo") + (search-input-file inputs "/bin/glxinfo"))) + (substitute* "src/loaders/loader_x11.cpp" + (("libX11.so.6") + (search-input-file inputs "/lib/libX11.so.6"))) + (substitute* "src/pci_ids.cpp" + (("/usr/share/hwdata/pci.ids") + (search-input-file inputs "share/hwdata/pci.ids"))) + (substitute* "src/dbus.cpp" + (("libdbus-1.so.3") + (search-input-file inputs "lib/libdbus-1.so.3")))))))) + (inputs + (list dbus + glslang + `(,hwdata "pci") + imgui-1.86 + mesa + mesa-utils + libdrm + libx11 + python-mako + spdlog + vulkan-loader + vulkan-headers)) + (native-inputs + (list pkg-config python)) + (synopsis "Vulkan and OpenGL overlay for monitoring performance and hardware") + (description + "MangoHud is a Vulkan and OpenGL overlay for monitoring frames per second (FPS), +temperatures, CPU/GPU load and more.") + (home-page "https://github.com/flightlessmango/MangoHud/") + (license license:expat))) + (define-public ogre (package (name "ogre") -- 2.34.0