depot/third_party/nixpkgs/pkgs/development/python-modules/meson-python/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

60 lines
1.3 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, colorama
, meson
, ninja
, pyproject-metadata
, tomli
, typing-extensions
, pythonOlder
}:
buildPythonPackage rec {
pname = "meson-python";
version = "0.13.1";
format = "pyproject";
src = fetchPypi {
inherit version;
pname = "meson_python";
hash = "sha256-Y7MXAAFCXEL6TP7a25BRy9KJJf+O7XxA02ugCZ48dhg=";
};
nativeBuildInputs = [
meson
ninja
pyproject-metadata
tomli
] ++ lib.optionals (pythonOlder "3.10") [
typing-extensions
];
propagatedBuildInputs = [
meson
ninja
pyproject-metadata
tomli
] ++ lib.optionals (pythonOlder "3.10") [
typing-extensions
];
setupHooks = [
./add-build-flags.sh
];
# Ugly work-around. Drop ninja dependency.
# We already have ninja, but it comes without METADATA.
# Building ninja-python-distributions is the way to go.
postPatch = ''
substituteInPlace pyproject.toml --replace "'ninja'," ""
'';
meta = {
changelog = "https://github.com/mesonbuild/meson-python/blob/${version}/CHANGELOG.rst";
description = "Meson Python build backend (PEP 517)";
homepage = "https://github.com/mesonbuild/meson-python";
license = [ lib.licenses.mit ];
maintainers = [ lib.maintainers.fridh ];
};
}