spicedb: 1.39.1 -> 1.40.0
[NixPkgs.git] / pkgs / development / python-modules / cocotb / default.nix
blobf674120157ead4c05c56fcfc0b9fbca85dbd1a98
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   setuptools,
6   setuptools-scm,
7   cocotb-bus,
8   find-libpython,
9   pytestCheckHook,
10   swig,
11   iverilog,
12   ghdl,
13   stdenv,
14   fetchpatch,
17 buildPythonPackage rec {
18   pname = "cocotb";
19   version = "1.9.2";
20   format = "setuptools";
22   # pypi source doesn't include tests
23   src = fetchFromGitHub {
24     owner = "cocotb";
25     repo = "cocotb";
26     tag = "v${version}";
27     hash = "sha256-7KCo7g2I1rfm8QDHRm3ZKloHwjDIICnJCF8KhaFdvqY=";
28   };
30   nativeBuildInputs = [ setuptools-scm ];
32   buildInputs = [ setuptools ];
33   propagatedBuildInputs = [ find-libpython ];
35   postPatch = ''
36     patchShebangs bin/*.py
38     # POSIX portability (TODO: upstream this)
39     for f in \
40       cocotb/share/makefiles/Makefile.* \
41       cocotb/share/makefiles/simulators/Makefile.*
42     do
43       substituteInPlace $f --replace 'shell which' 'shell command -v'
44     done
46     # remove circular dependency cocotb-bus from setup.py
47     substituteInPlace setup.py --replace "'cocotb-bus<1.0'" ""
48   '';
50   disabledTests = [
51     # https://github.com/cocotb/cocotb/commit/425e1edb8e7133f4a891f2f87552aa2748cd8d2c#diff-4df986cbc2b1a3f22172caea94f959d8fcb4a128105979e6e99c68139469960cL33
52     "test_cocotb"
53     "test_cocotb_parallel"
54   ];
56   nativeCheckInputs = [
57     cocotb-bus
58     pytestCheckHook
59     swig
60     iverilog
61     ghdl
62   ];
64   preCheck = ''
65     export PATH=$out/bin:$PATH
66     mv cocotb cocotb.hidden
67   '';
69   pythonImportsCheck = [ "cocotb" ];
71   meta = {
72     changelog = "https://github.com/cocotb/cocotb/releases/tag/v${version}";
73     description = "Coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python";
74     mainProgram = "cocotb-config";
75     homepage = "https://github.com/cocotb/cocotb";
76     license = lib.licenses.bsd3;
77     broken = stdenv.hostPlatform.isDarwin;
78     maintainers = with lib.maintainers; [
79       matthuszagh
80       jleightcap
81     ];
82   };