1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 click,
6 colorlog,
7 gitpython,
8 pluggy,
9 pyelftools,
10 pytablewriter,
11 pytestCheckHook,
12 pyyaml,
13 ruamel-yaml,
14 pythonOlder,
15}:
16
17buildPythonPackage rec {
18 pname = "riscv-isac";
19 version = "0.18.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "riscv-software-src";
26 repo = "riscv-isac";
27 tag = version;
28 hash = "sha256-7CWUyYwzynFq/Qk5SzQB+ljsVVI98kPPDT63Emhqihw=";
29 };
30
31 postPatch = ''
32 substituteInPlace riscv_isac/requirements.txt \
33 --replace "pyelftools==0.26" "pyelftools" \
34 --replace "pytest" ""
35 '';
36
37 propagatedBuildInputs = [
38 click
39 colorlog
40 gitpython
41 pluggy
42 pyelftools
43 pytablewriter
44 pyyaml
45 ruamel-yaml
46 ];
47
48 nativeCheckInputs = [ pytestCheckHook ];
49
50 pythonImportsCheck = [ "riscv_isac" ];
51
52 meta = with lib; {
53 description = "ISA coverage extraction tool";
54 mainProgram = "riscv_isac";
55 homepage = "https://github.com/riscv/riscv-isac";
56 changelog = "https://github.com/riscv-software-src/riscv-isac/blob/${version}/CHANGELOG.md";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ genericnerdyusername ];
59 };
60}