Unverified Commit 4babefd7 authored by Silvan Mosberger's avatar Silvan Mosberger Committed by GitHub
Browse files

genealogos: init at 1.0.0 (#309849)

parents bde2c002 766bdd1d
Loading
Loading
Loading
Loading
+2876 −0

File added.

Preview size limit exceeded, changes collapsed.

+63 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  fetchFromGitHub,

  pkg-config,
  openssl,
}:
let
  mkGenealogosPackage =
    {
      crate ? "cli",
    }:
    rustPlatform.buildRustPackage rec {
      pname = "genealogos-${crate}";
      version = "1.0.0";

      src = fetchFromGitHub {
        owner = "tweag";
        repo = "genealogos";
        rev = "v${version}";
        hash = "sha256-EQrKInsrqlpjySX6duylo++2qwglB3EqGfLFJucOQM8=";
        # Genealogos' fixture tests contain valid nix store paths, and are thus incompatible with a fixed-output-derivation.
        # To avoid this, we just remove the tests
        postFetch = ''
          rm -r $out/genealogos/tests/
        '';
      };

      cargoLock = {
        lockFile = ./Cargo.lock;
        outputHashes = {
          "nixtract-0.3.0" = "sha256-fXM6Gle4dt1iJgI6NuPl9l00i5sXGYkE+sUvFdps44s=";
        };
      };

      cargoBuildFlags = [
        "-p"
        "genealogos-${crate}"
      ];
      cargoTestFlags = cargoBuildFlags;

      nativeBuildInputs = [ pkg-config ];
      buildInputs = [ openssl ];

      # Since most tests were removed, just skip testing
      doCheck = false;

      meta = with lib; {
        description = "A Nix sbom generator";
        homepage = "https://github.com/tweag/genealogos";
        license = licenses.mit;
        maintainers = with maintainers; [ erin ];
        changelog = "https://github.com/tweag/genealogos/blob/${src.rev}/CHANGELOG.md";
        mainProgram = "genealogos";
        platforms = lib.platforms.unix;
      };
    };
in
{
  genealogos-cli = mkGenealogosPackage { };
  genealogos-api = mkGenealogosPackage { crate = "api"; };
}
+2 −0
Original line number Diff line number Diff line
@@ -1000,6 +1000,8 @@ with pkgs;
    inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon Cocoa VideoToolbox;
  };
  inherit (callPackage ../development/tools/genealogos { }) genealogos-cli genealogos-api;
  # This is to workaround gfal2-python broken against Python 3.12 or later.
  # TODO: Remove these lines after solving the breakage.
  gfal2-util = callPackage ../by-name/gf/gfal2-util/package.nix (lib.optionalAttrs python3Packages.gfal2-python.meta.broken {