3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc/websocat/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

35 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, pkgconfig, openssl, rustPlatform, Security, makeWrapper, bash }:
rustPlatform.buildRustPackage rec {
pname = "websocat";
version = "1.6.0";
src = fetchFromGitHub {
owner = "vi";
repo = "websocat";
rev = "v${version}";
sha256 = "0iilq96bxcb2fsljvlgy47pg514w0jf72ckz39yy3k0gwc1yfcja";
};
cargoBuildFlags = [ "--features=ssl" ];
cargoSha256 = "1hsms8rlnds8npr8m0dm21h04ci5ljda09pqb598v7ny3j2dldiq";
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 lib; {
description = "Command-line client for WebSockets (like netcat/socat)";
homepage = "https://github.com/vi/websocat";
license = licenses.mit;
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
};
}