Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cheriot-audit package #44

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions pkgs/cheriot-audit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright lowRISC contributors.
#
# SPDX-License-Identifier: MIT
{
pkgs,
stdenv,
fetchFromGitHub,
lib,
cmake,
ninja,
git,
}: let
# Source dependencies of cheriot-audit
regocpp = fetchFromGitHub {
owner = "microsoft";
repo = "rego-cpp";
rev = "cb967637dbf7cee25117203bbdf9c10b62dfb25a";
hash = "sha256-0JLnk+qr991aKWjzTrG4JE0L5e2NrcOstT8+ggjzKr0=";
};
nlohmann_json = builtins.fetchTarball {
url = "https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz";
sha256 = "078fymbb5jzhg69bvwp1fr79rmcyy1nz7cjnwkisgkjpb24rywbj";
};

# Source dependencies of rego-cpp
trieste = fetchFromGitHub {
owner = "microsoft";
repo = "trieste";
rev = "58a6eeeaeda4f5c96dad30c23b2d4e3feae7a60c";
hash = "sha256-uCyJiNRG6R/tyhewQR4hTrO+CnEVpZmFubZMMH6mAwg=";
};

# Source dependencies of trieste
snmalloc = fetchFromGitHub {
owner = "microsoft";
repo = "snmalloc";
rev = "846a926155976b07a16425352dd5fed0858c5c97";
hash = "sha256-Dc8CKaYPPAYfY83Nsv+KqDJoihK8zXrRacVLugWzJY4=";
};
re2 = fetchFromGitHub {
owner = "google";
repo = "re2";
rev = "2022-12-01";
hash = "sha256-RmPXfavSKVnnl/RJ5aTjc/GbkPz+EXiFg1n5e4s6wjw=";
};
cli11 = fetchFromGitHub {
owner = "CLIUtils";
repo = "CLI11";
rev = "b9be5b9444772324459989177108a6a65b8b2769";
hash = "sha256-emTIaoUyTINbAAn9tw1r3zLTQt58N8A1zoP+0y41yKo=";
};
in
stdenv.mkDerivation rec {
pname = "cheriot-audit";
version = "0.0.0";

src = fetchFromGitHub {
owner = "CHERIoT-Platform";
repo = "cheriot-audit";
rev = "6120dea317a18d0ef6bf7e63a75636b0ed91ede9";
hash = "sha256-wk/kPvsixd0jw82GsOsg/Z/iDrcKNoMnPaCubJsUbRE=";
};

nativeBuildInputs = [cmake git];
cmakeFlags = [
"-DFETCHCONTENT_SOURCE_DIR_REGOCPP=${regocpp}"
"-DFETCHCONTENT_SOURCE_DIR_NLOHMANN_JSON=${nlohmann_json}"
"-DFETCHCONTENT_SOURCE_DIR_TRIESTE=${trieste}"
"-DFETCHCONTENT_SOURCE_DIR_SNMALLOC=${snmalloc}"
"-DFETCHCONTENT_SOURCE_DIR_RE2=${re2}"
"-DFETCHCONTENT_SOURCE_DIR_CLI11=${cli11}"
];

installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp cheriot-audit $out/bin
runHook postInstall
'';

meta = {
description = "Auditing tooling for CHEIRoT firmware images.";
homepage = "https://github.com/CHERIoT-Platform/cheriot-audit";
license = lib.licenses.mit;
mainProgram = "cheriot-audit";
};
}
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
llvm_cheriot = pkgs.callPackage ./llvm_cheriot.nix {};
xmake = pkgs.callPackage ./xmake {};
cheriot-sim = pkgs.callPackage ./cheriot-sim.nix {};
cheriot-audit = pkgs.callPackage ./cheriot-audit.nix {};

container-hotplug = pkgs.callPackage ./container-hotplug {};
surfer = pkgs.callPackage ./surfer/default.nix {};
Expand Down