2021-01-16 19:51:22 -08:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, rustPlatform, Security, makeWrapper, bash }:
|
2019-03-09 19:43:27 -08:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 04:41:23 -07:00
|
|
|
pname = "websocat";
|
2020-07-12 08:04:27 -07:00
|
|
|
version = "1.6.0";
|
2019-03-09 19:43:27 -08:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-12-05 08:40:54 -08:00
|
|
|
owner = "vi";
|
|
|
|
repo = "websocat";
|
|
|
|
rev = "v${version}";
|
2020-07-12 08:04:27 -07:00
|
|
|
sha256 = "0iilq96bxcb2fsljvlgy47pg514w0jf72ckz39yy3k0gwc1yfcja";
|
2019-03-09 19:43:27 -08:00
|
|
|
};
|
|
|
|
|
2019-06-04 01:28:04 -07:00
|
|
|
cargoBuildFlags = [ "--features=ssl" ];
|
2020-07-12 08:04:27 -07:00
|
|
|
cargoSha256 = "1hsms8rlnds8npr8m0dm21h04ci5ljda09pqb598v7ny3j2dldiq";
|
2019-03-09 19:43:27 -08:00
|
|
|
|
2021-01-16 19:51:22 -08:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2021-01-15 01:19:50 -08:00
|
|
|
buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
|
2019-03-19 01:21:18 -07:00
|
|
|
|
2020-04-23 19:37:49 -07:00
|
|
|
# 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 \
|
2021-01-15 01:19:50 -08:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bash ]}
|
2020-04-23 19:37:49 -07:00
|
|
|
'';
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2019-03-09 19:43:27 -08:00
|
|
|
description = "Command-line client for WebSockets (like netcat/socat)";
|
2019-12-05 08:40:54 -08:00
|
|
|
homepage = "https://github.com/vi/websocat";
|
|
|
|
license = licenses.mit;
|
2020-11-17 03:02:06 -08:00
|
|
|
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
|
2019-03-09 19:43:27 -08:00
|
|
|
};
|
|
|
|
}
|