1 { lib, stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
3 buildPythonPackage rec {
7 src = fetchFromGitHub {
11 sha256 = "0fv0mg8zh40ffq0q39s195y6hvjrzihpx0i3f7ba5881syw3x7p4";
14 propagatedBuildInputs = [
19 patchShebangs bin/*.py
21 # POSIX portability (TODO: upstream this)
23 cocotb/share/makefiles/Makefile.* \
24 cocotb/share/makefiles/simulators/Makefile.*
26 substituteInPlace $f --replace 'shell which' 'shell command -v'
30 checkInputs = [ swig verilog ];
33 # test expected failures actually pass because of a fix in our icarus version
34 # https://github.com/cocotb/cocotb/issues/1952
35 substituteInPlace tests/test_cases/test_discovery/test_discovery.py \
36 --replace 'def access_single_bit' $'def foo(x): pass\ndef foo'
38 export PATH=$out/bin:$PATH
43 description = "Coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python";
44 homepage = "https://github.com/cocotb/cocotb";
45 license = licenses.bsd3;
46 maintainers = with maintainers; [ matthuszagh ];
47 broken = stdenv.isDarwin;