2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, rustPlatform, libiconv
|
|
|
|
, Security, makeWrapper, bash }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "websocat";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.13.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vi";
|
2021-04-22 02:08:21 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-tQvI3wlNDa+S3KK4z0NFGuB/QLXlSsyipvzO0xIrBIo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cargoHash = "sha256-hkfFhx0y2v122ozeWMm+tu+EHSxzu/bSbCpXKIm57rQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildFeatures = [ "ssl" ];
|
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR=1;
|
|
|
|
|
2020-04-24 23:36:52 +00: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 22:18:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bash ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/vi/websocat";
|
2021-04-22 02:08:21 +00:00
|
|
|
description = "Command-line client for WebSockets (like netcat/socat)";
|
|
|
|
changelog = "https://github.com/vi/websocat/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "websocat";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|