nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 jinja2,
7 ply,
8 iverilog,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pyverilog";
14 version = "1.3.0";
15 pyproject = true;
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "1a74k8r21swmfwvgv4c014y6nbcyl229fspxw89ygsgb0j83xnar";
20 };
21
22 patchPhase = ''
23 # The path to Icarus can still be overridden via an environment variable at runtime.
24 substituteInPlace pyverilog/vparser/preprocessor.py \
25 --replace-fail \
26 "iverilog = 'iverilog'" \
27 "iverilog = '${lib.getExe' iverilog "iverilog"}'"
28 '';
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 jinja2
34 ply
35 iverilog
36 ];
37
38 preCheck = ''
39 substituteInPlace pytest.ini \
40 --replace-fail "python_paths" "pythonpath"
41 '';
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 meta = {
46 homepage = "https://github.com/PyHDI/Pyverilog";
47 description = "Python-based Hardware Design Processing Toolkit for Verilog HDL";
48 license = lib.licenses.asl20;
49 maintainers = with lib.maintainers; [ trepetti ];
50 };
51}