2019-08-30 21:44:30 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2019-09-27 15:07:14 +01:00
|
|
|
, setuptools
|
|
|
|
, setuptools_scm
|
2019-08-30 21:44:30 +01:00
|
|
|
, pyvcd
|
|
|
|
, bitarray
|
|
|
|
, jinja2
|
|
|
|
|
2019-10-13 17:29:13 +01:00
|
|
|
# for tests
|
2019-08-30 21:44:30 +01:00
|
|
|
, yosys
|
|
|
|
, symbiyosys
|
|
|
|
, yices
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nmigen";
|
2019-10-13 17:29:13 +01:00
|
|
|
version = "unstable-2019-10-17";
|
2019-09-27 15:07:14 +01:00
|
|
|
# python setup.py --version
|
2019-10-13 17:29:13 +01:00
|
|
|
realVersion = "0.1.rc2.dev5+g${lib.substring 0 7 src.rev}";
|
2019-08-30 21:44:30 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "m-labs";
|
|
|
|
repo = "nmigen";
|
2019-10-13 17:29:13 +01:00
|
|
|
rev = "9fba5ccb513cfbd53f884b1efca699352d2471b9";
|
|
|
|
sha256 = "02bjry4sqjsrhl0s42zl1zl06gk5na9i6br6vmz7fvxic29vl83v";
|
2019-08-30 21:44:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2019-09-27 15:07:14 +01:00
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ setuptools pyvcd bitarray jinja2 ];
|
2019-08-30 21:44:30 +01:00
|
|
|
|
2019-10-13 17:29:13 +01:00
|
|
|
checkInputs = [ yosys symbiyosys yices ];
|
2019-08-30 21:44:30 +01:00
|
|
|
|
2019-09-27 15:07:14 +01:00
|
|
|
preBuild = ''
|
|
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
|
|
|
|
'';
|
|
|
|
|
2019-08-30 21:44:30 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A refreshed Python toolbox for building complex digital hardware";
|
|
|
|
homepage = https://github.com/m-labs/nmigen;
|
|
|
|
license = licenses.bsd0;
|
|
|
|
maintainers = with maintainers; [ emily ];
|
|
|
|
};
|
|
|
|
}
|