Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, colorama 6, meson 7, ninja 8, pyproject-metadata 9, tomli 10, typing-extensions 11, pythonOlder 12}: 13 14buildPythonPackage rec { 15 pname = "meson-python"; 16 version = "0.12.1"; 17 format = "pyproject"; 18 19 src = fetchPypi { 20 inherit version; 21 pname = "meson_python"; 22 hash = "sha256-PVs+WB1wpYqXucEWp16Xp2zEtMfnX6Blj8g5I3Hi8sI="; 23 }; 24 25 nativeBuildInputs = [ 26 meson 27 ninja 28 pyproject-metadata 29 tomli 30 ] ++ lib.optionals (pythonOlder "3.10") [ 31 typing-extensions 32 ]; 33 34 propagatedBuildInputs = [ 35 meson 36 ninja 37 pyproject-metadata 38 tomli 39 ] ++ lib.optionals (pythonOlder "3.10") [ 40 typing-extensions 41 ]; 42 43 # Ugly work-around. Drop ninja dependency. 44 # We already have ninja, but it comes without METADATA. 45 # Building ninja-python-distributions is the way to go. 46 postPatch = '' 47 substituteInPlace pyproject.toml --replace "'ninja'," "" 48 ''; 49 50 meta = { 51 changelog = "https://github.com/mesonbuild/meson-python/blob/${version}/CHANGELOG.rst"; 52 description = "Meson Python build backend (PEP 517)"; 53 homepage = "https://github.com/mesonbuild/meson-python"; 54 license = [ lib.licenses.mit ]; 55 maintainers = [ lib.maintainers.fridh ]; 56 }; 57}