summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/riscof/default.nix
blob: 39a63325c87dc84b01febdd797b4315b5ef9ea37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  jinja2,
  riscv-config,
  riscv-isac,
}:

buildPythonPackage rec {
  pname = "riscof";
  version = "1.25.3";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "riscv-software-src";
    repo = "riscof";
    tag = version;
    hash = "sha256-ToI2xI0fvnDR+hJ++T4ss5X3gc4G6Cj1uJHx0m2X7GY=";
  };

  patches = [
    # riscof copies a template directory from the store, but breaks because it
    # doesn't change permissions and expects it to be writeable
    ./make_writeable.patch
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "import pip" ""
    substituteInPlace riscof/requirements.txt \
      --replace "GitPython==3.1.17" "GitPython"
  '';

  propagatedBuildInputs = [
    riscv-isac
    riscv-config
    jinja2
  ];

  pythonImportsCheck = [ "riscof" ];

  # No unitests available
  doCheck = false;

  meta = {
    description = "RISC-V Architectural Test Framework";
    mainProgram = "riscof";
    homepage = "https://github.com/riscv-software-src/riscof";
    changelog = "https://github.com/riscv-software-src/riscof/blob/${version}/CHANGELOG.md";
    maintainers = [ ];
    license = lib.licenses.bsd3;
  };
}