1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 git,
6 jinja2,
7 pythonOlder,
8 riscv-config,
9 riscv-isac,
10}:
11
12buildPythonPackage rec {
13 pname = "riscof";
14 version = "1.25.3";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "riscv-software-src";
21 repo = pname;
22 rev = "refs/tags/${version}";
23 hash = "sha256-ToI2xI0fvnDR+hJ++T4ss5X3gc4G6Cj1uJHx0m2X7GY=";
24 };
25
26 patches = [
27 # riscof copies a template directory from the store, but breaks because it
28 # doesn't change permissions and expects it to be writeable
29 ./make_writeable.patch
30 ];
31
32 postPatch = ''
33 substituteInPlace setup.py \
34 --replace "import pip" ""
35 substituteInPlace riscof/requirements.txt \
36 --replace "GitPython==3.1.17" "GitPython"
37 '';
38
39 propagatedBuildInputs = [
40 riscv-isac
41 riscv-config
42 jinja2
43 ];
44
45 pythonImportsCheck = [ "riscof" ];
46
47 # No unitests available
48 doCheck = false;
49
50 meta = with lib; {
51 description = "RISC-V Architectural Test Framework";
52 mainProgram = "riscof";
53 homepage = "https://github.com/riscv-software-src/riscof";
54 changelog = "https://github.com/riscv-software-src/riscof/blob/${version}/CHANGELOG.md";
55 maintainers = with maintainers; [ genericnerdyusername ];
56 license = licenses.bsd3;
57 };
58}