about summary refs log tree commit diff
path: root/pkgs/tools/graphics/mangohud
diff options
context:
space:
mode:
authorKira Bruneau <kira.bruneau@pm.me>2022-08-15 12:54:46 -0400
committerGitHub <noreply@github.com>2022-08-15 12:54:46 -0400
commit72061fe3fe1192ece7f2646e373adf45da5b2bc9 (patch)
treeaf5533abcce3b572151ea6b8da9b16fbee47a354 /pkgs/tools/graphics/mangohud
parent66c94cd524b97bc01d5fa899d439932f98344655 (diff)
parent2d6481a4fd35069c271bbb2967a4c59989b010fc (diff)
Merge pull request #185016 from kira-bruneau/mangohud
mangohud: statically link spdlog
Diffstat (limited to 'pkgs/tools/graphics/mangohud')
-rw-r--r--pkgs/tools/graphics/mangohud/default.nix32
1 files changed, 28 insertions, 4 deletions
diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix
index 26c1b99216c6e..7202f9f8b5628 100644
--- a/pkgs/tools/graphics/mangohud/default.nix
+++ b/pkgs/tools/graphics/mangohud/default.nix
@@ -25,7 +25,6 @@
 , vulkan-loader
 , libXNVCtrl
 , wayland
-, spdlog
 , glew
 , glfw
 , nlohmann_json
@@ -49,6 +48,27 @@ let
       sha256 = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18=";
     };
   };
+
+  # Derived from subprojects/spdlog.wrap
+  #
+  # NOTE: We only statically link spdlog due to a bug in pressure-vessel:
+  # https://github.com/ValveSoftware/steam-runtime/issues/511
+  #
+  # Once this fix is released upstream, we should switch back to using
+  # the system provided spdlog
+  spdlog = rec {
+    version = "1.8.5";
+    src = fetchFromGitHub {
+      owner = "gabime";
+      repo = "spdlog";
+      rev = "refs/tags/v${version}";
+      sha256 = "sha256-D29jvDZQhPscaOHlrzGN1s7/mXlcsovjbqYpXd7OM50=";
+    };
+    patch = fetchurl {
+      url = "https://wrapdb.mesonbuild.com/v2/spdlog_${version}-1/get_patch";
+      sha256 = "sha256-PDjyddV5KxKGORECWUMp6YsXc3kks0T5gxKrCZKbdL4=";
+    };
+  };
 in stdenv.mkDerivation rec {
   pname = "mangohud";
   version = "0.6.8";
@@ -67,7 +87,7 @@ in stdenv.mkDerivation rec {
   postUnpack = ''(
     cd "$sourceRoot/subprojects"
     cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version}
-    unzip ${imgui.patch}
+    cp -R --no-preserve=mode,ownership ${spdlog.src} spdlog-${spdlog.version}
   )'';
 
   patches = [
@@ -102,11 +122,16 @@ in stdenv.mkDerivation rec {
     })
   ];
 
+  postPatch = ''(
+    cd subprojects
+    unzip ${imgui.patch}
+    unzip ${spdlog.patch}
+  )'';
+
   mesonFlags = [
     "-Duse_system_vulkan=enabled"
     "-Dvulkan_datadir=${vulkan-headers}/share"
     "-Dwith_wayland=enabled"
-    "-Duse_system_spdlog=enabled"
   ] ++ lib.optionals gamescopeSupport [
     "-Dmangoapp_layer=true"
     "-Dmangoapp=true"
@@ -130,7 +155,6 @@ in stdenv.mkDerivation rec {
     libX11
     libXNVCtrl
     wayland
-    spdlog
   ] ++ lib.optionals gamescopeSupport [
     glew
     glfw