From 90dfc4d3718405a01147403f7df66a2daa8c3139 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 01/12] gpu-screen-recorder: unstable-2024-07-05 -> 4.1.11 Co-authored-by: Keenan Weaver --- ...stemd-unit-files-using-absolute-path.patch | 25 ------------- .../video/gpu-screen-recorder/default.nix | 37 ++++++++++++------- 2 files changed, 23 insertions(+), 39 deletions(-) delete mode 100644 pkgs/applications/video/gpu-screen-recorder/0001-Don-t-install-systemd-unit-files-using-absolute-path.patch diff --git a/pkgs/applications/video/gpu-screen-recorder/0001-Don-t-install-systemd-unit-files-using-absolute-path.patch b/pkgs/applications/video/gpu-screen-recorder/0001-Don-t-install-systemd-unit-files-using-absolute-path.patch deleted file mode 100644 index 1403d59b86ba..000000000000 --- a/pkgs/applications/video/gpu-screen-recorder/0001-Don-t-install-systemd-unit-files-using-absolute-path.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cd8c6561079ee4c53b4bed390edd75a730ac685d Mon Sep 17 00:00:00 2001 -From: Tim Schumacher -Date: Thu, 4 Jul 2024 16:26:36 +0200 -Subject: [PATCH] Don't install systemd unit files using absolute paths - ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index a188f16..7807abe 100644 ---- a/meson.build -+++ b/meson.build -@@ -54,7 +54,7 @@ executable('gsr-kms-server', 'kms/server/kms_server.c', dependencies : dependenc - executable('gpu-screen-recorder', src, dependencies : dep, install : true) - - if get_option('systemd') == true -- install_data(files('extra/gpu-screen-recorder.service'), install_dir : '/usr/lib/systemd/user') -+ install_data(files('extra/gpu-screen-recorder.service'), install_dir : 'lib/systemd/user') - endif - - if get_option('capabilities') == true --- -2.45.1 - diff --git a/pkgs/applications/video/gpu-screen-recorder/default.nix b/pkgs/applications/video/gpu-screen-recorder/default.nix index 663d82640247..6b9a4f0ed251 100644 --- a/pkgs/applications/video/gpu-screen-recorder/default.nix +++ b/pkgs/applications/video/gpu-screen-recorder/default.nix @@ -5,11 +5,14 @@ makeWrapper, meson, ninja, + addDriverRunpath, pkg-config, libXcomposite, libpulseaudio, + dbus, ffmpeg, wayland, + pipewire, libdrm, libva, libglvnd, @@ -22,14 +25,13 @@ stdenv.mkDerivation { pname = "gpu-screen-recorder"; - version = "unstable-2024-07-05"; + version = "4.1.11"; - # Snapshot tarballs use the following versioning format: - # printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" src = fetchurl { - url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.r641.48cd80f.tar.gz"; - hash = "sha256-hIEK8EYIxQTTiFePPZf4V0nsxqxkfcDeOG9GK9whn+0="; + url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.4.1.11.tar.gz"; + hash = "sha256-XCs40MzObfNtErxnN3rYQ722TAiREcbaJZet+VJfimg="; }; + sourceRoot = "."; nativeBuildInputs = [ @@ -42,7 +44,9 @@ stdenv.mkDerivation { buildInputs = [ libXcomposite libpulseaudio + dbus ffmpeg + pipewire wayland libdrm libva @@ -52,22 +56,27 @@ stdenv.mkDerivation { libXfixes ]; - patches = [ ./0001-Don-t-install-systemd-unit-files-using-absolute-path.patch ]; - mesonFlags = [ - "-Dsystemd=true" - - # Capabilities are handled by security.wrappers if possible. - "-Dcapabilities=false" + # Enable Wayland support + (lib.mesonBool "portal" true) + # Handle by the module + (lib.mesonBool "capabilities" false) + (lib.mesonBool "systemd" false) + (lib.mesonBool "nvidia_suspend_fix" false) ]; postInstall = '' 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 : ${wrapperDir} \ - --suffix PATH : $out/bin + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + libglvnd + addDriverRunpath.driverLink + ] + }" \ + --prefix PATH : "${wrapperDir}" \ + --suffix PATH : "$out/bin" ''; meta = { From 9a6c897b58a33692b4fa4f3cc530ae4538ec44f2 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 02/12] gpu-screen-recorder: add finalAttrs pattern Co-authored-by: Keenan Weaver --- pkgs/applications/video/gpu-screen-recorder/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/default.nix b/pkgs/applications/video/gpu-screen-recorder/default.nix index 6b9a4f0ed251..58a63428786c 100644 --- a/pkgs/applications/video/gpu-screen-recorder/default.nix +++ b/pkgs/applications/video/gpu-screen-recorder/default.nix @@ -23,12 +23,12 @@ wrapperDir ? "/run/wrappers/bin", }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "gpu-screen-recorder"; version = "4.1.11"; src = fetchurl { - url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.4.1.11.tar.gz"; + url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.${finalAttrs.version}.tar.gz"; hash = "sha256-XCs40MzObfNtErxnN3rYQ722TAiREcbaJZet+VJfimg="; }; @@ -87,4 +87,4 @@ stdenv.mkDerivation { maintainers = [ lib.maintainers.babbaj ]; platforms = [ "x86_64-linux" ]; }; -} +}) From c9ea67f02d6932e5acbc5bb23bb6ac6207e7365e Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 03/12] gpu-screen-recorder: sort meta --- pkgs/applications/video/gpu-screen-recorder/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/default.nix b/pkgs/applications/video/gpu-screen-recorder/default.nix index 58a63428786c..0fea41afd9b0 100644 --- a/pkgs/applications/video/gpu-screen-recorder/default.nix +++ b/pkgs/applications/video/gpu-screen-recorder/default.nix @@ -81,9 +81,9 @@ stdenv.mkDerivation (finalAttrs: { meta = { description = "Screen recorder that has minimal impact on system performance by recording a window using the GPU only"; - mainProgram = "gpu-screen-recorder"; homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/"; license = lib.licenses.gpl3Only; + mainProgram = "gpu-screen-recorder"; maintainers = [ lib.maintainers.babbaj ]; platforms = [ "x86_64-linux" ]; }; From 28f19a446c65cb242dfe818098b79d208c7eb846 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 04/12] gpu-screen-recorder-gtk: format with nixfmt-rfc-style --- .../gpu-screen-recorder-gtk.nix | 63 ++++++++++--------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index b0c19e80a0be..87f1a7fc1d67 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -1,22 +1,23 @@ -{ stdenv -, lib -, fetchurl -, pkg-config -, desktop-file-utils -, makeWrapper -, meson -, ninja -, gtk3 -, libayatana-appindicator -, libpulseaudio -, libdrm -, gpu-screen-recorder -, libglvnd -, libX11 -, libXrandr -, wayland -, wrapGAppsHook3 -, wrapperDir ? "/run/wrappers/bin" +{ + stdenv, + lib, + fetchurl, + pkg-config, + desktop-file-utils, + makeWrapper, + meson, + ninja, + gtk3, + libayatana-appindicator, + libpulseaudio, + libdrm, + gpu-screen-recorder, + libglvnd, + libX11, + libXrandr, + wayland, + wrapGAppsHook3, + wrapperDir ? "/run/wrappers/bin", }: stdenv.mkDerivation { @@ -50,16 +51,20 @@ stdenv.mkDerivation { wayland ]; - preFixup = let - gpu-screen-recorder-wrapped = gpu-screen-recorder.override { - inherit wrapperDir; - }; - in '' - gappsWrapperArgs+=(--prefix PATH : ${wrapperDir}) - gappsWrapperArgs+=(--suffix PATH : ${lib.makeBinPath [ gpu-screen-recorder-wrapped ]}) - # we also append /run/opengl-driver/lib as it otherwise fails to find libcuda. - gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd ]}:/run/opengl-driver/lib) - ''; + preFixup = + let + gpu-screen-recorder-wrapped = gpu-screen-recorder.override { + inherit wrapperDir; + }; + in + '' + gappsWrapperArgs+=(--prefix PATH : ${wrapperDir}) + gappsWrapperArgs+=(--suffix PATH : ${lib.makeBinPath [ gpu-screen-recorder-wrapped ]}) + # we also append /run/opengl-driver/lib as it otherwise fails to find libcuda. + gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ libglvnd ] + }:/run/opengl-driver/lib) + ''; meta = { description = "GTK frontend for gpu-screen-recorder."; From 2a0a0c1258223b81d022978b7dcbfe606e8b01be Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 05/12] gpu-screen-recorder-gtk: unstable-2024-07-05 -> 4.1.11 Co-authored-by: Keenan Weaver --- .../gpu-screen-recorder-gtk.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index 87f1a7fc1d67..200fceea5e64 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -3,6 +3,7 @@ lib, fetchurl, pkg-config, + addDriverRunpath, desktop-file-utils, makeWrapper, meson, @@ -22,14 +23,13 @@ stdenv.mkDerivation { pname = "gpu-screen-recorder-gtk"; - version = "unstable-2024-07-05"; + version = "4.1.11"; - # Snapshot tarballs use the following versioning format: - # printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" src = fetchurl { - url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.r311.c611c51.tar.gz"; - hash = "sha256-86EdmeZ2dlffSfJOrTVGPtYyL3j6DmCQIALX2rpeS1Y="; + url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.4.1.11.tar.gz"; + hash = "sha256-aLdzMOtKGR0llt+CyTVVX5xc18L9ddlYApe+dcqGRWY="; }; + sourceRoot = "."; nativeBuildInputs = [ @@ -60,10 +60,12 @@ stdenv.mkDerivation { '' gappsWrapperArgs+=(--prefix PATH : ${wrapperDir}) gappsWrapperArgs+=(--suffix PATH : ${lib.makeBinPath [ gpu-screen-recorder-wrapped ]}) - # we also append /run/opengl-driver/lib as it otherwise fails to find libcuda. gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ libglvnd ] - }:/run/opengl-driver/lib) + lib.makeLibraryPath [ + libglvnd + addDriverRunpath.driverLink + ] + }) ''; meta = { From 2e74ecd620fbd6054bb93cacbba9720d4013dfc4 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 06/12] gpu-screen-recorder-gtk: add finalAttrs pattern Co-authored-by: Keenan Weaver --- .../video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index 200fceea5e64..ad212af1db81 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -21,12 +21,12 @@ wrapperDir ? "/run/wrappers/bin", }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "gpu-screen-recorder-gtk"; version = "4.1.11"; src = fetchurl { - url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.4.1.11.tar.gz"; + url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.${finalAttrs.version}.tar.gz"; hash = "sha256-aLdzMOtKGR0llt+CyTVVX5xc18L9ddlYApe+dcqGRWY="; }; @@ -76,4 +76,4 @@ stdenv.mkDerivation { maintainers = with lib.maintainers; [ babbaj ]; platforms = [ "x86_64-linux" ]; }; -} +}) From 5668a1c2962d49071b7c42f514a09be7bcad5a1a Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 07/12] gpu-screen-recorder-gtk: sort meta --- .../video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index ad212af1db81..62c845d3a290 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -70,9 +70,9 @@ stdenv.mkDerivation (finalAttrs: { meta = { description = "GTK frontend for gpu-screen-recorder."; - mainProgram = "gpu-screen-recorder-gtk"; homepage = "https://git.dec05eba.com/gpu-screen-recorder-gtk/about/"; license = lib.licenses.gpl3Only; + mainProgram = "gpu-screen-recorder-gtk"; maintainers = with lib.maintainers; [ babbaj ]; platforms = [ "x86_64-linux" ]; }; From c46ef12665992330f3857a7ec5f17e624b86abce Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:05:11 +0300 Subject: [PATCH 08/12] gpu-screen-recorder-gtk: add changelog Co-authored-by: dec05eba --- .../video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index 62c845d3a290..c0641515cf30 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -69,6 +69,7 @@ stdenv.mkDerivation (finalAttrs: { ''; meta = { + changelog = "https://git.dec05eba.com/gpu-screen-recorder-gtk/tree/com.dec05eba.gpu_screen_recorder.appdata.xml#n82"; description = "GTK frontend for gpu-screen-recorder."; homepage = "https://git.dec05eba.com/gpu-screen-recorder-gtk/about/"; license = lib.licenses.gpl3Only; From 8d564190a9413ab372dfb7201e6dcb899677e2f3 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:27:45 +0300 Subject: [PATCH 09/12] nixos/gpu-screen-recorder: format with nixfmt-rfc-style --- nixos/modules/programs/gpu-screen-recorder.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos/modules/programs/gpu-screen-recorder.nix b/nixos/modules/programs/gpu-screen-recorder.nix index 39d0e2545241..156123de7a38 100644 --- a/nixos/modules/programs/gpu-screen-recorder.nix +++ b/nixos/modules/programs/gpu-screen-recorder.nix @@ -1,14 +1,20 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.programs.gpu-screen-recorder; package = cfg.package.override { inherit (config.security) wrapperDir; }; -in { +in +{ options = { programs.gpu-screen-recorder = { - package = lib.mkPackageOption pkgs "gpu-screen-recorder" {}; + package = lib.mkPackageOption pkgs "gpu-screen-recorder" { }; enable = lib.mkOption { type = lib.types.bool; From 7b69d089ca4c96096f06ed848d55a28e41d6b271 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:27:45 +0300 Subject: [PATCH 10/12] nixos/gpu-screen-recorder: remove `cap_sys_nice` Reason: https://github.com/NixOS/nixpkgs/pull/339874#discussion_r1788687308 Co-authored-by: dec05eba --- nixos/modules/programs/gpu-screen-recorder.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nixos/modules/programs/gpu-screen-recorder.nix b/nixos/modules/programs/gpu-screen-recorder.nix index 156123de7a38..5a9401943dfe 100644 --- a/nixos/modules/programs/gpu-screen-recorder.nix +++ b/nixos/modules/programs/gpu-screen-recorder.nix @@ -34,12 +34,6 @@ in capabilities = "cap_sys_admin+ep"; source = "${package}/bin/gsr-kms-server"; }; - security.wrappers."gpu-screen-recorder" = { - owner = "root"; - group = "root"; - capabilities = "cap_sys_nice+ep"; - source = "${package}/bin/gpu-screen-recorder"; - }; }; meta.maintainers = with lib.maintainers; [ timschumi ]; From 9affa2c17d266b61e8329d33e8b724737e2c9490 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:29:47 +0300 Subject: [PATCH 11/12] gpu-screen-recorder: 4.1.11 -> 4.2.1 Co-authored-by: Keenan Weaver --- pkgs/applications/video/gpu-screen-recorder/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/default.nix b/pkgs/applications/video/gpu-screen-recorder/default.nix index 0fea41afd9b0..3df7380579eb 100644 --- a/pkgs/applications/video/gpu-screen-recorder/default.nix +++ b/pkgs/applications/video/gpu-screen-recorder/default.nix @@ -12,6 +12,7 @@ dbus, ffmpeg, wayland, + vulkan-headers, pipewire, libdrm, libva, @@ -25,11 +26,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "gpu-screen-recorder"; - version = "4.1.11"; + version = "4.2.1"; src = fetchurl { url = "https://dec05eba.com/snapshot/gpu-screen-recorder.git.${finalAttrs.version}.tar.gz"; - hash = "sha256-XCs40MzObfNtErxnN3rYQ722TAiREcbaJZet+VJfimg="; + hash = "sha256-eCjAlPEg8lkL8T0lgxr0F8ouFGwqfsRxDSQuG6RbpZE="; }; sourceRoot = "."; @@ -48,6 +49,7 @@ stdenv.mkDerivation (finalAttrs: { ffmpeg pipewire wayland + vulkan-headers libdrm libva libXdamage From 04a6068c182cbcd17d530395c571a0d6b81dfcdd Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:31:52 +0300 Subject: [PATCH 12/12] gpu-screen-recorder-gtk: 4.1.11 -> 4.2.1 Co-authored-by: Keenan Weaver --- .../video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix index c0641515cf30..d84527dcaebb 100644 --- a/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix +++ b/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix @@ -23,11 +23,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "gpu-screen-recorder-gtk"; - version = "4.1.11"; + version = "4.2.1"; src = fetchurl { url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.${finalAttrs.version}.tar.gz"; - hash = "sha256-aLdzMOtKGR0llt+CyTVVX5xc18L9ddlYApe+dcqGRWY="; + hash = "sha256-qk5bI23fypvv0yN9Ql7TOerBhoRzj65EcoAy3lMGMqc="; }; sourceRoot = ".";