1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

wtwitch: init at 2.6.0

In addition to wtwitch, we have also setup the manpage, bash and zsh
completion, and set a default LANG value, since this is needed, but not
guaranteed on systems like darwin.

Fixes #184685
This commit is contained in:
Colin Arnott 2022-11-08 05:18:27 +00:00
parent ffca9ffaaa
commit bdca4eb87e
No known key found for this signature in database
GPG key ID: 0447A663F7F3E236
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,73 @@
{ bash
, coreutils-prefixed
, curl
, fetchFromGitHub
, gnused
, gnugrep
, installShellFiles
, jq
, lib
, makeWrapper
, mplayer
, mpv
, ncurses
, procps
, scdoc
, stdenv
, streamlink
, sudo
, vlc
}:
stdenv.mkDerivation rec {
pname = "wtwitch";
version = "2.6.0";
src = fetchFromGitHub {
owner = "krathalan";
repo = pname;
rev = version;
hash = "sha256-KkuXZOquihY3IRVp4FM+AdN3kYi0MqmrXFuNmydTpio=";
};
# hardcode SCRIPT_NAME because #150841
postPatch = ''
substituteInPlace src/wtwitch --replace 'readonly SCRIPT_NAME="''${0##*/}"' 'readonly SCRIPT_NAME="wtwitch"'
'';
buildPhase = ''
scdoc < src/wtwitch.1.scd > wtwitch.1
'';
nativeBuildInputs = [ scdoc installShellFiles makeWrapper ];
installPhase = ''
installManPage wtwitch.1
installShellCompletion --cmd wtwitch \
--bash src/wtwitch-completion.bash \
--zsh src/_wtwitch
install -Dm755 src/wtwitch $out/bin/wtwitch
wrapProgram $out/bin/wtwitch \
--set-default LANG en_US.UTF-8 \
--prefix PATH : ${lib.makeBinPath (lib.optionals stdenv.isLinux [ vlc ] ++ [
bash
coreutils-prefixed
curl
gnused
gnugrep
jq
mplayer
mpv
procps
streamlink
])}
'';
meta = with lib; {
description = "Terminal user interface for Twitch";
homepage = "https://github.com/krathalan/wtwitch";
license = licenses.gpl3Only;
maintainers = with maintainers; [ urandom ];
platforms = platforms.all;
};
}

View file

@ -1499,6 +1499,8 @@ with pkgs;
wine = wineWowPackages.staging;
};
wtwitch = callPackage ../tools/video/wtwitch {};
wwcd = callPackage ../tools/misc/wwcd { };
writedisk = callPackage ../tools/misc/writedisk { };