2021-03-21 04:35:48 +01:00
|
|
|
{ stdenv, lib, openssl, pkg-config, rustPlatform, fetchFromGitHub, Security
|
|
|
|
, libiconv }:
|
2021-02-13 00:43:13 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "xh";
|
2021-03-26 14:25:32 +01:00
|
|
|
version = "0.9.2";
|
2021-02-13 00:43:13 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ducaale";
|
|
|
|
repo = "xh";
|
|
|
|
rev = "v${version}";
|
2021-03-26 14:25:32 +01:00
|
|
|
sha256 = "cOlya3ngIoaoqzh0fIbNAjwO7S7wZCQk7WVqgZona8A=";
|
2021-02-13 00:43:13 +01:00
|
|
|
};
|
|
|
|
|
2021-03-26 14:25:32 +01:00
|
|
|
cargoSha256 = "5B2fY+S9z6o+CHCIK93+Yj8dpaiQi4PSMQw1mfXg1NA=";
|
2021-02-13 00:43:13 +01:00
|
|
|
|
2021-03-21 04:35:48 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = if stdenv.isDarwin then [ Security libiconv ] else [ openssl ];
|
|
|
|
|
|
|
|
# Get openssl-sys to use pkg-config
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
2021-02-13 00:43:13 +01:00
|
|
|
|
|
|
|
checkFlagsArray = [ "--skip=basic_options" ];
|
|
|
|
|
2021-03-21 04:35:48 +01:00
|
|
|
# Nix build happens in sandbox without internet connectivity
|
|
|
|
# disable tests as some of them require internet due to nature of application
|
|
|
|
doCheck = false;
|
2021-02-13 00:43:13 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
postInstallCheck = ''
|
|
|
|
$out/bin/xh --help > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Yet another HTTPie clone in Rust";
|
|
|
|
homepage = "https://github.com/ducaale/xh";
|
2021-02-15 10:45:36 +01:00
|
|
|
changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md";
|
2021-02-13 00:43:13 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ payas SuperSandro2000 ];
|
|
|
|
};
|
|
|
|
}
|