From c6306a04c3830fcdc4c3bacd40bf81cd462ff711 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Wed, 3 Jan 2024 17:15:13 +0000 Subject: [PATCH] Introduce bazel_ot package This is bazelisk with auto completion stolen from bazel package. --- pkgs/bazel_ot/default.nix | 20 ++++++++++++++++++++ pkgs/default.nix | 1 + 2 files changed, 21 insertions(+) create mode 100644 pkgs/bazel_ot/default.nix diff --git a/pkgs/bazel_ot/default.nix b/pkgs/bazel_ot/default.nix new file mode 100644 index 0000000..f7ea11b --- /dev/null +++ b/pkgs/bazel_ot/default.nix @@ -0,0 +1,20 @@ +{ + runCommand, + bazelisk, + bazel_6, + ... +}: +# OpenTitan requires a specific version of Bazel. +# We *could* package our own Bazel, but it can't be a simple override since Bazel build process +# require a lot of Internet dependencies. +# +# For simplicity we'll just let bazelisk do the heavyloading. +# +# This package basically just creates an alias from bazel to bazelisk and adds the auto completion +# which is absent in bazelisk. +runCommand "bazel" {} '' + cp -r ${bazelisk} $out + chmod -R +w $out + ln -s $out/bin/bazelisk $out/bin/bazel + cp -r ${bazel_6}/share $out/share +'' diff --git a/pkgs/default.nix b/pkgs/default.nix index 7db6812..258792b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,6 +9,7 @@ { verilator_ot = import ./verilator {inherit pkgs;}; python_ot = pkgs.callPackage ./python_ot {inherit inputs;}; + bazel_ot = pkgs.callPackage ./bazel_ot {}; } // pkgs.lib.optionalAttrs (pkgs.system == "x86_64-linux") { lowrisc-toolchain-gcc-rv32imcb = pkgs.callPackage ./lowrisc-toolchain-gcc-rv32imcb.nix {};