python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / networking / xh / default.nix
blobf806b46b6944f58cdb4397301c4bf0b219495c0d
1 { stdenv
2 , lib
3 , pkg-config
4 , rustPlatform
5 , fetchFromGitHub
6 , installShellFiles
7 , withNativeTls ? true
8 , Security
9 , libiconv
10 , openssl }:
12 rustPlatform.buildRustPackage rec {
13   pname = "xh";
14   version = "0.17.0";
16   src = fetchFromGitHub {
17     owner = "ducaale";
18     repo = "xh";
19     rev = "v${version}";
20     sha256 = "sha256-4rFtbCfx6QFdp62FPjOYAhSWM03g3rXsF4pD22+EhcA=";
21   };
23   cargoSha256 = "sha256-av/F1FHMd0o9NvwA2Q9mqSd89ZEqmUaVxC+JmSwEHhI=";
25   buildFeatures = lib.optional withNativeTls "native-tls";
27   nativeBuildInputs = [ installShellFiles pkg-config ];
29   buildInputs = lib.optionals withNativeTls
30     (if stdenv.isDarwin then [ Security libiconv ] else [ openssl ]);
32   # Get openssl-sys to use pkg-config
33   OPENSSL_NO_VENDOR = 1;
35   postInstall = ''
36     installShellCompletion --cmd xh \
37       --bash completions/xh.bash \
38       --fish completions/xh.fish \
39       --zsh completions/_xh
41     installManPage doc/xh.1
42     ln -s $out/share/man/man1/xh.1 $out/share/man/man1/xhs.1
44     install -m444 -Dt $out/share/doc/xh README.md CHANGELOG.md
46     # https://github.com/ducaale/xh#xh-and-xhs
47     ln -s $out/bin/xh $out/bin/xhs
48   '';
50   # Nix build happens in sandbox without internet connectivity
51   # disable tests as some of them require internet due to nature of application
52   doCheck = false;
53   doInstallCheck = true;
54   postInstallCheck = ''
55     $out/bin/xh --help > /dev/null
56     $out/bin/xhs --help > /dev/null
57   '';
59   meta = with lib; {
60     description = "Friendly and fast tool for sending HTTP requests";
61     homepage = "https://github.com/ducaale/xh";
62     changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md";
63     license = licenses.mit;
64     maintainers = with maintainers; [ payas ];
65   };