websocat: fix wrapping

This commit is contained in:
Ingo Blechschmidt 2020-04-24 04:37:49 +02:00 committed by Austin Seipp
parent e170e0e85f
commit 1f57d5e060

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, openssl, rustPlatform, Security }:
{ stdenv, fetchFromGitHub, pkgconfig, openssl, rustPlatform, Security, makeWrapper, bash }:
rustPlatform.buildRustPackage rec {
pname = "websocat";
@ -14,9 +14,17 @@ rustPlatform.buildRustPackage rec {
cargoBuildFlags = [ "--features=ssl" ];
cargoSha256 = "09chj0bgf4r8v5cjq0hvb84zvh98nrzrh1m0wdqjy5gi7zc30cis";
nativeBuildInputs = [ pkgconfig ];
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";