From 2c53f0f9f308e5c9f3464922c765b908a97e1942 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Fri, 18 Oct 2019 09:56:56 -0700 Subject: [PATCH 1/3] maintainers: add matthuszagh --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b301b2d284d..9e088815e2d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4059,6 +4059,12 @@ githubId = 427866; name = "Matthias Beyer"; }; + matthuszagh = { + email = "huszaghmatt@gmail.com"; + github = "matthuszagh"; + githubId = 7377393; + name = "Matt Huszagh"; + }; matti-kariluoma = { email = "matti@kariluo.ma"; github = "matti-kariluoma"; From 6407a35d3702117641acd21ed6871b021c617411 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Thu, 17 Oct 2019 07:24:02 -0700 Subject: [PATCH 2/3] pythonPackages.cocotb: init at 1.2.0 --- .../python-modules/cocotb/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/cocotb/default.nix diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix new file mode 100644 index 00000000000..228ac7904ec --- /dev/null +++ b/pkgs/development/python-modules/cocotb/default.nix @@ -0,0 +1,43 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }: + +buildPythonPackage rec { + pname = "cocotb"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "091q63jcm87xggqgqi44lw2vjxhl1v4yl0mv2c76hgavb29w4w5y"; + }; + + 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 + ''; + + 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"; + homepage = https://github.com/cocotb/cocotb; + license = licenses.bsd3; + maintainers = with maintainers; [ matthuszagh ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e1e6a62d206..45b5ebfbe85 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -489,6 +489,8 @@ in { cnvkit = callPackage ../development/python-modules/cnvkit { }; + cocotb = callPackage ../development/python-modules/cocotb { }; + connexion = callPackage ../development/python-modules/connexion { }; cozy = callPackage ../development/python-modules/cozy { }; From 2924904d95e9fa845ee271a51a06d7a8650267be Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 25 Oct 2019 04:20:00 -0500 Subject: [PATCH 3/3] pythonPackages.cocotb: fix build on darwin --- pkgs/development/python-modules/cocotb/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix index 228ac7904ec..e10ecd8e840 100644 --- a/pkgs/development/python-modules/cocotb/default.nix +++ b/pkgs/development/python-modules/cocotb/default.nix @@ -24,6 +24,9 @@ buildPythonPackage rec { cocotb/share/makefiles/simulators/Makefile.* do substituteInPlace $f --replace 'shell which' 'shell command -v' + # replace hardcoded gcc. Remove once https://github.com/cocotb/cocotb/pull/1137 gets merged + substituteInPlace $f --replace 'gcc' '$(CC)' + substituteInPlace $f --replace 'g++' '$(CXX)' done '';