1 { lib, stdenv, fetchFromGitHub, pkg-config, openssl, rustPlatform, libiconv
2 , Security, makeWrapper, bash }:
4 rustPlatform.buildRustPackage rec {
8 src = fetchFromGitHub {
12 sha256 = "sha256-v5+9cbKe3c12/SrW7mgN6tvQIiAuweqvMIl46Ce9f2A=";
15 cargoHash = "sha256-2THUFcaM4niB7YiQiRXJQuaQu02fpgZKPWrejfhmRQ0=";
17 nativeBuildInputs = [ pkg-config makeWrapper ];
18 buildInputs = [ openssl ]
19 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv Security ];
21 buildFeatures = [ "ssl" ];
23 # Needed to get openssl-sys to use pkg-config.
26 # The wrapping is required so that the "sh-c" option of websocat works even
27 # if sh is not in the PATH (as can happen, for instance, when websocat is
28 # started as a systemd service).
30 wrapProgram $out/bin/websocat \
31 --prefix PATH : ${lib.makeBinPath [ bash ]}
35 homepage = "https://github.com/vi/websocat";
36 description = "Command-line client for WebSockets (like netcat/socat)";
37 changelog = "https://github.com/vi/websocat/releases/tag/v${version}";
38 license = licenses.mit;
39 maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
40 mainProgram = "websocat";