about summary refs log tree commit diff
path: root/pkgs/by-name/ba
diff options
context:
space:
mode:
authorLeonardo Romor <leonardo.romor@gmail.com>2024-06-25 22:30:35 +0200
committerLeonardo Romor <leonardo.romor@gmail.com>2024-07-01 18:46:08 +0200
commitda15a92f1f75d2c12d159ab63039021218a38a05 (patch)
tree11317e88186957e7d1701a7ced67423997cf118f /pkgs/by-name/ba
parent173e559fde13faadaf7be5d85ad8d31b3721d743 (diff)
bant: init at 0.1.5
Diffstat (limited to 'pkgs/by-name/ba')
-rw-r--r--pkgs/by-name/ba/bant/package.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/by-name/ba/bant/package.nix b/pkgs/by-name/ba/bant/package.nix
new file mode 100644
index 0000000000000..669e4ae1719bb
--- /dev/null
+++ b/pkgs/by-name/ba/bant/package.nix
@@ -0,0 +1,66 @@
+{
+  lib,
+  stdenv,
+  buildBazelPackage,
+  fetchFromGitHub,
+  bazel_6,
+  jdk,
+  git,
+}:
+
+let
+  system = stdenv.hostPlatform.system;
+  registry = fetchFromGitHub {
+    owner = "bazelbuild";
+    repo = "bazel-central-registry";
+    rev = "1c729c2775715fd98f0f948a512eb173213250da";
+    hash = "sha256-1iaDDM8/v8KCOUjPgLUtZVta7rMzwlIK//cCoLUrb/s=";
+  };
+in buildBazelPackage rec {
+  pname = "bant";
+  version = "0.1.5";
+
+  src = fetchFromGitHub {
+    owner = "hzeller";
+    repo = "bant";
+    rev = "v${version}";
+    hash = "sha256-3xGAznR/IHQHY1ISqmU8NxI90Pl57cdYeRDeLVh9L08=";
+  };
+
+  bazelFlags = ["--registry" "file://${registry}"];
+
+  postPatch = ''
+    patchShebangs scripts/create-workspace-status.sh
+  '';
+
+  fetchAttrs = {
+    sha256 = {
+      aarch64-linux = "sha256-jtItWNfl+ebQqU8VWmvLsgNYNARGxN8+CTBz2nZcBEY=";
+      x86_64-linux = "sha256-ACJqybpHoMSg2ApGWkIyhdAQjIhb8gxUdo8SuWJvTNE=";
+    }.${system} or (throw "No hash for system: ${system}");
+  };
+
+  nativeBuildInputs = [
+    jdk
+    git
+  ];
+  bazel = bazel_6;
+
+  bazelBuildFlags = [ "-c opt" ];
+  bazelTestTargets = [ "//..." ];
+  bazelTargets = [ "//bant:bant" ];
+
+  buildAttrs = {
+    installPhase = ''
+      install -D --strip bazel-bin/bant/bant "$out/bin/bant"
+    '';
+  };
+
+  meta = with lib; {
+    description = "Bazel/Build Analysis and Navigation Tool";
+    homepage = "http://bant.build/";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ hzeller lromor ];
+    platforms = platforms.linux;
+  };
+}