2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools
|
|
|
|
, setuptools_scm
|
|
|
|
, pyvcd
|
|
|
|
, jinja2
|
|
|
|
|
|
|
|
# for tests
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, yosys
|
|
|
|
, symbiyosys
|
|
|
|
, yices
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nmigen";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "unstable-2020-04-02";
|
2020-04-24 23:36:52 +00:00
|
|
|
# python setup.py --version
|
|
|
|
realVersion = "0.2.dev49+g${lib.substring 0 7 src.rev}";
|
2020-09-25 04:45:31 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nmigen";
|
|
|
|
repo = "nmigen";
|
2020-07-18 16:06:22 +00:00
|
|
|
rev = "c79caead33fff14e2dec42b7e21d571a02526876";
|
|
|
|
sha256 = "sha256-3+mxHyg0a92/BfyePtKT5Hsk+ra+fQzTjCJ2Ech44/s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ setuptools pyvcd jinja2 ];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
checkInputs = [ pytestCheckHook yosys symbiyosys yices ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Fail b/c can't find sby (symbiyosys) executable, which should be on path.
|
|
|
|
disabledTests = [
|
|
|
|
"test_distance"
|
|
|
|
"test_reversible"
|
|
|
|
"FIFOFormalCase"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A refreshed Python toolbox for building complex digital hardware";
|
2020-07-18 16:06:22 +00:00
|
|
|
homepage = "https://nmigen.info/nmigen";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ emily ];
|
|
|
|
};
|
|
|
|
}
|