Merge pull request #322492 from lromor/feature-20240525-bant-init

bant: init at 0.1.5
This commit is contained in:
Weijia Wang 2024-07-04 00:18:46 +02:00 committed by GitHub
commit 656dc1045d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
};
}