1{ lib
2, attrs
3, beautifulsoup4
4, bitarray
5, boolean-py
6, buildPythonPackage
7, chardet
8, click
9, colorama
10, commoncode
11, container-inspector
12, debian-inspector
13, dparse2
14, extractcode
15, extractcode-7z
16, extractcode-libarchive
17, fasteners
18, fetchPypi
19, fingerprints
20, ftfy
21, gemfileparser
22, html5lib
23, importlib-metadata
24, intbitset
25, jaraco_functools
26, javaproperties
27, jinja2
28, jsonstreams
29, license-expression
30, lxml
31, markupsafe
32, packageurl-python
33, packaging
34, parameter-expansion-patched
35, pefile
36, pip-requirements-parser
37, pkginfo2
38, pluggy
39, plugincode
40, publicsuffix2
41, pyahocorasick
42, pycryptodome
43, pygmars
44, pygments
45, pymaven-patch
46, pytestCheckHook
47, pythonOlder
48, requests
49, saneyaml
50, spdx-tools
51, text-unidecode
52, toml
53, typecode
54, typecode-libmagic
55, typing
56, urlpy
57, xmltodict
58, zipp
59}:
60
61buildPythonPackage rec {
62 pname = "scancode-toolkit";
63 version = "31.1.1";
64
65 disabled = pythonOlder "3.6";
66
67 src = fetchPypi {
68 inherit pname version;
69 hash = "sha256-/QLW+rxkDbrv/78xiXOuSNaQvY+0oYZQV0/m60CEZLk=";
70 };
71
72 dontConfigure = true;
73
74 propagatedBuildInputs = [
75 attrs
76 beautifulsoup4
77 bitarray
78 boolean-py
79 chardet
80 click
81 colorama
82 commoncode
83 container-inspector
84 debian-inspector
85 dparse2
86 extractcode
87 extractcode-7z
88 extractcode-libarchive
89 fasteners
90 fingerprints
91 ftfy
92 gemfileparser
93 html5lib
94 importlib-metadata
95 intbitset
96 jaraco_functools
97 javaproperties
98 jinja2
99 jsonstreams
100 license-expression
101 lxml
102 markupsafe
103 packageurl-python
104 packaging
105 parameter-expansion-patched
106 pefile
107 pip-requirements-parser
108 pkginfo2
109 pluggy
110 plugincode
111 publicsuffix2
112 pyahocorasick
113 pycryptodome
114 pygmars
115 pygments
116 pymaven-patch
117 requests
118 saneyaml
119 spdx-tools
120 text-unidecode
121 toml
122 typecode
123 typecode-libmagic
124 urlpy
125 xmltodict
126 ] ++ lib.optionals (pythonOlder "3.9") [
127 zipp
128 ] ++ lib.optionals (pythonOlder "3.7") [
129 typing
130 ];
131
132 checkInputs = [
133 pytestCheckHook
134 ];
135
136 postPatch = ''
137 substituteInPlace setup.cfg \
138 --replace "pdfminer.six >= 20200101" "pdfminer.six" \
139 --replace "pluggy >= 0.12.0, < 1.0" "pluggy" \
140 --replace "pygmars >= 0.7.0" "pygmars" \
141 --replace "license_expression >= 21.6.14" "license_expression" \
142 --replace "intbitset >= 2.3.0, < 3.0" "intbitset"
143 '';
144
145 # Importing scancode needs a writeable home, and preCheck happens in between
146 # pythonImportsCheckPhase and pytestCheckPhase.
147 postInstall = ''
148 export HOME=$(mktemp -d)
149 '';
150
151 pythonImportsCheck = [
152 "scancode"
153 ];
154
155 # takes a long time and doesn't appear to do anything
156 dontStrip = true;
157
158 meta = with lib; {
159 description = "Tool to scan code for license, copyright, package and their documented dependencies and other interesting facts";
160 homepage = "https://github.com/nexB/scancode-toolkit";
161 license = with licenses; [ asl20 cc-by-40 ];
162 maintainers = teams.determinatesystems.members;
163 };
164}