2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
flit-core,
|
|
|
|
ninja,
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ninja";
|
2023-08-22 20:05:09 +00:00
|
|
|
inherit (ninja) version;
|
2023-08-04 22:07:22 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
src = ./stub;
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
substituteInPlace "$sourceRoot/pyproject.toml" \
|
|
|
|
--subst-var version
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
substituteInPlace "$sourceRoot/ninja/__init__.py" \
|
2023-10-09 19:29:22 +00:00
|
|
|
--subst-var version \
|
2023-08-22 20:05:09 +00:00
|
|
|
--subst-var-by BIN_DIR "${ninja}/bin"
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
inherit (ninja) setupHook;
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
preBuild = ''
|
|
|
|
cp "${ninja.src}/misc/ninja_syntax.py" ninja/ninja_syntax.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"ninja"
|
|
|
|
"ninja.ninja_syntax"
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Small build system with a focus on speed";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ninja";
|
2023-08-22 20:05:09 +00:00
|
|
|
longDescription = ''
|
|
|
|
This is a stub of the ninja package on PyPI that uses the ninja program
|
|
|
|
provided by nixpkgs instead of downloading ninja from the web.
|
|
|
|
'';
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/scikit-build/ninja-python-distributions";
|
|
|
|
license = licenses.asl20;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
_999eagle
|
|
|
|
tjni
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|