2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
, setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
, pyvcd
|
|
|
|
, jinja2
|
2021-02-13 14:23:35 +00:00
|
|
|
, importlib-resources
|
|
|
|
, importlib-metadata
|
2021-05-20 23:08:51 +00:00
|
|
|
, git
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# for tests
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, symbiyosys
|
|
|
|
, yices
|
2021-07-14 22:03:04 +00:00
|
|
|
, yosys
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nmigen";
|
2021-02-13 14:23:35 +00:00
|
|
|
version = "unstable-2021-02-09";
|
2020-04-24 23:36:52 +00:00
|
|
|
# python setup.py --version
|
2021-02-13 14:23:35 +00:00
|
|
|
realVersion = "0.3.dev243+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";
|
2021-02-13 14:23:35 +00:00
|
|
|
rev = "f7c2b9419f9de450be76a0e9cf681931295df65f";
|
|
|
|
sha256 = "0cjs9wgmxa76xqmjhsw4fsb2mhgvd85jgs2mrjxqp6fwp8rlgnl1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
git
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
2021-07-14 22:03:04 +00:00
|
|
|
pyvcd
|
|
|
|
setuptools
|
2021-02-13 14:23:35 +00:00
|
|
|
] ++
|
|
|
|
lib.optional (pythonOlder "3.9") importlib-resources ++
|
|
|
|
lib.optional (pythonOlder "3.8") importlib-metadata;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
symbiyosys
|
|
|
|
yices
|
|
|
|
yosys
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "Jinja2~=2.11" "Jinja2>=2.11"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
pythonImportsCheck = [ "nmigen" ];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|