3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/websocat/default.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

2021-05-18 18:04:13 +01:00
{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, rustPlatform, libiconv
, Security, makeWrapper, bash }:
rustPlatform.buildRustPackage rec {
2019-08-31 12:41:23 +01:00
pname = "websocat";
2021-12-06 03:13:40 +00:00
version = "1.9.0";
src = fetchFromGitHub {
2019-12-05 16:40:54 +00:00
owner = "vi";
2021-04-20 20:25:40 +01:00
repo = pname;
2019-12-05 16:40:54 +00:00
rev = "v${version}";
2021-12-06 03:13:40 +00:00
sha256 = "sha256-aQWLsdYHmju7tCJfg3a1aOlFYui7qsQ8vJfhyMawXWo=";
};
2021-12-06 03:13:40 +00:00
cargoSha256 = "sha256-b/B+K/LMP1XK1QEtFKY4nmy2fAqEmLTN+qL+XlrqA5w=";
2021-01-17 03:51:22 +00:00
nativeBuildInputs = [ pkg-config makeWrapper ];
2021-05-18 18:04:13 +01:00
buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin [ libiconv Security ];
2019-03-19 08:21:18 +00:00
2021-11-16 00:12:55 +00:00
buildFeatures = [ "ssl" ];
2021-04-20 20:25:40 +01:00
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR=1;
2020-04-24 03:37:49 +01: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 09:19:50 +00:00
--prefix PATH : ${lib.makeBinPath [ bash ]}
2020-04-24 03:37:49 +01:00
'';
meta = with lib; {
2019-12-05 16:40:54 +00:00
homepage = "https://github.com/vi/websocat";
2021-04-20 20:25:40 +01:00
description = "Command-line client for WebSockets (like netcat/socat)";
changelog = "https://github.com/vi/websocat/releases/tag/v${version}";
2019-12-05 16:40:54 +00:00
license = licenses.mit;
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
};
}