Unverified Commit 8626127d authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

holo-daemon: init at 0.7.0, holo-cli: init at 0.5.0 (#402789)

parents c0f6aade 60c420a6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -24373,6 +24373,12 @@
    github = "thelissimus";
    githubId = 70096720;
  };
  themadbit = {
    name = "Mark Tanui";
    email = "marktanui75@gmail.com";
    github = "themadbit";
    githubId = 84702057;
  };
  themaxmur = {
    name = "Maxim Muravev";
    email = "muravjev.mak@yandex.ru";
+47 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  fetchFromGitHub,
  cmake,
  pkg-config,
  protobuf,
  pcre2,
  nix-update-script,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "holo-cli";
  version = "0.5.0";

  src = fetchFromGitHub {
    owner = "holo-routing";
    repo = "holo-cli";
    tag = "v${finalAttrs.version}";
    hash = "sha256-f34M3U7pitWuH1UQa4uJ/scIOAZiUtDXijOk8wZEm+c=";
  };

  cargoHash = "sha256-s2em9v4SRQdC0aCD4ZXyhNNYnVKkg9XFzxkOlEFHmL0=";
  passthru.updateScript = nix-update-script { };

  # Use rust nightly features
  RUSTC_BOOTSTRAP = 1;

  nativeBuildInputs = [
    cmake
    pkg-config
    protobuf
  ];
  buildInputs = [
    pcre2
  ];

  meta = {
    description = "Holo` Command Line Interface";
    homepage = "https://github.com/holo-routing/holo-cli";
    teams = with lib.teams; [ ngi ];
    maintainers = with lib.maintainers; [ themadbit ];
    license = lib.licenses.mit;
    mainProgram = "holo-cli";
    platforms = lib.platforms.all;
  };
})
+61 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  fetchFromGitHub,
  cmake,
  pkg-config,
  protobuf,
  pcre2,
  nix-update-script,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "holo-daemon";
  version = "0.7.0";

  src = fetchFromGitHub {
    owner = "holo-routing";
    repo = "holo";
    tag = "v${finalAttrs.version}";
    hash = "sha256-wASY+binAflxaXjKdSfUXS8jgdEHjdIF3AOzjN/a1Fo=";
  };

  passthru.updateScript = nix-update-script { };

  cargoHash = "sha256-5X6a86V3Y9+KK0kGbS/ovelqXyLv15gQRFI7GhiYBjY=";

  # Use rust nightly features
  RUSTC_BOOTSTRAP = 1;

  nativeBuildInputs = [
    cmake
    pkg-config
    protobuf
  ];
  buildInputs = [
    pcre2
  ];

  # Might not be needed if latest nightly compiler version is used
  preConfigure = ''
    # Find all lib.rs and main.rs files and add required unstable features
    # Add the feature flag at the top of the file if not present`
    find . -name "lib.rs" -o -name "main.rs" | while read -r file; do
      for feature in extract_if let_chains hash_extract_if; do
        if ! grep -q "feature.*$feature" "$file"; then
          sed -i "1i #![feature($feature)]" "$file"
        fi
      done
    done
  '';

  meta = {
    description = "`holo` daemon that provides the routing protocols, tools and policies";
    homepage = "https://github.com/holo-routing/holo";
    teams = with lib.teams; [ ngi ];
    maintainers = with lib.maintainers; [ themadbit ];
    license = lib.licenses.mit;
    mainProgram = "holod";
    platforms = lib.platforms.linux;
  };
})