1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, colorama
6, meson
7, ninja
8, pyproject-metadata
9, tomli
10}:
11
12buildPythonPackage rec {
13 pname = "meson-python";
14 version = "0.8.1";
15 format = "pyproject";
16
17 src = fetchPypi {
18 inherit version;
19 pname = "meson_python";
20 hash = "sha256-RC8fpM9dtQ7qYRcKYFnBD6/XCXf12980QcEGzSOwXkw=";
21 };
22
23 nativeBuildInputs = [
24 meson
25 ninja
26 pyproject-metadata
27 tomli
28 ];
29
30 propagatedBuildInputs = [
31 meson
32 ninja
33 pyproject-metadata
34 tomli
35 ];
36
37 # Ugly work-around. Drop ninja dependency.
38 # We already have ninja, but it comes without METADATA.
39 # Building ninja-python-distributions is the way to go.
40 postPatch = ''
41 substituteInPlace pyproject.toml --replace "'ninja'," ""
42 '';
43
44 meta = {
45 description = "Meson Python build backend (PEP 517)";
46 homepage = "https://github.com/FFY00/meson-python";
47 license = [ lib.licenses.mit ];
48 maintainers = [ lib.maintainers.fridh ];
49 };
50}