nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 fetchpatch,
7 pythonOlder,
8
9 # build-system, dependencies
10 meson,
11 ninja,
12 pyproject-metadata,
13 tomli,
14
15 # tests
16 cmake,
17 cython,
18 gitMinimal,
19 pytestCheckHook,
20 pytest-mock,
21}:
22
23buildPythonPackage rec {
24 pname = "meson-python";
25 version = "0.19.0";
26 pyproject = true;
27
28 src = fetchPypi {
29 inherit version;
30 pname = "meson_python";
31 hash = "sha256-mVnRmKpptX/P01SjRRjG95W3gac+0GVvTQFmAWDMJVM=";
32 };
33
34 build-system = [
35 meson
36 ninja
37 pyproject-metadata
38 ]
39 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
40
41 dependencies = [
42 meson
43 ninja
44 pyproject-metadata
45 ]
46 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
47
48 nativeCheckInputs = [
49 cmake
50 cython
51 gitMinimal
52 pytestCheckHook
53 pytest-mock
54 ];
55
56 dontUseCmakeConfigure = true;
57
58 # meson-python respectes MACOSX_DEPLOYMENT_TARGET, but compares it with the
59 # actual platform version during tests, which mismatches.
60 # https://github.com/mesonbuild/meson-python/issues/760
61 # FIXME: drop in 0.19.0
62 preCheck =
63 if stdenv.hostPlatform.isDarwin then
64 ''
65 unset MACOSX_DEPLOYMENT_TARGET
66 ''
67 else
68 null;
69
70 setupHooks = [ ./add-build-flags.sh ];
71
72 meta = {
73 changelog = "https://github.com/mesonbuild/meson-python/blob/${version}/CHANGELOG.rst";
74 description = "Meson Python build backend (PEP 517)";
75 homepage = "https://github.com/mesonbuild/meson-python";
76 license = [ lib.licenses.mit ];
77 maintainers = with lib.maintainers; [ doronbehar ];
78 teams = [ lib.teams.python ];
79 };
80}