depot/third_party/nixpkgs/pkgs/development/python-modules/nmigen/default.nix
Default email 3e2acf8aff Project import generated by Copybara.
GitOrigin-RevId: d42cd445dde587e9a993cd9434cb43da07c4c5de
2021-05-20 18:08:51 -05:00

56 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, setuptools
, setuptools-scm
, pyvcd
, jinja2
, importlib-resources
, importlib-metadata
, git
# for tests
, pytestCheckHook
, yosys
, symbiyosys
, yices
}:
buildPythonPackage rec {
pname = "nmigen";
version = "unstable-2021-02-09";
# python setup.py --version
realVersion = "0.3.dev243+g${lib.substring 0 7 src.rev}";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "nmigen";
repo = "nmigen";
rev = "f7c2b9419f9de450be76a0e9cf681931295df65f";
sha256 = "0cjs9wgmxa76xqmjhsw4fsb2mhgvd85jgs2mrjxqp6fwp8rlgnl1";
};
nativeBuildInputs = [ setuptools-scm git ];
propagatedBuildInputs = [
setuptools
pyvcd
jinja2
] ++
lib.optional (pythonOlder "3.9") importlib-resources ++
lib.optional (pythonOlder "3.8") importlib-metadata;
checkInputs = [ pytestCheckHook yosys symbiyosys yices ];
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}"
'';
meta = with lib; {
description = "A refreshed Python toolbox for building complex digital hardware";
homepage = "https://nmigen.info/nmigen";
license = licenses.bsd2;
maintainers = with maintainers; [ emily ];
};
}