libstrangle: use direct nix store path in layer json

This allows you to load libstrangle without setting LD_LIBRARY_PATH to include
it. Only ENABLE_VK_LAYER_TORKEL104_libstrangle=1 is required now, as expected of
an implicit layer.

Previously, you were required to run your VK app via the wrapper:

    STRANGLE_FPS=30 strangle vkcube

Now you can control it via simple environment variables alone:

    ENABLE_VK_LAYER_TORKEL104_libstrangle=1 STRANGLE_FPS=30 vkcube
This commit is contained in:
Atemu 2022-06-30 00:40:01 +02:00
parent 6141b8932a
commit 1a37a30af7

View File

@ -23,6 +23,10 @@ stdenv.mkDerivation rec {
substituteAllInPlace src/strangle.sh
substituteAllInPlace src/stranglevk.sh
'';
postInstall = ''
substituteInPlace $out/share/vulkan/implicit_layer.d/libstrangle_vk.json \
--replace "libstrangle_vk.so" "$out/lib/libstrangle/lib64/libstrangle_vk.so"
'';
meta = with lib; {
homepage = "https://gitlab.com/torkel104/libstrangle";