2019-08-30 20:44:30 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2019-09-27 14:07:14 +00:00
|
|
|
, setuptools
|
2021-05-07 20:37:56 +00:00
|
|
|
, setuptools-scm
|
2019-08-30 20:44:30 +00:00
|
|
|
, pyvcd
|
|
|
|
, jinja2
|
2021-02-10 04:47:21 +00:00
|
|
|
, importlib-resources
|
|
|
|
, importlib-metadata
|
2021-05-07 20:37:56 +00:00
|
|
|
, git
|
2019-08-30 20:44:30 +00:00
|
|
|
|
2019-10-13 16:29:13 +00:00
|
|
|
# for tests
|
2020-09-10 01:26:17 +00:00
|
|
|
, pytestCheckHook
|
2019-08-30 20:44:30 +00:00
|
|
|
, yosys
|
|
|
|
, symbiyosys
|
|
|
|
, yices
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nmigen";
|
2021-02-10 04:47:21 +00:00
|
|
|
version = "unstable-2021-02-09";
|
2019-09-27 14:07:14 +00:00
|
|
|
# python setup.py --version
|
2021-02-10 04:47:21 +00:00
|
|
|
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";
|
2020-09-10 01:26:17 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2019-08-30 20:44:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-02-08 17:48:27 +00:00
|
|
|
owner = "nmigen";
|
2019-08-30 20:44:30 +00:00
|
|
|
repo = "nmigen";
|
2021-02-10 04:47:21 +00:00
|
|
|
rev = "f7c2b9419f9de450be76a0e9cf681931295df65f";
|
|
|
|
sha256 = "0cjs9wgmxa76xqmjhsw4fsb2mhgvd85jgs2mrjxqp6fwp8rlgnl1";
|
2019-08-30 20:44:30 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 20:37:56 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm git ];
|
2019-09-27 14:07:14 +00:00
|
|
|
|
2021-02-10 04:47:21 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
pyvcd
|
|
|
|
jinja2
|
|
|
|
] ++
|
|
|
|
lib.optional (pythonOlder "3.9") importlib-resources ++
|
|
|
|
lib.optional (pythonOlder "3.8") importlib-metadata;
|
2019-08-30 20:44:30 +00:00
|
|
|
|
2020-09-10 01:26:17 +00:00
|
|
|
checkInputs = [ pytestCheckHook yosys symbiyosys yices ];
|
2019-08-30 20:44:30 +00:00
|
|
|
|
2019-09-27 14:07:14 +00:00
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
|
|
|
|
'';
|
|
|
|
|
2019-08-30 20:44:30 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A refreshed Python toolbox for building complex digital hardware";
|
2020-07-07 22:04:03 +00:00
|
|
|
homepage = "https://nmigen.info/nmigen";
|
2020-02-08 17:48:27 +00:00
|
|
|
license = licenses.bsd2;
|
2019-08-30 20:44:30 +00:00
|
|
|
maintainers = with maintainers; [ emily ];
|
|
|
|
};
|
|
|
|
}
|