Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6let
7 py = python3.override {
8 packageOverrides = self: super: {
9
10 # Requires 'cyclonedx-python-lib = ">= 2.0.0, < 4.0.0"'
11 cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (oldAttrs: rec {
12 version = "3.1.5";
13 src = fetchFromGitHub {
14 owner = "CycloneDX";
15 repo = "cyclonedx-python-lib";
16 rev = "refs/tags/v${version}";
17 hash = "sha256-4lA8OdmvQD94jTeDf+Iz7ZyEQ9fZzCxnXQG9Ir8FKhk=";
18 };
19 });
20 };
21 };
22in
23with py.pkgs;
24
25python3.pkgs.buildPythonApplication rec {
26 pname = "cyclonedx-python";
27 version = "3.11.7";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "CycloneDX";
32 repo = "cyclonedx-python";
33 rev = "refs/tags/v${version}";
34 sha256 = "sha256-jU/0FkQCyph59TnEE+lckJXsU9whfvWp7dkdfzprYw8=";
35 };
36
37 nativeBuildInputs = with py.pkgs; [
38 poetry-core
39 pythonRelaxDepsHook
40 ];
41
42 propagatedBuildInputs = with py.pkgs; [
43 chardet
44 cyclonedx-python-lib
45 packageurl-python
46 pip-requirements-parser
47 setuptools
48 toml
49 ];
50
51 # The tests want access to the cyclonedx binary
52 doCheck = false;
53
54 pythonImportsCheck = [
55 "cyclonedx"
56 ];
57
58 meta = with lib; {
59 description = "Creates CycloneDX Software Bill of Materials (SBOM) from Python projects";
60 homepage = "https://github.com/CycloneDX/cyclonedx-python";
61 changelog = "https://github.com/CycloneDX/cyclonedx-python/releases/tag/v${version}";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ ];
64 mainProgram = "cyclonedx-py";
65 };
66}