nixpkgs/pkgs/tools/networking/bore/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

2021-07-06 21:05:37 +01:00
{ lib, stdenv, rustPlatform, fetchFromBitbucket, llvmPackages, Libsystem, SystemConfiguration, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "bore";
2021-11-29 04:30:49 +00:00
version = "0.4.1";
2021-07-06 21:05:37 +01:00
src = fetchFromBitbucket {
owner = "delan";
repo = "nonymous";
2021-11-29 04:30:49 +00:00
rev = "${pname}-${version}";
sha256 = "1fdnnx7d18gj4rkv1dc6q379dqabl66zks9i0rjarjwcci8m30d9";
2021-07-06 21:05:37 +01:00
};
2021-11-29 04:30:49 +00:00
cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx";
2021-07-06 21:05:37 +01:00
cargoBuildFlags = "-p ${pname}";
# FIXME cant test --all-targets and --doc in a single invocation
2021-11-16 00:50:50 +00:00
cargoTestFlags = [ "--all-targets" "--workspace" ];
2021-11-29 04:30:49 +00:00
checkFeatures = [ "std" ];
2021-07-06 21:05:37 +01:00
nativeBuildInputs = [ installShellFiles ]
++ lib.optional stdenv.isDarwin llvmPackages.libclang;
buildInputs = lib.optionals stdenv.isDarwin [
Libsystem
SystemConfiguration
];
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
postInstall = ''
installManPage $src/bore/doc/bore.1
'';
doInstallCheck = true;
installCheckPhase = ''
printf '\0\0\0\0\0\0\0\0\0\0\0\0' \
| $out/bin/bore --decode \
| grep -q ';; NoError #0 Query 0 0 0 0 flags'
'';
meta = with lib; {
description = "DNS query tool";
homepage = "https://crates.io/crates/bore";
license = licenses.isc;
maintainers = [ maintainers.delan ];
};
}