From 1f57d5e060e097f014b8c700771d395af87990d0 Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Fri, 24 Apr 2020 04:37:49 +0200 Subject: websocat: fix wrapping --- pkgs/tools/misc/websocat/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/websocat/default.nix b/pkgs/tools/misc/websocat/default.nix index 14617f207dbe..7870974531ee 100644 --- a/pkgs/tools/misc/websocat/default.nix +++ b/pkgs/tools/misc/websocat/default.nix @@ -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"; -- cgit 1.4.1