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

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

52 lines
1.4 KiB
Nix
Raw Normal View History

2023-05-27 23:40:50 +00:00
{ lib, stdenv, rustPlatform, fetchFromBitbucket, Libsystem, SystemConfiguration, installShellFiles }:
2021-07-06 20:05:37 +00:00
rustPlatform.buildRustPackage rec {
pname = "bore";
2021-11-29 04:30:49 +00:00
version = "0.4.1";
2021-07-06 20:05:37 +00:00
src = fetchFromBitbucket {
owner = "delan";
repo = "nonymous";
2021-11-29 04:30:49 +00:00
rev = "${pname}-${version}";
sha256 = "1fdnnx7d18gj4rkv1dc6q379dqabl66zks9i0rjarjwcci8m30d9";
2021-07-06 20:05:37 +00:00
};
2021-11-29 04:30:49 +00:00
cargoSha256 = "1xlbfzmy0wjyz3jpr17r4ma4i79d9b32yqwwi10vrcjzr7vsyhmx";
cargoBuildFlags = [ "-p" pname ];
2021-07-06 20:05:37 +00:00
2023-05-27 23:40:50 +00:00
# error[E0793]: reference to packed field is unaligned
doCheck = !stdenv.isDarwin;
2021-07-06 20:05:37 +00:00
# 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 20:05:37 +00:00
nativeBuildInputs = [ installShellFiles ]
2023-05-27 23:40:50 +00:00
++ lib.optional stdenv.isDarwin rustPlatform.bindgenHook;
2021-07-06 20:05:37 +00:00
buildInputs = lib.optionals stdenv.isDarwin [
Libsystem
SystemConfiguration
];
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 ];
2024-02-11 02:19:15 +00:00
mainProgram = "bore";
broken = stdenv.isDarwin; # bindgen fails on: "in6_addr_union_(...)" is not a valid Ident
2021-07-06 20:05:37 +00:00
};
}