refactor(gsr): clean up deriv and remove path warning

This commit is contained in:
matt1432 2025-02-11 12:30:42 -05:00
parent f68fcce055
commit 2c070a4be0
3 changed files with 18 additions and 9 deletions
packages/gpu-screen-recorder

View file

@ -1,6 +1,10 @@
{
lib,
# Params
pname,
gpu-screen-recorder-src,
isKmsServer ? false,
# Derivation deps
lib,
addDriverRunpath,
dbus,
ffmpeg,
@ -17,7 +21,6 @@
vulkan-headers,
wayland,
xorg,
pname,
...
}: let
inherit (lib) makeLibraryPath;
@ -34,6 +37,11 @@ in
src = gpu-screen-recorder-src;
# Get rid of useless warning
postPatch = ''
sed -i 's/.*gsr-kms-server is not installed in the same directory.*//' ./kms/client/kms_client.c
'';
nativeBuildInputs = [
pkg-config
makeWrapper
@ -79,17 +87,17 @@ in
# This is needed to force gsr to lookup kms in PATH
# to get the security wrapper
postFixup =
if pname == "gpu-screen-recorder"
if isKmsServer
then
# bash
''
rm $out/bin/gsr-kms-server
''
else
# bash
''
rm $out/bin/gpu-screen-recorder
rm $out/bin/.gpu-screen-recorder-wrapped
''
else
# bash
''
rm $out/bin/gsr-kms-server
'';
meta = {

View file

@ -5,5 +5,6 @@
}:
callPackage ./generic.nix {
pname = "gsr-kms-server";
isKmsServer = true;
inherit gpu-screen-recorder-src;
}