2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig, openssl, rustPlatform, Security, makeWrapper, bash }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "websocat";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "1.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vi";
|
|
|
|
repo = "websocat";
|
|
|
|
rev = "v${version}";
|
2020-07-18 16:06:22 +00:00
|
|
|
sha256 = "0iilq96bxcb2fsljvlgy47pg514w0jf72ckz39yy3k0gwc1yfcja";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--features=ssl" ];
|
2020-07-18 16:06:22 +00:00
|
|
|
cargoSha256 = "1hsms8rlnds8npr8m0dm21h04ci5ljda09pqb598v7ny3j2dldiq";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
|
|
|
buildInputs = [ openssl ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
|
|
|
|
|
|
|
# The wrapping is required so that the "sh-c" option of websocat works even
|
|
|
|
# if sh is not in the PATH (as can happen, for instance, when websocat is
|
|
|
|
# started as a systemd service).
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/websocat \
|
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath [ bash ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Command-line client for WebSockets (like netcat/socat)";
|
|
|
|
homepage = "https://github.com/vi/websocat";
|
|
|
|
license = licenses.mit;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|