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
|
|
|
|
};
|
|
|
|
|
|
2024-07-03 12:29:10 +00:00
|
|
|
|
cargoHash = "sha256-vUKv98lfsrxBiJxjL8ZKLZ1IVCX5hHzl+F5y4Ot3i/Y=";
|
2022-10-03 13:56:51 +00:00
|
|
|
|
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.hostPlatform.isDarwin;
|
|
|
|
|
|
2021-07-06 20:05:37 +00:00
|
|
|
|
# FIXME can’t 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.hostPlatform.isDarwin rustPlatform.bindgenHook;
|
2021-07-06 20:05:37 +00:00
|
|
|
|
|
|
|
|
|
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;
|
2024-07-03 11:54:30 +00:00
|
|
|
|
maintainers = [ ];
|
2024-02-11 02:19:15 +00:00
|
|
|
|
mainProgram = "bore";
|
2024-06-15 22:24:25 +00:00
|
|
|
|
broken = stdenv.hostPlatform.isDarwin; # bindgen fails on: "in6_addr_union_(...)" is not a valid Ident
|
2021-07-06 20:05:37 +00:00
|
|
|
|
};
|
|
|
|
|
}
|