websocat: add versionCheckHook (#361419)

This commit is contained in:
Fabian Affolter
2024-12-03 23:37:50 +01:00
committed by GitHub
2 changed files with 37 additions and 15 deletions
@@ -1,5 +1,16 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, rustPlatform, libiconv
, Security, makeWrapper, bash }:
{
lib,
stdenv,
bash,
darwin,
fetchFromGitHub,
libiconv,
makeWrapper,
openssl,
pkg-config,
rustPlatform,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
pname = "websocat";
@@ -7,21 +18,31 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "vi";
repo = pname;
rev = "v${version}";
sha256 = "sha256-v5+9cbKe3c12/SrW7mgN6tvQIiAuweqvMIl46Ce9f2A=";
repo = "websocat";
rev = "refs/tags/v${version}";
hash = "sha256-v5+9cbKe3c12/SrW7mgN6tvQIiAuweqvMIl46Ce9f2A=";
};
cargoHash = "sha256-2THUFcaM4niB7YiQiRXJQuaQu02fpgZKPWrejfhmRQ0=";
nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = [ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv Security ];
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
darwin.apple_sdk.frameworks.Security
];
nativeInstallCheckInputs = [ versionCheckHook ];
buildFeatures = [ "ssl" ];
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR=1;
OPENSSL_NO_VENDOR = 1;
# 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
@@ -31,12 +52,17 @@ rustPlatform.buildRustPackage rec {
--prefix PATH : ${lib.makeBinPath [ bash ]}
'';
doInstallCheck = true;
meta = with lib; {
homepage = "https://github.com/vi/websocat";
description = "Command-line client for WebSockets (like netcat/socat)";
homepage = "https://github.com/vi/websocat";
changelog = "https://github.com/vi/websocat/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ thoughtpolice Br1ght0ne ];
maintainers = with maintainers; [
thoughtpolice
Br1ght0ne
];
mainProgram = "websocat";
};
}
-4
View File
@@ -18125,10 +18125,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
websocat = callPackage ../tools/misc/websocat {
inherit (darwin.apple_sdk.frameworks) Security;
};
vector = callPackage ../tools/misc/vector {
inherit (darwin.apple_sdk.frameworks) Security CoreServices SystemConfiguration;
};