2021-05-04 21:07:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, lz4
|
|
|
|
, ffmpeg-full
|
|
|
|
, fetchFromGitHub
|
|
|
|
, openssh
|
2021-12-06 16:07:01 +00:00
|
|
|
, netcat
|
2021-05-04 21:07:42 +00:00
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "restream";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.3.1";
|
2021-05-04 21:07:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rien";
|
|
|
|
repo = pname;
|
2024-02-07 01:22:34 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-AXHKOfdIM3LsHF6u3M/lMhhcuPZADoEal7de3zlx7L4=";
|
2021-05-04 21:07:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D ${src}/restream.arm.static $out/libexec/restream.arm.static
|
|
|
|
install -D ${src}/reStream.sh $out/bin/restream
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = let
|
|
|
|
deps = [
|
|
|
|
# `ffmpeg-full` is used here to bring in `ffplay`, which is used
|
|
|
|
# to display the reMarkable framebuffer
|
|
|
|
ffmpeg-full
|
|
|
|
lz4
|
|
|
|
openssh
|
|
|
|
# Libressl netcat brings in `nc` which used for --uncompressed mode.
|
|
|
|
netcat
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
# This `sed` command has the same effect as `wrapProgram`, except
|
|
|
|
# without .restream-wrapped store paths appearing everywhere.
|
|
|
|
sed -i \
|
|
|
|
'2i export PATH=$PATH''${PATH:+':'}${lib.makeBinPath deps}' \
|
|
|
|
"$out/bin/restream"
|
2021-05-04 21:07:42 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "reMarkable screen sharing over SSH";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "restream";
|
2021-05-04 21:07:42 +00:00
|
|
|
homepage = "https://github.com/rien/reStream";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.cpcloud ];
|
|
|
|
};
|
|
|
|
}
|