1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, amaranth 5, setuptools 6, setuptools-scm 7}: 8 9buildPythonPackage rec { 10 pname = "amaranth-soc"; 11 version = "unstable-2023-09-15"; 12 # python setup.py --version 13 realVersion = "0.1.dev70+g${lib.substring 0 7 src.rev}"; 14 15 src = fetchFromGitHub { 16 owner = "amaranth-lang"; 17 repo = "amaranth-soc"; 18 rev = "cce8a79a37498f4d5900be21a295ba77e51e6c9d"; 19 sha256 = "sha256-hfkJaqICuy3iSTwLM9lbUPvSMDBLW8GdxqswyAOsowo="; 20 }; 21 22 nativeBuildInputs = [ setuptools-scm ]; 23 propagatedBuildInputs = [ setuptools amaranth ]; 24 25 preBuild = '' 26 export SETUPTOOLS_SCM_PRETEND_VERSION="${realVersion}" 27 ''; 28 29 meta = with lib; { 30 description = "System on Chip toolkit for Amaranth HDL"; 31 homepage = "https://github.com/amaranth-lang/amaranth-soc"; 32 license = licenses.bsd2; 33 maintainers = with maintainers; [ emily thoughtpolice ]; 34 }; 35}