From edf4ee4c928cea942dad27b24e62229a76895332 Mon Sep 17 00:00:00 2001 From: K900 Date: Tue, 24 Oct 2023 16:34:18 +0300 Subject: [PATCH] mangohud: 0.7.0.rc1.r4 -> 0.7.0.r54 --- pkgs/mangohud/default.nix | 6 +-- pkgs/mangohud/upstream/default.nix | 22 ++++++++-- .../upstream/preload-nix-workaround.patch | 42 +++++++++++++------ 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/pkgs/mangohud/default.nix b/pkgs/mangohud/default.nix index 56013c13..34ccd6fa 100644 --- a/pkgs/mangohud/default.nix +++ b/pkgs/mangohud/default.nix @@ -1,13 +1,13 @@ { callPackage, fetchFromGitHub, git, ... }@args: (callPackage ./upstream (removeAttrs args ["callPackage" "git"])).overrideAttrs (old: { - version = "0.7.0.rc1.r4"; + version = "0.7.0.r54"; src = fetchFromGitHub { owner = "flightlessmango"; repo = "MangoHud"; - rev = "1a0abc65dfb44853813e6e437bd71747bac089e5"; - hash = "sha256-XOoVAcNrKphuoUbt8GDTX2p/JtCMf87DLRycHdINTBA="; + rev = "9393066ef87c168a55fb0e2db3d002c55544fdd6"; + hash = "sha256-WM3Z0l0rEVQ56GG0XhHu3/ao2K066GjIh25nn2QU+8A="; }; nativeBuildInputs = old.nativeBuildInputs ++ [ git ]; diff --git a/pkgs/mangohud/upstream/default.nix b/pkgs/mangohud/upstream/default.nix index e42ca26c..eeb41b0b 100644 --- a/pkgs/mangohud/upstream/default.nix +++ b/pkgs/mangohud/upstream/default.nix @@ -49,16 +49,16 @@ let # Derived from subprojects/imgui.wrap imgui = rec { - version = "1.81"; + version = "1.89.9"; src = fetchFromGitHub { owner = "ocornut"; repo = "imgui"; rev = "refs/tags/v${version}"; - hash = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; + hash = "sha256-0k9jKrJUrG9piHNFQaBBY3zgNIKM23ZA879NY+MNYTU="; }; patch = fetchurl { url = "https://wrapdb.mesonbuild.com/v2/imgui_${version}-1/get_patch"; - hash = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; + hash = "sha256-myEpDFl9dr+NTus/n/oCSxHZ6mxh6R1kjMyQtChD1YQ="; }; }; @@ -76,6 +76,20 @@ let hash = "sha256-hgNYz15z9FjNHoj4w4EW0SOrQh1c4uQSnsOOrt2CDhc="; }; }; + + implot = rec { + version = "0.16"; + src = fetchFromGitHub { + owner = "epezent"; + repo = "implot"; + rev = "v${version}"; + hash = "sha256-/wkVsgz3wiUVZBCgRl2iDD6GWb+AoHN+u0aeqHHgem0="; + }; + patch = fetchurl { + url = "https://wrapdb.mesonbuild.com/v2/implot_${version}-1/get_patch"; + hash = "sha256-HGsUYgZqVFL6UMHaHdR/7YQfKCMpcsgtd48pYpNlaMc="; + }; + }; in stdenv.mkDerivation (finalAttrs: { pname = "mangohud"; @@ -99,6 +113,7 @@ stdenv.mkDerivation (finalAttrs: { ''} cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version} cp -R --no-preserve=mode,ownership ${vulkan-headers.src} Vulkan-Headers-${vulkan-headers.version} + cp -R --no-preserve=mode,ownership ${implot.src} implot-${implot.version} )''; patches = [ @@ -140,6 +155,7 @@ stdenv.mkDerivation (finalAttrs: { cd subprojects unzip ${imgui.patch} unzip ${vulkan-headers.patch} + unzip ${implot.patch} ) ''; diff --git a/pkgs/mangohud/upstream/preload-nix-workaround.patch b/pkgs/mangohud/upstream/preload-nix-workaround.patch index f38e1703..ed5ce06b 100644 --- a/pkgs/mangohud/upstream/preload-nix-workaround.patch +++ b/pkgs/mangohud/upstream/preload-nix-workaround.patch @@ -1,26 +1,42 @@ diff --git a/bin/mangohud.in b/bin/mangohud.in -index 6c3c6e8..8847cdc 100755 +index 53c72ef..3cc4f19 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in -@@ -8,10 +8,10 @@ if [ "$#" -eq 0 ]; then - exit 1 - fi +@@ -13,13 +13,13 @@ fi + DISABLE_LD_PRELOAD="cs2.sh + some_other_exe" -MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so" +MANGOHUD_LIB_NAME="libMangoHud_opengl.so" if [ "$1" = "--dlsym" ]; then -- MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" -+ MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" - shift +- MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" ++ MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" + shift # shift will only be executed if $1 is "--dlsym" + elif [ "$MANGOHUD_DLSYM" = "1" ]; then +- MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" ++ MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" fi -@@ -31,5 +31,7 @@ case ":${LD_PRELOAD-}:" in - LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}" - esac + if [ "$1" = "--version" ]; then +@@ -40,8 +40,10 @@ for exe in $DISABLE_LD_PRELOAD; do + fi + done -+LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" +XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" ++ + if [ "$disable_preload" = true ]; then +- exec env MANGOHUD=1 "$@" ++ exec env MANGOHUD=1 XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@" + else + # Make sure we don't append mangohud lib multiple times + # otherwise, this could cause issues with the steam runtime +@@ -54,5 +56,7 @@ else + LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}" + esac --exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" -+exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@" +- exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" ++ LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ++ ++ exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@" + fi