summary refs log tree commit diff
path: root/pkgs/tools/networking/bore
diff options
context:
space:
mode:
authorDelan Azabani <delan@azabani.com>2021-07-07 04:05:37 +0800
committerGitHub <noreply@github.com>2021-07-06 22:05:37 +0200
commit8eb54b8e0907ce37ba0eeeacfb67676d42d857bc (patch)
treead5952f52181f9962dfd6b546c9ce31e38e02da7 /pkgs/tools/networking/bore
parent00c86ad14639887ec495b92ada9cd93a75317686 (diff)
downloadnixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar.gz
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar.bz2
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar.lz
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar.xz
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.tar.zst
nixpkgs-8eb54b8e0907ce37ba0eeeacfb67676d42d857bc.zip
bore: init at 0.3.3 (#129295)
Diffstat (limited to 'pkgs/tools/networking/bore')
-rw-r--r--pkgs/tools/networking/bore/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/tools/networking/bore/default.nix b/pkgs/tools/networking/bore/default.nix
new file mode 100644
index 00000000000..b22cdb0c2ae
--- /dev/null
+++ b/pkgs/tools/networking/bore/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, rustPlatform, fetchFromBitbucket, llvmPackages, Libsystem, SystemConfiguration, installShellFiles }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "bore";
+  version = "0.3.3";
+
+  src = fetchFromBitbucket {
+    owner = "delan";
+    repo = "nonymous";
+    rev = version;
+    sha256 = "0gws1f625izrb3armh6bay1k8l9p9csl37jx03yss1r720k4vn2x";
+  };
+
+  cargoSha256 = "1n09gcp1y885lz6g2f73zw3fd0fmv7nwlvaqba2yl0kylzk7naa6";
+  cargoBuildFlags = "-p ${pname}";
+
+  # FIXME can’t test --all-targets and --doc in a single invocation
+  cargoTestFlags = "--features std --all-targets --workspace";
+
+  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 ];
+  };
+}