summary refs log tree commit diff
path: root/pkgs/development/python-modules/myhdl/default.nix
blob: 77e793266e7012af2d3eefdd40842b93ebf8ee1f (plain) (blame)
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
{ lib
, fetchFromGitHub
, buildPythonPackage
, verilog
, ghdl
, pytest
, pytest-xdist
}:

buildPythonPackage rec {
  pname = "myhdl";
  # The stable version is from 2019 and it doesn't pass tests
  version = "unstable-2022-04-26";
  # The pypi src doesn't contain the ci script used in checkPhase
  src = fetchFromGitHub {
    owner = "myhdl";
    repo = "myhdl";
    rev = "1a4f5cd4e9de2e7bbf1053c3c2bc9526b5cc524a";
    hash = "sha256-Tgoem88Y6AhlCKVhMm0Khg6GPcrEktYOqV8xcMaNkl4=";
  };

  checkInputs = [
    pytest
    pytest-xdist
    verilog
    ghdl
  ];
  passthru = {
    # If using myhdl as a dependency, use these if needed and not ghdl and
    # verlog from all-packages.nix
    inherit ghdl verilog;
  };
  checkPhase = ''
    runHook preCheck

    for target in {core,iverilog,ghdl}; do
      env CI_TARGET="$target" bash ./scripts/ci.sh
    done;

    runHook postCheck
  '';

  meta = with lib; {
    description = "A free, open-source package for using Python as a hardware description and verification language.";
    homepage = "http://www.myhdl.org/";
    license = licenses.lgpl21;
    maintainers = with maintainers; [ doronbehar ];
  };
}