Skip to content

Commit 1e35125

Browse files
cve-bin-tool: 3.3 -> 3.4 (#369188)
2 parents 72b4fe2 + 96c8bfa commit 1e35125

File tree

6 files changed

+147
-24
lines changed

6 files changed

+147
-24
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
python3Packages,
3+
}:
4+
5+
python3Packages.toPythonApplication python3Packages.csaf-tool
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
packageurl-python,
6+
pythonOlder,
7+
rich,
8+
setuptools,
9+
versionCheckHook,
10+
}:
11+
12+
buildPythonPackage rec {
13+
pname = "csaf-tool";
14+
version = "0.3.2";
15+
pyproject = true;
16+
17+
disabled = pythonOlder "3.6";
18+
19+
src = fetchFromGitHub {
20+
owner = "anthonyharrison";
21+
repo = "csaf";
22+
tag = "${version}";
23+
hash = "sha256-LR6r03z0nvvAQgFHaTWfukoJmLZ6SLPXfbp/G8N/HtM=";
24+
};
25+
26+
build-system = [ setuptools ];
27+
28+
dependencies = [
29+
packageurl-python
30+
rich
31+
];
32+
33+
# has not tests
34+
doCheck = false;
35+
36+
pythonImportsCheck = [ "csaf" ];
37+
38+
nativeCheckInputs = [ versionCheckHook ];
39+
40+
meta = with lib; {
41+
description = "CSAF generator and validator";
42+
homepage = "https://github.com/anthonyharrison/csaf";
43+
changelog = "https://github.com/anthonyharrison/csaf/releases/tag/${src.tag}";
44+
license = licenses.asl20;
45+
maintainers = with maintainers; [ teatwig ];
46+
};
47+
}

pkgs/development/python-modules/lib4sbom/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
buildPythonPackage rec {
1414
pname = "lib4sbom";
15-
version = "0.8.1";
15+
version = "0.8.3";
1616
pyproject = true;
1717

1818
disabled = pythonOlder "3.7";
@@ -21,7 +21,7 @@ buildPythonPackage rec {
2121
owner = "anthonyharrison";
2222
repo = "lib4sbom";
2323
tag = "v${version}";
24-
hash = "sha256-OxYYHiV7TuPiLyd/rdrGfY3agv0vBcATaod37XYb7DY=";
24+
hash = "sha256-7ERjzfMIz1tRvShxO2hR+DzRYyfV3KxpHmgJTLErnRw=";
2525
};
2626

2727
build-system = [ setuptools ];
@@ -60,7 +60,7 @@ buildPythonPackage rec {
6060
meta = with lib; {
6161
description = "Library to ingest and generate SBOMs";
6262
homepage = "https://github.com/anthonyharrison/lib4sbom";
63-
changelog = "https://github.com/anthonyharrison/lib4sbom/releases/tag/v${version}";
63+
changelog = "https://github.com/anthonyharrison/lib4sbom/releases/tag/${src.tag}";
6464
license = licenses.asl20;
6565
maintainers = with maintainers; [ teatwig ];
6666
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
csaf-tool,
6+
lib4sbom,
7+
packageurl-python,
8+
pythonOlder,
9+
setuptools,
10+
}:
11+
12+
buildPythonPackage rec {
13+
pname = "lib4vex";
14+
version = "0.2.0";
15+
pyproject = true;
16+
17+
disabled = pythonOlder "3.7";
18+
19+
src = fetchFromGitHub {
20+
owner = "anthonyharrison";
21+
repo = "lib4vex";
22+
tag = "v${version}";
23+
hash = "sha256-mR9ZpJDC2O04js3Kd/8qlg4Ds/jy2CmpTywRVYqmnQw=";
24+
};
25+
26+
build-system = [ setuptools ];
27+
28+
dependencies = [
29+
csaf-tool
30+
lib4sbom
31+
packageurl-python
32+
];
33+
34+
# has no tests
35+
doCheck = false;
36+
37+
pythonImportsCheck = [ "lib4vex" ];
38+
39+
meta = with lib; {
40+
description = "Library to ingest and generate VEX documents";
41+
homepage = "https://github.com/anthonyharrison/lib4vex";
42+
changelog = "https://github.com/anthonyharrison/lib4vex/releases/tag/${src.tag}";
43+
license = licenses.asl20;
44+
maintainers = with maintainers; [ teatwig ];
45+
};
46+
}

pkgs/tools/security/cve-bin-tool/default.nix

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,68 @@
22
lib,
33
buildPythonApplication,
44
fetchFromGitHub,
5-
# aiohttp[speedups]
6-
aiodns,
5+
6+
# build-system
7+
setuptools,
8+
9+
# dependencies
710
aiohttp,
811
beautifulsoup4,
912
brotlipy,
1013
cvss,
1114
distro,
1215
filetype,
13-
google-cloud-sdk,
1416
jinja2,
1517
jsonschema,
1618
lib4sbom,
19+
lib4vex,
1720
packageurl-python,
1821
packaging,
1922
plotly,
20-
pytestCheckHook,
2123
python-gnupg,
2224
pyyaml,
2325
requests,
2426
rich,
2527
rpmfile,
26-
setuptools,
2728
xmlschema,
29+
zipp,
2830
zstandard,
31+
32+
# optional-dependencies
2933
reportlab,
30-
pip,
31-
testers,
32-
cve-bin-tool,
34+
35+
# runtime-dependencies
36+
google-cloud-sdk,
37+
38+
# tests
39+
versionCheckHook,
3340
}:
3441

3542
buildPythonApplication rec {
3643
pname = "cve-bin-tool";
37-
version = "3.3";
38-
format = "setuptools";
44+
version = "3.4";
45+
pyproject = true;
3946

4047
src = fetchFromGitHub {
4148
owner = "intel";
4249
repo = "cve-bin-tool";
4350
tag = "v${version}";
44-
hash = "sha256-A5w4U5EDX+UZWNMuz8GTOcubo8N2KfDlVV0aRNsO8/E=";
51+
hash = "sha256-pv8XjKjZBUw5FmmUn1dakGeS1uw2xzF3wSIZOYQ2/3c=";
4552
};
4653

47-
# Wants to open a sqlite database, access the internet, etc
48-
doCheck = false;
54+
build-system = [ setuptools ];
4955

5056
dependencies = [
51-
# aiohttp[speedups]
52-
aiodns
5357
aiohttp
5458
beautifulsoup4
5559
brotlipy
5660
cvss
5761
distro
5862
filetype
59-
google-cloud-sdk # gsutil
6063
jinja2
6164
jsonschema
6265
lib4sbom
66+
lib4vex
6367
packageurl-python
6468
packaging
6569
plotly
@@ -70,24 +74,41 @@ buildPythonApplication rec {
7074
rpmfile
7175
setuptools
7276
xmlschema
77+
zipp
7378
zstandard
74-
];
79+
] ++ aiohttp.optional-dependencies.speedups;
7580

7681
optional-dependencies = {
7782
pdf = [ reportlab ];
7883
};
7984

80-
propagatedBuildInputs = [ pip ];
85+
pythonRemoveDeps = [
86+
# gsutil is only called as a binary at runtime instead of being used as a library
87+
"gsutil"
88+
];
8189

82-
nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);
90+
# don't run pytestCheckHook because it wants to open a sqlite database, access the internet, etc
91+
nativeCheckInputs = [
92+
versionCheckHook
93+
] ++ lib.flatten (lib.attrValues optional-dependencies);
8394

84-
pythonImportsCheck = [ "cve_bin_tool" ];
95+
pythonImportsCheck = [
96+
"cve_bin_tool"
97+
"cve_bin_tool.mismatch_loader"
98+
];
8599

86-
passthru.tests.version = testers.testVersion { package = cve-bin-tool; };
100+
# provide gsutil
101+
makeWrapperArgs = [
102+
"--prefix"
103+
"PATH"
104+
":"
105+
(lib.makeBinPath [ google-cloud-sdk ])
106+
];
87107

88108
meta = with lib; {
89109
description = "CVE Binary Checker Tool";
90110
homepage = "https://github.com/intel/cve-bin-tool";
111+
changelog = "https://github.com/intel/cve-bin-tool/releases/tag/${src.tag}";
91112
license = licenses.gpl3Plus;
92113
maintainers = [ ];
93114
};

pkgs/top-level/python-packages.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,6 +2946,8 @@ self: super: with self; {
29462946

29472947
crytic-compile = callPackage ../development/python-modules/crytic-compile { };
29482948

2949+
csaf-tool = callPackage ../development/python-modules/csaf-tool { };
2950+
29492951
cson = callPackage ../development/python-modules/cson { };
29502952

29512953
csrmesh = callPackage ../development/python-modules/csrmesh { };
@@ -7644,6 +7646,8 @@ self: super: with self; {
76447646

76457647
lib4sbom = callPackage ../development/python-modules/lib4sbom { };
76467648

7649+
lib4vex = callPackage ../development/python-modules/lib4vex { };
7650+
76477651
libagent = callPackage ../development/python-modules/libagent { };
76487652

76497653
libais = callPackage ../development/python-modules/libais { };

0 commit comments

Comments
 (0)