2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-08-22 20:05:09 +00:00
|
|
|
, 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" \
|
|
|
|
--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
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
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; {
|
|
|
|
description = "A small build system with a focus on speed";
|
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;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ _999eagle tjni ];
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|