Commit 7eacc7f5 authored by Atemu's avatar Atemu
Browse files

mangohud: make lower bitness support configurable

This allows the user to disable 32-bit support for closure size reasons or in
order to mitigate loader issues like
https://github.com/NixOS/nixpkgs/issues/230978.

The name is weird because it can't start with a digit :/
parent 272154f2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
, glfw
, xorg
, gamescopeSupport ? true # build mangoapp and mangohudctl
, lowerBitnessSupport ? stdenv.hostPlatform.is64bit # Support 32 bit on 64bit
, nix-update-script
}:

@@ -128,7 +129,7 @@ stdenv.mkDerivation (finalAttrs: {
    substituteInPlace bin/mangohud.in \
      --subst-var-by libraryPath ${lib.makeSearchPath "lib/mangohud" ([
        (placeholder "out")
      ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
      ] ++ lib.optionals lowerBitnessSupport [
        mangohud32
      ])} \
      --subst-var-by dataDir ${placeholder "out"}/share
@@ -184,7 +185,7 @@ stdenv.mkDerivation (finalAttrs: {

  # Support 32bit Vulkan applications by linking in 32bit Vulkan layers
  # This is needed for the same reason the 32bit preload workaround is needed.
  postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
  postInstall = lib.optionalString lowerBitnessSupport ''
    ln -s ${mangohud32}/share/vulkan/implicit_layer.d/MangoHud.x86.json \
      "$out/share/vulkan/implicit_layer.d"