about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/cyclonedx-python/default.nix
blob: 8284035c99e14c5a5e112faf0d1e8cbb0cedac27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, python3
, fetchFromGitHub
}:
python3.pkgs.buildPythonApplication rec {
  pname = "cyclonedx-python";
  version = "0.4.3";

  src = fetchFromGitHub {
    owner = "CycloneDX";
    repo = "cyclonedx-python";
    rev = "v${version}";
    sha256 = "BvG4aWBMsllW2L4lLsiRFUCPjgoDpHxN49fsUFdg7tQ=";
  };

  # They pin versions for exact version numbers because "A bill-of-material such
  # as CycloneDX expects exact version numbers" -- but that's unnecessary with
  # Nix.
  preBuild = ''
    sed "s@==.*'@'@" -i setup.py
  '';

  propagatedBuildInputs = with python3.pkgs; [
    packageurl-python
    requests
    xmlschema
    setuptools
    requirements-parser
    packaging
    chardet
    jsonschema
  ];

  # the tests want access to the cyclonedx binary
  doCheck = false;

  pythonImportsCheck = [
    "cyclonedx"
  ];

  meta = with lib; {
    description = "Creates CycloneDX Software Bill of Materials (SBOM) from Python projects";
    homepage = "https://github.com/CycloneDX/cyclonedx-python";
    license = licenses.asl20;
    maintainers = [ ];
    mainProgram = "cyclonedx-py";
  };
}