Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #54349 from ar1a/pb-capture

Pb cli and capture initialization

authored by

Graham Christensen and committed by
GitHub
44cd0a36 ee9a2358

+117
+10
pkgs/tools/misc/capture/0001-eval-fix.patch
···
··· 1 + diff --git a/src/capture.sh b/src/capture.sh 2 + index a32b018..82d1f15 100755 3 + --- a/src/capture.sh 4 + +++ b/src/capture.sh 5 + @@ -103,4 +103,4 @@ capture () { 6 + 7 + 8 + # remove this line if you want to source this file instead 9 + -eval " ${0##*/}" "$@" 10 + +capture "$@"
+22
pkgs/tools/misc/capture/0002-sane-defaults.patch
···
··· 1 + diff --git a/src/capture.sh b/src/capture.sh 2 + index a32b018..42f3936 100755 3 + --- a/src/capture.sh 4 + +++ b/src/capture.sh 5 + @@ -9,7 +9,7 @@ set -e 6 + # 7 + 8 + scale="-1:-1" 9 + -fps="15" 10 + +fps="30" 11 + raw_video="-vf fps=$fps -c:v utvideo -f nut" 12 + raw_video_container=".nut" 13 + 14 + @@ -18,7 +18,7 @@ raw_video_container=".nut" 15 + # https://stackoverflow.com/questions/41372045/vp9-encoding-limited-to-4-threads 16 + webm_video="-pix_fmt yuv420p -c:v libvpx-vp9 -crf 25 -b:v 0 -f webm -tile-columns 6 -frame-parallel 1 -threads 8" 17 + 18 + -tmpdir="/var/tmp" 19 + +tmpdir="/tmp" 20 + 21 + 22 + # capture_raw ./foo.nut
+31
pkgs/tools/misc/capture/default.nix
···
··· 1 + { stdenv, pkgs, slop, ffmpeg, fetchFromGitHub, makeWrapper}: 2 + 3 + stdenv.mkDerivation rec { 4 + name = "capture-${version}"; 5 + version = "1.0"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "buhman"; 9 + repo = "capture"; 10 + rev = "4be986f17462b8d520559429c74da6bf3a436259"; 11 + sha256 = "172y06vs993x5v78zwl81xma1gkvjq1ad9rvmf3a217fyxsz4nhh"; 12 + }; 13 + 14 + buildInputs = [ makeWrapper ]; 15 + 16 + patches = [ ./0001-eval-fix.patch ./0002-sane-defaults.patch ]; 17 + 18 + installPhase = '' 19 + install -Dm755 src/capture.sh $out/bin/capture 20 + 21 + patchShebangs $out/bin/capture 22 + wrapProgram $out/bin/capture \ 23 + --prefix PATH : '${stdenv.lib.makeBinPath [ slop ffmpeg ]}' 24 + ''; 25 + 26 + meta = with stdenv.lib; { 27 + description = "A no bullshit screen capture tool"; 28 + homepage = "https://github.com/buhman/capture"; 29 + maintainers = [ maintainers.ar1a ]; 30 + }; 31 + }
+10
pkgs/tools/misc/pb_cli/0001-eval-fix.patch
···
··· 1 + diff --git a/src/pb.sh b/src/pb.sh 2 + index be1e472..eb9e6f9 100755 3 + --- a/src/pb.sh 4 + +++ b/src/pb.sh 5 + @@ -61,4 +61,4 @@ pb () { 6 + esac 7 + } 8 + 9 + -eval " ${0##*/}" "$@" 10 + +pb "$@"
+40
pkgs/tools/misc/pb_cli/default.nix
···
··· 1 + { screenshots ? true, video ? false, clipboard ? true 2 + , stdenv, pkgs, jq, curl, fetchFromGitHub, makeWrapper, maim ? null, xclip ? null, capture ? null }: 3 + 4 + assert screenshots -> maim != null; 5 + assert video -> capture != null; 6 + assert clipboard -> xclip != null; 7 + 8 + stdenv.mkDerivation rec { 9 + name = "pb_cli-${version}"; 10 + version = "1.0"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "ptpb"; 14 + repo = "pb_cli"; 15 + rev = "5242382b3d6b5c0ddaf6e4843a69746b40866e57"; 16 + sha256 = "0543x3377apinhxnsfq82zlp5sm8g1bf6hmsvvcwra5rsshv2ybk"; 17 + }; 18 + 19 + patches = [ ./0001-eval-fix.patch ]; 20 + 21 + buildInputs = [ makeWrapper ]; 22 + 23 + liveDeps = [ jq curl ] ++ stdenv.lib.optional screenshots maim 24 + ++ stdenv.lib.optional video capture 25 + ++ stdenv.lib.optional clipboard xclip; 26 + 27 + installPhase = '' 28 + install -Dm755 src/pb.sh $out/bin/pb 29 + 30 + patchShebangs $out/bin/pb 31 + wrapProgram $out/bin/pb \ 32 + --prefix PATH : '${stdenv.lib.makeBinPath liveDeps}' 33 + ''; 34 + 35 + meta = with stdenv.lib; { 36 + description = "A no bullshit ptpb client"; 37 + homepage = "https://github.com/ptpb/pb_cli"; 38 + maintainers = [ maintainers.ar1a ]; 39 + }; 40 + }
+4
pkgs/top-level/all-packages.nix
··· 18724 18725 packet = callPackage ../development/tools/packet { }; 18726 18727 pbrt = callPackage ../applications/graphics/pbrt { }; 18728 18729 pcsxr = callPackage ../misc/emulators/pcsxr {
··· 18724 18725 packet = callPackage ../development/tools/packet { }; 18726 18727 + pb_cli = callPackage ../tools/misc/pb_cli {}; 18728 + 18729 + capture = callPackage ../tools/misc/capture {}; 18730 + 18731 pbrt = callPackage ../applications/graphics/pbrt { }; 18732 18733 pcsxr = callPackage ../misc/emulators/pcsxr {