gpu-screen-recorder/flake.nix

71 lines
1.6 KiB
Nix

{
description = "A very basic flake";
outputs = { self, nixpkgs }: let
gsr = { stdenv
, lib
, fetchurl
, makeWrapper
, pkg-config
, libXcomposite
, libpulseaudio
, ffmpeg
, wayland
, libdrm
, libva
, libglvnd
, libXrandr
, pipewire
}:
stdenv.mkDerivation {
pname = "gpu-screen-recorder";
version = "unstable-2023-11-18";
# printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
src = ./.;
#sourceRoot = ".";
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs = [
libXcomposite
libpulseaudio
ffmpeg
wayland
libdrm
libva
libXrandr
pipewire
];
buildPhase = ''
./build.sh
'';
postInstall = ''
install -Dt $out/bin gpu-screen-recorder gsr-kms-server
mkdir $out/bin/.wrapped
mv $out/bin/gpu-screen-recorder $out/bin/.wrapped/
makeWrapper "$out/bin/.wrapped/gpu-screen-recorder" "$out/bin/gpu-screen-recorder" \
--prefix LD_LIBRARY_PATH : ${libglvnd}/lib \
--prefix PATH : $out/bin
'';
meta = with lib; {
description = "A 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 = licenses.gpl3Only;
maintainers = with maintainers; [ babbaj ];
platforms = [ "x86_64-linux" ];
};
};
in {
packages.x86_64-linux.gsr = nixpkgs.legacyPackages.x86_64-linux.callPackage gsr {};
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.callPackage gsr {};
};
}