nixpkgs/pkgs/tools/networking/xh/default.nix
Daniël de Kok 85f96822a0 treewide: fix cargoSha256/cargoHash
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in
which cargo vendor erroneously changed permissions of vendored
crates. This was fixed in Rust
1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all
cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are
potentially broken.

This change updates cargoSha256/cargoHash tree-wide.

Fixes #121994.
2021-05-08 00:36:37 -07:00

42 lines
1.2 KiB
Nix

{ stdenv, lib, openssl, pkg-config, rustPlatform, fetchFromGitHub, Security
, libiconv }:
rustPlatform.buildRustPackage rec {
pname = "xh";
version = "0.9.2";
src = fetchFromGitHub {
owner = "ducaale";
repo = "xh";
rev = "v${version}";
sha256 = "cOlya3ngIoaoqzh0fIbNAjwO7S7wZCQk7WVqgZona8A=";
};
cargoSha256 = "sha256-jjC7G4JsLyj5LC29DBI996E+Ha/tVrcv7A95MmB7A08=";
nativeBuildInputs = [ pkg-config ];
buildInputs = if stdenv.isDarwin then [ Security libiconv ] else [ openssl ];
# Get openssl-sys to use pkg-config
OPENSSL_NO_VENDOR = 1;
checkFlagsArray = [ "--skip=basic_options" ];
# Nix build happens in sandbox without internet connectivity
# disable tests as some of them require internet due to nature of application
doCheck = false;
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";
changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ payas SuperSandro2000 ];
};
}