Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mangohud: init at 0.4.1 #95225

Merged
merged 1 commit into from May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkgs/tools/graphics/mangohud/combined.nix
@@ -0,0 +1,14 @@
{ stdenv, pkgs, lib
, libXNVCtrl
}:
let
mangohud_64 = pkgs.callPackage ./default.nix { inherit libXNVCtrl; };
mangohud_32 = pkgs.pkgsi686Linux.callPackage ./default.nix { inherit libXNVCtrl; };
in
pkgs.buildEnv rec {
name = "mangohud-${mangohud_64.version}";
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved

paths = [ mangohud_32 ] ++ lib.optionals stdenv.is64bit [ mangohud_64 ];

meta = mangohud_64.meta;
}
79 changes: 79 additions & 0 deletions pkgs/tools/graphics/mangohud/default.nix
@@ -0,0 +1,79 @@
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, meson
, ninja
, pkg-config
, python3Packages
, dbus
, glslang
, libglvnd
, libXNVCtrl
, mesa
, vulkan-headers
, vulkan-loader
, xorg
}:


stdenv.mkDerivation rec {
pname = "mangohud${lib.optionalString stdenv.is32bit "_32"}";
version = "0.4.1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newest version is 0.6.1
And rename the commit, if you change the version

Tried it locally, if I manually push the version, the patch doesn't apply.

Copy link
Member

@Atemu Atemu Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Versions newer than v4 won't work in Nixpkgs, see #95225 (comment) #101597


src = fetchFromGitHub {
owner = "flightlessmango";
repo = "MangoHud";
rev = "v${version}";
sha256 = "04v2ps8n15ph2smjgnssax5hq88bszw2kbcff37cnd5c8yysvfi6";
fetchSubmodules = true;
};

patches = [
(fetchpatch {
# FIXME obsolete in >=0.5.0
url = "https://patch-diff.githubusercontent.com/raw/flightlessmango/MangoHud/pull/208.patch";
sha256 = "1i6x6sr4az1zv0p6vpw99n947c7awgbbv087fghjlczhry676nmh";
})
];

mesonFlags = [
"-Dappend_libdir_mangohud=false"
"-Duse_system_vulkan=enabled"
"--libdir=lib${lib.optionalString stdenv.is32bit "32"}"
];

buildInputs = [
dbus
glslang
libglvnd
libXNVCtrl
mesa
python3Packages.Mako
vulkan-headers
vulkan-loader
xorg.libX11
];

nativeBuildInputs = [
meson
ninja
pkg-config
python3Packages.Mako
python3Packages.python
];

preConfigure = ''
mkdir -p "$out/share/vulkan/"
ln -sf "${vulkan-headers}/share/vulkan/registry/" $out/share/vulkan/
ln -sf "${vulkan-headers}/include" $out
'';

meta = with lib; {
description = "A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more";
homepage = "https://github.com/flightlessmango/MangoHud";
platforms = platforms.linux;
license = licenses.mit;
maintainers = with maintainers; [ zeratax ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -6532,6 +6532,10 @@ in

mandoc = callPackage ../tools/misc/mandoc { };

mangohud = callPackage ../tools/graphics/mangohud/combined.nix {
libXNVCtrl = linuxPackages.nvidia_x11.settings.libXNVCtrl;
};

manix = callPackage ../tools/nix/manix {
inherit (darwin.apple_sdk.frameworks) Security;
};
Expand Down