89 lines
1.8 KiB
Nix
89 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
gpu-screen-recorder-src,
|
|
addOpenGLRunpath,
|
|
dbus,
|
|
ffmpeg,
|
|
libdrm,
|
|
libglvnd,
|
|
libpulseaudio,
|
|
libva,
|
|
makeWrapper,
|
|
meson,
|
|
ninja,
|
|
pipewire,
|
|
pkg-config,
|
|
stdenv,
|
|
vulkan-headers,
|
|
wayland,
|
|
xorg,
|
|
...
|
|
}: let
|
|
inherit (lib) makeLibraryPath;
|
|
inherit (builtins) fromTOML readFile;
|
|
|
|
tag =
|
|
(fromTOML (readFile "${gpu-screen-recorder-src}/project.conf"))
|
|
.package
|
|
.version;
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "gpu-screen-recorder";
|
|
version = "${tag}+${gpu-screen-recorder-src.shortRev}";
|
|
|
|
src = gpu-screen-recorder-src;
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
makeWrapper
|
|
meson
|
|
ninja
|
|
];
|
|
|
|
buildInputs = [
|
|
dbus
|
|
libpulseaudio
|
|
pipewire
|
|
ffmpeg
|
|
wayland
|
|
libdrm
|
|
libva
|
|
vulkan-headers
|
|
xorg.libXcomposite
|
|
xorg.libXdamage
|
|
xorg.libXi
|
|
xorg.libXrandr
|
|
];
|
|
|
|
mesonFlags = [
|
|
"-Dcapabilities=false"
|
|
"-Dnvidia_suspend_fix=false"
|
|
"-Dsystemd=false"
|
|
];
|
|
|
|
fixupPhase = ''
|
|
wrapProgram $out/bin/gpu-screen-recorder \
|
|
--prefix LD_LIBRARY_PATH : "${
|
|
makeLibraryPath [
|
|
addOpenGLRunpath.driverLink
|
|
libglvnd
|
|
]
|
|
}"
|
|
|
|
# This is needed to force gsr to lookup kms in PATH
|
|
# to get the security wrapper
|
|
mkdir -p $gsr $kms/bin
|
|
cp -r $out/bin $gsr
|
|
mv $gsr/bin/gsr-kms-server $kms/bin
|
|
rm $out/bin/gsr-kms-server
|
|
'';
|
|
|
|
outputs = ["out" "gsr" "kms"];
|
|
|
|
meta = {
|
|
description = "Screen recorder that has minimal impact on system performance by recording a window using the GPU only";
|
|
homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/";
|
|
license = lib.licenses.gpl3Only;
|
|
platforms = ["x86_64-linux"];
|
|
};
|
|
}
|