2019-10-17 16:24:02 +02:00
|
|
|
{ stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cocotb";
|
2020-03-30 16:10:32 +02:00
|
|
|
version = "1.3.1";
|
2019-10-17 16:24:02 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-03-30 16:10:32 +02:00
|
|
|
sha256 = "118wp5sjsl99hj8pqw5n3v2lry9r949p2hv4l92p086q1n0axxk3";
|
2019-10-17 16:24:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs bin/*.py
|
|
|
|
|
|
|
|
# POSIX portability (TODO: upstream this)
|
|
|
|
for f in \
|
|
|
|
cocotb/share/makefiles/Makefile.* \
|
|
|
|
cocotb/share/makefiles/simulators/Makefile.*
|
|
|
|
do
|
|
|
|
substituteInPlace $f --replace 'shell which' 'shell command -v'
|
|
|
|
done
|
2020-03-01 01:11:49 +01:00
|
|
|
|
2020-03-30 16:10:32 +02:00
|
|
|
# This can probably be removed in the next update after 1.3.1
|
2020-03-01 01:11:49 +01:00
|
|
|
substituteInPlace cocotb/share/makefiles/Makefile.inc --replace "-Werror" ""
|
2019-10-17 16:24:02 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ swig verilog ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
make test
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python";
|
2020-03-01 01:11:49 +01:00
|
|
|
homepage = "https://github.com/cocotb/cocotb";
|
2019-10-17 16:24:02 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ matthuszagh ];
|
|
|
|
};
|
|
|
|
}
|