diff options
| author | coopi <coopi@noreply.codeberg.org> | 2026-08-07 06:12:16 +0400 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-08-22 16:49:17 +0200 |
| commit | 0f547264cdc1c61c6fdd6145b5a8527f93f02ff2 (patch) | |
| tree | 04415f80992eef68d71d76df7cd942797e3d8c58 /gnu | |
| parent | 5bb5d195eefa6360493bbbea39e6b29775d9e817 (diff) | |
gnu: packages: Add gpu-screen-recorder.
* gnu/packages/video.scm (gpu-screen-recorder): New variable.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/gpu-screen-recorder-privileged-kms-helper.patch | 24 | ||||
| -rw-r--r-- | gnu/packages/video.scm | 73 |
3 files changed, 98 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 10ab386e580..f90c12810fd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1550,6 +1550,7 @@ dist_patch_DATA = \ | |||
| 1550 | %D%/packages/patches/gpaste-fix-paths.patch \ | 1550 | %D%/packages/patches/gpaste-fix-paths.patch \ |
| 1551 | %D%/packages/patches/gpm-glibc-2.26.patch \ | 1551 | %D%/packages/patches/gpm-glibc-2.26.patch \ |
| 1552 | %D%/packages/patches/gpodder-disable-updater.patch \ | 1552 | %D%/packages/patches/gpodder-disable-updater.patch \ |
| 1553 | %D%/packages/patches/gpu-screen-recorder-privileged-kms-helper.patch \ | ||
| 1553 | %D%/packages/patches/grantlee-fix-i586-precision.patch \ | 1554 | %D%/packages/patches/grantlee-fix-i586-precision.patch \ |
| 1554 | %D%/packages/patches/grantlee-register-metaenumvariable.patch \ | 1555 | %D%/packages/patches/grantlee-register-metaenumvariable.patch \ |
| 1555 | %D%/packages/patches/graphite2-non-linux.patch \ | 1556 | %D%/packages/patches/graphite2-non-linux.patch \ |
diff --git a/gnu/packages/patches/gpu-screen-recorder-privileged-kms-helper.patch b/gnu/packages/patches/gpu-screen-recorder-privileged-kms-helper.patch new file mode 100644 index 00000000000..078ccee23e7 --- /dev/null +++ b/gnu/packages/patches/gpu-screen-recorder-privileged-kms-helper.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | Look for the capability-bearing gsr-kms-server installed by Guix System before | ||
| 2 | using the unprivileged copy next to gpu-screen-recorder. | ||
| 3 | |||
| 4 | When the privileged helper is absent, retain the existing lookup and pkexec | ||
| 5 | fallback. | ||
| 6 | |||
| 7 | diff --git a/kms/client/kms_client.c b/kms/client/kms_client.c | ||
| 8 | --- a/kms/client/kms_client.c | ||
| 9 | +++ b/kms/client/kms_client.c | ||
| 10 | @@ -255,6 +255,14 @@ int gsr_kms_client_init(gsr_kms_client *self, const char *card_path) { | ||
| 11 | return -1; | ||
| 12 | } | ||
| 13 | |||
| 14 | +#ifdef __linux__ | ||
| 15 | + const char *privileged_server_filepath = "/run/privileged/bin/gsr-kms-server"; | ||
| 16 | + if(access(privileged_server_filepath, X_OK) == 0) { | ||
| 17 | + snprintf(server_filepath, sizeof(server_filepath), "%s", | ||
| 18 | + privileged_server_filepath); | ||
| 19 | + } | ||
| 20 | +#endif | ||
| 21 | + | ||
| 22 | if(access(server_filepath, F_OK) != 0) { | ||
| 23 | fprintf(stderr, "gsr info: gsr_kms_client_init: gsr-kms-server is not installed in the same directory as gpu-screen-recorder (%s not found), looking for gsr-kms-server in PATH instead\n", server_filepath); | ||
| 24 | if(!find_program_in_path("gsr-kms-server", server_filepath, sizeof(server_filepath)) || access(server_filepath, F_OK) != 0) { \ No newline at end of file | ||
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 482ff685d6c..7358276ecef 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm | |||
| @@ -2561,6 +2561,79 @@ combination of audio, video, subtitles, metadata, scalable graphics, encrypted | |||
| 2561 | media, 2D/3D graphics and ECMAScript.") | 2561 | media, 2D/3D graphics and ECMAScript.") |
| 2562 | (license license:lgpl2.1+)))) | 2562 | (license license:lgpl2.1+)))) |
| 2563 | 2563 | ||
| 2564 | (define-public gpu-screen-recorder | ||
| 2565 | (package | ||
| 2566 | (name "gpu-screen-recorder") | ||
| 2567 | (version "5.15.3") | ||
| 2568 | (source | ||
| 2569 | (origin | ||
| 2570 | (method git-fetch) | ||
| 2571 | (uri (git-reference | ||
| 2572 | (url "https://repo.dec05eba.com/gpu-screen-recorder") | ||
| 2573 | (commit version))) | ||
| 2574 | (file-name (git-file-name name version)) | ||
| 2575 | (sha256 | ||
| 2576 | (base32 | ||
| 2577 | "1kiqvbs9fbgm5gxlxfybnyfmd0chgi7gzm6wr1cpafnvg1x203dm")) | ||
| 2578 | (patches | ||
| 2579 | (search-patches | ||
| 2580 | "gpu-screen-recorder-privileged-kms-helper.patch")))) | ||
| 2581 | (build-system meson-build-system) | ||
| 2582 | (arguments | ||
| 2583 | (list | ||
| 2584 | #:configure-flags | ||
| 2585 | #~(list "-Dsystemd=false" | ||
| 2586 | "-Dcapabilities=false" | ||
| 2587 | "-Dnvidia_suspend_fix=false") | ||
| 2588 | #:tests? #f ;no test suite | ||
| 2589 | #:phases | ||
| 2590 | #~(modify-phases %standard-phases | ||
| 2591 | (add-after 'unpack 'patch-runtime-paths | ||
| 2592 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 2593 | (substitute* '("src/egl.c" | ||
| 2594 | "src/codec_query/vulkan.c" | ||
| 2595 | "src/capture/v4l2.c" | ||
| 2596 | "src/image_writer.c") | ||
| 2597 | (("dlopen\\(\"([^\"]*)\"," match library) | ||
| 2598 | (format #f "dlopen(~s," | ||
| 2599 | (search-input-file | ||
| 2600 | inputs (string-append "lib/" library))))) | ||
| 2601 | |||
| 2602 | (substitute* "kms/client/kms_client.c" | ||
| 2603 | (("const char \\*args\\[\\] = \\{ \"pkexec\",") | ||
| 2604 | (format #f "const char *args[] = { ~s," | ||
| 2605 | (search-input-file inputs "bin/pkexec"))))))))) | ||
| 2606 | (native-inputs | ||
| 2607 | (list pkg-config | ||
| 2608 | wayland)) | ||
| 2609 | (inputs | ||
| 2610 | (list dbus | ||
| 2611 | ffmpeg | ||
| 2612 | libcap | ||
| 2613 | libdrm | ||
| 2614 | libglvnd | ||
| 2615 | libjpeg-turbo | ||
| 2616 | libva | ||
| 2617 | libx11 | ||
| 2618 | libxcomposite | ||
| 2619 | libxdamage | ||
| 2620 | libxfixes | ||
| 2621 | libxrandr | ||
| 2622 | pipewire | ||
| 2623 | polkit | ||
| 2624 | pulseaudio | ||
| 2625 | vulkan-headers | ||
| 2626 | vulkan-loader | ||
| 2627 | wayland)) | ||
| 2628 | (home-page "https://git.dec05eba.com/gpu-screen-recorder/about") | ||
| 2629 | (synopsis "GPU-accelerated screen recorder") | ||
| 2630 | (description | ||
| 2631 | "GPU Screen Recorder records monitors, windows, regions, and applications | ||
| 2632 | using hardware-accelerated video encoding. It supports X11 and Wayland, | ||
| 2633 | desktop-portal capture, application audio capture, screenshots, streaming, and | ||
| 2634 | replay buffering.") | ||
| 2635 | (license license:gpl3))) | ||
| 2636 | |||
| 2564 | (define-public vlc | 2637 | (define-public vlc |
| 2565 | (package | 2638 | (package |
| 2566 | (name "vlc") | 2639 | (name "vlc") |
