2024-06-11 16:42:47 -04:00
|
|
|
{
|
2024-08-04 13:52:41 -04:00
|
|
|
lib,
|
|
|
|
gpu-screen-recorder-src,
|
2024-06-11 16:42:47 -04:00
|
|
|
addOpenGLRunpath,
|
2024-07-15 21:28:00 -04:00
|
|
|
dbus,
|
2024-06-11 16:42:47 -04:00
|
|
|
ffmpeg,
|
|
|
|
libdrm,
|
|
|
|
libglvnd,
|
|
|
|
libpulseaudio,
|
|
|
|
libva,
|
|
|
|
makeWrapper,
|
|
|
|
meson,
|
|
|
|
ninja,
|
2024-07-15 21:28:00 -04:00
|
|
|
pipewire,
|
2024-06-11 16:42:47 -04:00
|
|
|
pkg-config,
|
2024-07-15 21:28:00 -04:00
|
|
|
stdenv,
|
2024-09-26 09:43:19 -04:00
|
|
|
vulkan-headers,
|
2024-06-11 16:42:47 -04:00
|
|
|
wayland,
|
|
|
|
xorg,
|
2024-11-26 20:48:07 -05:00
|
|
|
pname,
|
2024-06-11 16:42:47 -04:00
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib) makeLibraryPath;
|
|
|
|
inherit (builtins) fromTOML readFile;
|
|
|
|
|
|
|
|
tag =
|
|
|
|
(fromTOML (readFile "${gpu-screen-recorder-src}/project.conf"))
|
|
|
|
.package
|
|
|
|
.version;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2024-11-26 20:48:07 -05:00
|
|
|
inherit pname;
|
2024-06-11 16:42:47 -04:00
|
|
|
version = "${tag}+${gpu-screen-recorder-src.shortRev}";
|
|
|
|
|
|
|
|
src = gpu-screen-recorder-src;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2024-07-15 21:28:00 -04:00
|
|
|
dbus
|
2024-06-11 16:42:47 -04:00
|
|
|
libpulseaudio
|
2024-07-15 21:28:00 -04:00
|
|
|
pipewire
|
2024-06-11 16:42:47 -04:00
|
|
|
ffmpeg
|
|
|
|
wayland
|
|
|
|
libdrm
|
|
|
|
libva
|
2024-09-26 09:43:19 -04:00
|
|
|
vulkan-headers
|
2024-06-11 16:42:47 -04:00
|
|
|
xorg.libXcomposite
|
2024-06-21 18:15:19 -04:00
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXi
|
2024-06-11 16:42:47 -04:00
|
|
|
xorg.libXrandr
|
|
|
|
];
|
|
|
|
|
2024-07-30 01:45:01 -04:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dcapabilities=false"
|
|
|
|
"-Dnvidia_suspend_fix=false"
|
|
|
|
"-Dsystemd=false"
|
|
|
|
];
|
2024-06-11 16:42:47 -04:00
|
|
|
|
|
|
|
fixupPhase = ''
|
2024-11-21 11:26:08 -05:00
|
|
|
runHook preFixup
|
|
|
|
|
2024-06-11 16:42:47 -04:00
|
|
|
wrapProgram $out/bin/gpu-screen-recorder \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${
|
|
|
|
makeLibraryPath [
|
|
|
|
addOpenGLRunpath.driverLink
|
|
|
|
libglvnd
|
|
|
|
]
|
|
|
|
}"
|
2024-11-04 20:36:49 -05:00
|
|
|
|
2024-11-21 11:26:08 -05:00
|
|
|
runHook postFixup
|
2024-06-11 16:42:47 -04:00
|
|
|
'';
|
2024-06-12 13:09:42 -04:00
|
|
|
|
2024-11-26 20:48:07 -05:00
|
|
|
# This is needed to force gsr to lookup kms in PATH
|
|
|
|
# to get the security wrapper
|
|
|
|
postFixup =
|
|
|
|
if pname == "gpu-screen-recorder"
|
|
|
|
then
|
|
|
|
# bash
|
|
|
|
''
|
|
|
|
rm $out/bin/gsr-kms-server
|
|
|
|
''
|
|
|
|
else
|
|
|
|
# bash
|
|
|
|
''
|
|
|
|
rm $out/bin/gpu-screen-recorder
|
|
|
|
rm $out/bin/.gpu-screen-recorder-wrapped
|
|
|
|
'';
|
|
|
|
|
2024-06-12 13:09:42 -04:00
|
|
|
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"];
|
2024-11-26 20:48:07 -05:00
|
|
|
mainProgram = pname;
|
2024-06-12 13:09:42 -04:00
|
|
|
};
|
2024-06-11 16:42:47 -04:00
|
|
|
}
|