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 22:05:37 +02:00
{ lib, stdenv, rustPlatform, fetchFromBitbucket, llvmPackages, Libsystem, SystemConfiguration, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "bore";
2021-11-29 05:30:49 +01:00
version = "0.4.1";
2021-07-06 22:05:37 +02:00
src = fetchFromBitbucket {
owner = "delan";
repo = "nonymous";
2021-11-29 05:30:49 +01:00
rev = "${pname}-${version}";
sha256 = "1fdnnx7d18gj4rkv1dc6q379dqabl66zks9i0rjarjwcci8m30d9";
2021-07-06 22:05:37 +02:00
};
2021-11-29 05:30:49 +01:00
cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx";
2021-07-06 22:05:37 +02:00
cargoBuildFlags = "-p ${pname}";
# FIXME cant test --all-targets and --doc in a single invocation
2021-11-16 01:50:50 +01:00
cargoTestFlags = [ "--all-targets" "--workspace" ];
2021-11-29 05:30:49 +01:00
checkFeatures = [ "std" ];
2021-07-06 22:05:37 +02: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 ];
};
}