1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromBitbucket,
6 installShellFiles,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "bore";
11 version = "0.4.1";
12
13 src = fetchFromBitbucket {
14 owner = "delan";
15 repo = "nonymous";
16 rev = "${pname}-${version}";
17 sha256 = "1fdnnx7d18gj4rkv1dc6q379dqabl66zks9i0rjarjwcci8m30d9";
18 };
19
20 cargoHash = "sha256-6uIqvX50XoWCPQ8u38rUdi4LwtMTBcNuefNmzGY+vLU=";
21 cargoBuildFlags = [
22 "-p"
23 pname
24 ];
25
26 # error[E0793]: reference to packed field is unaligned
27 doCheck = !stdenv.hostPlatform.isDarwin;
28
29 # FIXME can’t test --all-targets and --doc in a single invocation
30 cargoTestFlags = [
31 "--all-targets"
32 "--workspace"
33 ];
34 checkFeatures = [ "std" ];
35
36 nativeBuildInputs = [
37 installShellFiles
38 ]
39 ++ lib.optional stdenv.hostPlatform.isDarwin rustPlatform.bindgenHook;
40
41 postInstall = ''
42 installManPage $src/bore/doc/bore.1
43 '';
44
45 doInstallCheck = true;
46 installCheckPhase = ''
47 printf '\0\0\0\0\0\0\0\0\0\0\0\0' \
48 | $out/bin/bore --decode \
49 | grep -q ';; NoError #0 Query 0 0 0 0 flags'
50 '';
51
52 meta = with lib; {
53 description = "DNS query tool";
54 homepage = "https://crates.io/crates/bore";
55 license = licenses.isc;
56 maintainers = [ ];
57 mainProgram = "bore";
58 broken = stdenv.hostPlatform.isDarwin; # bindgen fails on: "in6_addr_union_(...)" is not a valid Ident
59 };
60}