1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 amaranth, 6 pdm-backend, 7}: 8 9buildPythonPackage rec { 10 pname = "amaranth-soc"; 11 version = "0-unstable-2024-02-16"; 12 pyproject = true; 13 # from `pdm show` 14 realVersion = "0.1a1.dev1+g${lib.substring 0 7 src.rev}"; 15 16 src = fetchFromGitHub { 17 owner = "amaranth-lang"; 18 repo = "amaranth-soc"; 19 rev = "9f46553aa4289e2a11788a73fade6410a371b162"; 20 hash = "sha256-ZllDSrZEu16jZtbQ7crQSj3XCbsthueXtaAvyf45dmY="; 21 }; 22 23 nativeBuildInputs = [ pdm-backend ]; 24 dependencies = [ amaranth ]; 25 26 preBuild = '' 27 export PDM_BUILD_SCM_VERSION="${realVersion}" 28 ''; 29 30 meta = with lib; { 31 description = "System on Chip toolkit for Amaranth HDL"; 32 homepage = "https://github.com/amaranth-lang/amaranth-soc"; 33 license = licenses.bsd2; 34 maintainers = with maintainers; [ 35 emily 36 thoughtpolice 37 pbsds 38 ]; 39 }; 40}