depot/pkgs/tools/networking/bore/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

51 lines
1.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, stdenv, rustPlatform, fetchFromBitbucket, Libsystem, SystemConfiguration, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "bore";
version = "0.4.1";
src = fetchFromBitbucket {
owner = "delan";
repo = "nonymous";
rev = "${pname}-${version}";
sha256 = "1fdnnx7d18gj4rkv1dc6q379dqabl66zks9i0rjarjwcci8m30d9";
};
cargoHash = "sha256-vUKv98lfsrxBiJxjL8ZKLZ1IVCX5hHzl+F5y4Ot3i/Y=";
cargoBuildFlags = [ "-p" pname ];
# error[E0793]: reference to packed field is unaligned
doCheck = !stdenv.hostPlatform.isDarwin;
# FIXME cant test --all-targets and --doc in a single invocation
cargoTestFlags = [ "--all-targets" "--workspace" ];
checkFeatures = [ "std" ];
nativeBuildInputs = [ installShellFiles ]
++ lib.optional stdenv.hostPlatform.isDarwin rustPlatform.bindgenHook;
buildInputs = lib.optionals stdenv.hostPlatform.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 = [ ];
mainProgram = "bore";
broken = stdenv.hostPlatform.isDarwin; # bindgen fails on: "in6_addr_union_(...)" is not a valid Ident
};
}